Simultaneous Playback and Record


Can we have non blocking record and playback functions in asterisk ?

The functions given below are record and playback where it gets blocked while recording or playback.


I want that Record should start and then asterisk goes to the next command playback. So we have simultaneous record and playback.


Deepak Bhatia

Dial local channel and use option G to achieve the goal. Straight from my mind and hence not tested but you can have something like,
… …
same => n,Set(__ORIGCHANNEL=${CHANNEL})
same => n,Dial(Local/s@injectaudio,G(getanotherchannel,s,1))

exten => s,1,Goto(recording,s,1)
exten => s,2,Goto(spycall,s,1)
exten => s,1,Noop(+++++ Audio playback +++++)
same => n,Answer()
same => n,Wait(1)
same => n,Playback(${MESSAGE})
same => n,SoftHangup(${ORIGCHANNEL})
exten => s,1,Noop(+++++ Record the call +++++)
same => n,Record(/tmp/rec%d.wav)
exten => s,1,Noop(+++++ Chanspy to inject the Audio on call +++++)
same => n,Answer()
same => n,Chanspy(${ORIGCHANNEL},BqEs)

–Satish Barot

Thanks for the reply, but we are using monitor command … n-asterisk

You mentioned Record so I suggested the solution accordingly. Using Monitor it is bit easier and you can use a dialplan as sample code in a given link.

–Satish Barot