Hello,
I’m encountering a problem using the AudioSocket app which sees no data sent to the audiosocket (apart from the initial session uuid). Using a debugger, I can see that the thread is hanging on
targetChan = ast_waitfor_nandfds(&chan, 1, &svc, 1, NULL, &outfd, &ms);
in the audiosocket_run()
function from app_audiosocket.c
. I cannot for the life of me however find the code that is supposed to be writing to the channel in this case, where is that found? Could this be due to a codec misconfiguration?
Here is my setup: I have two custom contexts set up like so in asterisk v22.0.0:
[custom-plugin-1]
exten => s,1,Answer()
exten => s,n,AudioSocket(a5e7f571-9545-4c29b22e-43a8c9b8e07e,127.0.0.1:15433)
exten => s,n,Hangup()
[custom-plugin-2]
exten => s,1,Answer()
exten => s,n,Record(/tmp/call.gsm,5,5)
exten => s,n,Hangup()
Which are set up in freepbx (v17.0) as a custom destination, and an inbound route directs calls to one of these custom destinations. I’m currently calling from a cellphone → voip number with OVH → freepbx/asterisk. The voip number is set up as a sip trunk with a pjsip channel in freepbx.
if I set it to custom-plugin-2 then the call records successfully: I can hear the audio that I spoke into the cellphone after I download the file. I believe this rules out an RTP misconfiguration. In addition, I can see with gdb calls to
chan_pjsip_read_stream()
chan_pjsip_write_stream()
which is (I think) what is writing to the stream that Record is reading from.
However if I set it to custom-plugin-1 then the audiosocket does not get any audio data. It DOES send the very first packet over the audiosocket connection - and this packet contains the session uuid that I set in the context, therefore it is not an audio socket misconfiguration. However it never sends any frames. When I break with gdb I can see that it never returns from ast_waitfor_nandfds()
as mentioned above. In addition, there are no calls to either of
chan_pjsip_read_stream()
chan_pjsip_write_stream()
In this case.
The call will continue and then close after 2 minutes (exactly).
I’ve tried turning on rtp debugging and I don’t see any meaningful difference between the Record and the AudioSocket case.
I’ve tried examining the log /var/log/asterisk/full
but again there is no obvious error.
I’ve tried dumping all thread backtraces while Record() is in progress and while AudioSocket() is in progress, but even after pruning out the dozens of worker_idle
and default_tps_processing_function
threads I cannot see anything meaningful.
Does anyone know which function in the codebase is responsible for writing to the channel in this case, so that I can try to trace why it is not getting invoked?
Thank you