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

Baji Panchumarti baji.panchumarti at gmail.com
Tue Nov 20 22:27:34 CST 2007


page 511

use dialplan function  STAT()

--

  On Nov 20, 2007 9:42 PM, Vincent wrote:

> 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