audiosocket icon indicating copy to clipboard operation
audiosocket copied to clipboard

Multiple calls handling

Open scorpio1441 opened this issue 2 years ago • 5 comments

Is this true that audiosocket can only process one call at a time?

exten = 100,1,Verbose("Call to AudioSocket via Dialplan Application")
 same = n,Answer()
 same = n,AudioSocket(40325ec2-5efd-4bd3-805f-53576e581d13,server.example.com:9092)
 same = n,Hangup()

This configuration only allows one caller at a time to listen to the audio stream, second caller has to wait until the first one hangs up or stream ends playing.

scorpio1441 avatar Feb 16 '23 01:02 scorpio1441

Why do you say that? One presumes the audiosocket server can handle more than one socket connection at a time, and each call in Asterisk gets its own execution routine.

Ulexus avatar Feb 18 '23 22:02 Ulexus

I say that, because I tried using it, AudioSocket client can only handle one connection, while blocking the whole dial plan until the playback has finished. Try it yourself. 😎

scorpio1441 avatar Feb 19 '23 00:02 scorpio1441

This is used in many places and with high volumes. So far as i am aware, nothing in one asterisk call thread can block another, but i certainly have not had it happen with AudioSocket. You are saying that when one call is connected to an AudioSocket, no other calls may be processed by asterisk generally? Or no more may be sent to any AudioSocket service? Or no more may be sent to the same AudioSocket service? Or something else?

Ulexus avatar Feb 19 '23 14:02 Ulexus

I say that, because I tried using it, AudioSocket client can only handle one connection, while blocking the whole dial plan until the playback has finished. Try it yourself. 😎

there are two examples. Use multithreaded example for more than one channel. Aterisk definitely supports more than one.

arheops avatar May 02 '23 20:05 arheops

Is this true that audiosocket can only process one call at a time?

exten = 100,1,Verbose("Call to AudioSocket via Dialplan Application")
 same = n,Answer()
 same = n,AudioSocket(40325ec2-5efd-4bd3-805f-53576e581d13,server.example.com:9092)
 same = n,Hangup()

This configuration only allows one caller at a time to listen to the audio stream, second caller has to wait until the first one hangs up or stream ends playing.

If you use exact this dialplan for testing I think issue is in the same uuid you use to call Audiosocket() So try to generate unique uuid for each call that receive in exten 100, this should work

Badalien avatar Aug 04 '23 18:08 Badalien