[asterisk-users] [1.4 - Record] How to tell if user did leave a msg?

Vincent vincent.delporte at bigfoot.com
Tue Nov 20 20:42:59 CST 2007


Hello

I didn't find the answer in the ATOF 2nd Ed: When using the Record()
application, I need to know how it ended: Did the user leave a
message, or did he hang up?

If the latter, Asterisk stops right there, while I need to run some
other commands before hanging up:

========
exten => _[1-4],n,Playback(/root/asterisk_sound_files/leave_msg)
exten => _[1-4],n,Set(CALLTIME=${STRFTIME(${EPOCH},,%d-%b-%Y-%Hh%M)})

;check if left message : if nothing, script ends there!
exten => _[1-4],n,Record(/tmp/${CALLTIME}.wav,3,30)

exten => _[1-4],n,TrySystem(mv /tmp/${CALLTIME}.wav
/srv/www/lighttpd/asterisk)
exten => _[1-4],n,ExecIf($[${SYSTEMSTATUS}!= SUCCESS],Verbose,Failed
moving WAV file)

exten => _[1-4],n,TrySystem(/root/asterisk/send_call_notification.py
"${CALLERIDNAME}" ${CALLERIDNUM} ${SOFTWARE} ${CALLTIME}.wav)
exten => _[1-4],n,ExecIf($[${SYSTEMSTATUS} != SUCCESS],Verbose,Error
sending e-mail)

exten => _[1-4],n,Playback(/root/asterisk_sound_files/bye_bye)
exten => _[1-4],n,Hangup()
========

Should I use another application?

Thank you.




More information about the asterisk-users mailing list