Good morning, I have a problem when processing call bytes.
I need a python file that stores the bytes of a call in real time, basically to have a file in which to dump those bytes that would make up the audio of the call.
I have been working with the dialplan, using EAGI and Dial, but in one case or another, one blocks the other and in the end, I listen to the audio, and I don’t call, or the other way around.
I don’t need MixMonitor, because I don’t want to extract the audio to a file, but I want those bytes in real time.
I have used GoSub with Dial, but in that case my problem is how to access the audio bytes.
Any idea how I can access those bytes in the background or in a way that doesn’t block one thing to another ?
Use a Local channel and ChanSpy to passively snoop on a channel, and send it to the EAGI. One side executes ChanSpy that does the listening, and the other side executes the EAGI that receives the audio.
Is this the format of extensions.conf that you suggests?
[internal]
exten => _X.,1,Dial(PJSIP/${EXTEN}) ; Dial the actual destination
same => n,GoSub(eagi-capture,s,1(${CHANNEL})) ; Use GoSub to capture audio while the call happens
[eagi-capture]
exten => s,1,NoOp(Starting EAGI audio capture)
same => n,ChanSpy(Local/eagi-channel,nq) ; Passively listen to the Local channel
same => n,Return
[eagi-process]
exten => eagi-channel,1,EAGI(/etc/asterisk/eagi_rec.py) ; Run EAGI on the Local channel
same => n,Hangup()
No. Something has to initiate the Local channel, such as the Originate dialplan application, and ChanSpy has to be given the correct channel to spy on. I would suggest experimenting with the components first to gain an understanding of how they work and can be used.