[asterisk-users] AGI Problem

Danny Nicholas danny at debsinc.com
Mon Sep 26 08:26:51 CDT 2011


Steve brings up some good points - I'll add .02
1. Your answer to question 2 indicates that you should be doing this
function with a System() command since the AGI protocol is designed for
inter-Asterisk communication.
2. I use PERL AGI modules and they can all be "replicated" in a BASH
environment.  I just go to /var/log/asterisk/full, get the information that
was passed in the live call and I can almost always determine what the heck
happened.
3. If you are going to use AGI, follow the protocol and see what your
expected outputs are in a BASH environment

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Mehmet
Avcioglu
Sent: Monday, September 26, 2011 7:08 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] AGI Problem


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 


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list