CyCoreSystems / audiosocket

Simple bidirectional audio protocol
Apache License 2.0
67 stars 35 forks source link

Multiple calls handling #14

Open scorpio1441 opened 1 year ago

scorpio1441 commented 1 year ago

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.

Ulexus commented 1 year ago

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.

scorpio1441 commented 1 year ago

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. 😎

Ulexus commented 1 year ago

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?

arheops commented 1 year ago

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.

Badalien commented 11 months ago

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