Simultaneous Playback and Record

Hello,

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.

Record(/tmp/rec%d.wav);
Playback(${RECORDED_FILE})

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

Regards

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))

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

–Satish Barot
satish4asterisk@gmail.com

Thanks for the reply, but we are using monitor command

stackoverflow.com/questions/1833 … 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