[asterisk-users] AGI Problem

Mehmet Avcioglu mehmet at activecom.net
Tue Sep 27 12:54:26 CDT 2011


Danny's suggestion of using System instead of AGI was correct, it was wrong of me to use AGI here as there is no communication. The same script does communicate with asterisk when executed with different options, so I had just kept the same line using different options at different places. 

Today I changed the AGI calls to System at places where there is no response back to asterisk. Kept everything the same, instead of AGI(script.php,var1,var2) made it System(/path/script.php "var1" "var2") and it worked without a problem. This way I have been able to fix the problem where this caused a deadlock requiring human intervention. 

The lines in the dialplan that continue to use the AGI call still experience the same problem as before. Today it happened 9 times out of 10486 executions, but these are not as fatal as before, so they can almost be ignored. 

> Are you reading the AGI environment in the script?

Yes

> How are you passing variables from Asterisk? As channel variables or as command line parameters?
> What is the dialplan statement that executes your script?

Command line parameters, explained above.

> Can you post the script source?

Yes but I really cannot see how the script could have a problem, it is around 2000 lines and since my problem has come to a more manageable level, I would rather not bug you with debugging the whole thing:)

> If you captured the AGI dialog from a call when your script failed and you feed the same values (including the AGI environment) into your script from a shell does it fail?

Yes it runs just fine. It even runs fine at different times from within the asterisk using AGI when the same number calls or is called. So the only variable that is different between executions is time.

> On a Unix system level, a 4 means 'Interrupted system call' -- assuming this is what your '4' signifies. BTW, I'm a 1.2 Luddite and the AGI return value was meaningless back then.

Running these on 1.8.5

I'll migrate this setup to a different environment, perhaps try at different asterisk and try the signal catching mentioned before and if I get any more data will update the list.

Thanks a lot.

--
Mehmet


More information about the asterisk-users mailing list