[asterisk-users] AGI Problem

Mehmet Avcioglu mehmet at activecom.net
Mon Sep 26 07:08:28 CDT 2011


Thanks for the response. Although I had already gone thorough a lot of these types of QAs during my own problem solving, your suggestions did bring a couple that I had not.

> In no particular order...
> 
> Earlier, you suspected receiving a signal was causing your problem.
> Instead of ignoring the signal, how setting up a handler and logging the reception?

The program is written in a very top to bottom way (himm stateless? non-oo? not sure what to call it) and would be really hard for me to catch those and figure out where it happened and clean things up. So I have been reluctant to do this. But it is one of those tests that I'll eventually hit if I cannot solve the problem.

> How about 'agi set debug on'?

I was doing extensive logging in my scripts and had turned on full logging for asterisk but I had not turned agi debuging on. I did and carefully inspected the output. And there is nothing out of ordinary between successful executions and unsuccessful ones.

> Whose AGI library did you use? If you 'rolled your own' maybe you are violating the protocol. Nobody gets it right the first time :)
> What does the AGI do?
> Can you execute it outside of Asterisk by feeding it the appropriate cruft via STDIN?

I am using my own. Yes agreed, but this doesn't even interact with asterisk at all. Just receives a couple values and updates jobs, database accordingly. Does not return anything back to asterisk. Yes executes fine outside of asterisk and even executes fine within asterisk 99.9% of the time. 

> Are there any characteristics common to the 48? Same ANI? Same DNIS?, Same path through your dialplan?

I have not been able to find any difference.

So "returning 4" doesn't mean anything special. It is just the return code received from the AGI application that was forked. What about the fact that asterisk does not continue with the dialplan after receiving 4, is that expected behavior? 
I have not been able to find what would make a php cli application exit with 4 other than exit(4). php does not log anything when this happens, doesn't write anything to stderr (I specifically remained on the console I started * to see stderr). So this can only be a crash of some sort of php cli binary. What type of a crash would cause it to return 4? 

I will keep digging.

Thanks

--
Mehmet 




More information about the asterisk-users mailing list