I have developed a custom agi and connect to it by placing a call through a sip phone. The agi issues the "STREAM FILE" command from a number of places in code to play out prerecorded messages. The problem is if the agi tries to play a file, using the STREAM FILE command, after the caller has dropped the call, the agi crashes midway.
After issuing a "agi debug" command on the console here is what I observed.
1. Whenever a caller drops a call no interrupt is fired from asterisk to the agi to notify a hangup event. This prevents me from taking precautionary measures before issuing any command.
2. Even after the caller has dropped the call, I still see an active channel (verified using the "show channels" command). This is probably due to the fact that the agi is still connected.
3. When I send the STREAM FILE command from my agi this is what is shown on the asterisk console:
AGI Rx << STREAM FILE file1 "#" 0
Mar 6 23:50:22 WARNING[5978]: file.c:583 ast_readaudio_callback: Failed to write frame
AGI Tx >> 200 result=-1 endpos=6400
Spawn extension ........ exited non-zero on 'SIP/101-6600'
As I understand, when asterisk receives the STREAM FILE command its has no channel to play it to and hence the warning is issued.
Asterisk does send a -1 result but straight away kills the agi process ( I deduce this from the last line) which causes the agi to crash.
Now I am totally clueless on how to handle such erroneous conditions. Any help will be appreciated.
Thanks,
Danish
_______________________________________________ --Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users