Alex Polite
2004-Dec-19 06:46 UTC
[Asterisk-Users] Make asterisk launch script after completing call.
OK. I now have call recording working for both incoming and outgoing calls. Now I want to make those wavs into mp3. I could launch a script from cron that checks for new wavs and converts them. But that wouldn't be so elegant. Launching it from * on hangup would be nicer. How is it done? [outgoing] exten => _0.,1,SetVar(CALLFILENAME=${EXTEN:1}-${TIMESTAMP}) exten => _0.,2,Monitor(wav,${CALLFILENAME},m) exten => _0.,3,Dial(SIP/rix/${EXTEN}|20|t) exten => _0.,4,Congestion exten => _0.,104,Congestion [sip-in] exten => 1000,1,SetVar(CALLFILENAME=${EXTEN:1}-${TIMESTAMP}) exten => 1000,2,Monitor(wav,${CALLFILENAME},m) exten => 1000,3,Dial(SIP/alex,20) exten => 1000,4,Voicemail(u1000) -- Alex Polite http://polite.se
Alex Polite
2004-Dec-20 05:45 UTC
[Asterisk-Users] Make asterisk launch script after completing call.
On s?n, dec 19, 2004 at 02:46:00 +0100, Alex Polite wrote:> > OK. I now have call recording working for both incoming and outgoing > calls. > > Now I want to make those wavs into mp3. I could launch a script from > cron that checks for new wavs and converts them. But that wouldn't be > so elegant. > > Launching it from * on hangup would be nicer. How is it done?Like so: [sip-in] exten => 1000,1,SetVar(CALLFILENAME=incoming_${CALLERIDNUM}_${TIMESTAMP}) exten => 1000,2,Monitor(wav,${CALLFILENAME}) exten => 1000,3,Dial(SIP/alex,20) ;exten => 1000,4,Voicemail(u1000) exten => h,1,Macro(wav2mp3) [macro-wav2mp3] exten => s,1,System(nice -n 19 asterisk2mp3.py /var/spool/asterisk/monitor ${CALLFILENAME}) Found it after googling for hours. I have to say that the documentation for Asterix feels a bit sketchy. alex -- Alex Polite http://polite.se