[Asterisk-Users] PHP/AGI Problem

Alex Barnes abarnes at ubiquitysoftware.com
Wed May 25 07:16:03 MST 2005


> -----Original Message-----
> From: Jon Farmer [mailto:viperdude_uk at yahoo.co.uk] 
> Sent: 25 May 2005 14:09
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: RE: [Asterisk-Users] PHP/AGI Problem
> 
> I have also tested detecting the channel_status and
> that doesn't seem to work either. 
> 
> This leads me to believe that the script is not
> running anymore but just held in limbo doing nothing
> except taking up resource. I would imagine that the
> scenario where the caller hangs up before the end of a
> AGI script is common so am I missing something or is
> the behaviour of my script normal?
> 

Noticed this in the PHP docs:

"Note: The set_time_limit() function and the configuration directive
max_execution_time only 
affect the execution time of the script itself. Any time spent on
activity that happens outside 
the execution of the script such as system calls using system(), the
sleep() function, database 
queries, etc. is not included when determining the maximum time that the
script has been 
running."

I suspect that the problem is because of the script getting stuck in a
state that the 
max_execution_time doesn't count towards.  
I am guessing this is because asterisk holds the connection open to AGI
forever and 
relies on the AGI script to end of its own accord.
This isnt necessarily a bad thing as you may wish to keep processing a
script after a 
caller has hung up.

I think all you can do is add some timeout mechanism to the "waiting for
more dtmf" 
part and exit the script after so many seconds/minutes of no DTMF.

HTH

alex


Information contained in this e-mail and any attachments are intended for the use of the addressee only, and may contain confidential information of Ubiquity Software Corporation.  All unauthorized use, disclosure or distribution is strictly prohibited.  If you are not the addressee, please notify the sender immediately and destroy all copies of this email.  Unless otherwise expressly agreed in writing signed by an officer of Ubiquity Software Corporation, nothing in this communication shall be deemed to be legally binding.  Thank you.




More information about the asterisk-users mailing list