[asterisk-users] System call never returns

Chris Elliott Chris at PinsonConsulting.com
Fri Aug 8 14:19:35 CDT 2008


I am using Asterisk 1.2.24.  I know it should be upgraded, but that is 
not an option at this point for this working system.

I am experimenting with using an external application to control whether 
a call should be connected.  Most of the time it works.  Sometimes the 
dial plan never comes back from the "System" call.  I can verify that 
the called program did exit, but the call if just left in the "Ring" 
state.  In addition, using "Action: Hangup Channel: 
SIP/exten-0001xxxxxxxx" responds successfully, but doesn't actually get 
rid of the hanging call.

My first choice would be to work around the situation, so it never 
happens.  Second choice would be to learn how to delete these zombie 
ringing calls.  Here is the relevant part of extensions.conf:

exten => 0,1,SetAccount(console_trunk)
exten => 0,2,System(/mnt/opt/good)
exten => 0,3,NoOp(Status is ${SYSTEMSTATUS})
exten => 0,4,GotoIf($[${SYSTEMSTATUS} != SUCCESS]?103
exten => 0,5,Meetme(3456|q)
exten => 0,103,NoOp(Bad status is ${SYSTEMSTATUS})
exten => 0,104,Hangup

If I am in asterisk in a very verbose mode and the failure occurs, I see:
    -- Executing SetAccount("SIP/exten-0001-08172820", "console_trunk") 
in new stack
    -- Executing System("SIP/exten-0001-08172820", "/mnt/opt/good") in 
new stack

and then nothing else.  The call is in "Ring" state and I can't delete 
the channel.  Any ideas?  The code for the "good" program is below in 
case that helps.

#include <stdlib.h>
#include <unistd.h>

int main() {
    sleep(2);
    exit(0);
    return 0;
}





More information about the asterisk-users mailing list