[asterisk-users] Return codes

Tim Panton tim at mexuar.com
Tue Nov 28 11:06:09 MST 2006


On 28 Nov 2006, at 17:54, Doug Crompton wrote:

> How does one process a return code in Asterisk?
>
> Example...
>
> exten => s,n,Playback(/tmp/podcast/${CALLERIDNUM})
> exten => s,n,System(rm "/tmp/podcast/${CALLERIDNUM}.gsm")
>
>
> If the caller hangs up on the playback command the file remove System
> statement after it never gets executed. The playback command  
> returns a -1
> in this case and logs a warning. The only thing mentioned in the  
> command
> reference is 101 for file not found.

This isn't the answer to your question, but in that particular case,  
I'd put the rm into the 'h'
extension, that way it gets run whenever the user hangs up.

exten => s,n,Playback(/tmp/podcast/${CALLERIDNUM})
exten => h,1,System(rm "/tmp/podcast/${CALLERIDNUM}.gsm")


Tim Panton

www.mexuar.net
www.westhawk.co.uk/





More information about the asterisk-users mailing list