Un-top-posting...
> [mailto:[email protected]] On Behalf Of Thomas
> Winter
>
> is there any way to avoid cancel the AGI script if caller is hanging up.
> That gives me sometimes data mismatch and it is deffcault to clean up in
> the h extension.
>
> I would like that the PHP script called by AGI will run to end..
On Wed, 10 Feb 2010, Danny Nicholas wrote:
> According to the CLI doc, you can do it this way
> - exten => 100,1,Set(AGISIGHUP=no)
> - exten => 100,n,AGI(youragi.agi)
Who knew? Hey TP, I learned something new today!
Another approach, is to establish a signal handler -- so you can handle
the signal :)
I write my AGIs in C (because you can execute xxx AGIs written in C in the
time it takes to load PHP and parse your script) so it looks like this:
// trap SIGHUP -- caller hung up
signal(SIGHUP, (void (*)(int))(int)hangup);
When the caller hangs up, Asterisk delivers a SIGHUP to the process
created by the agi() application. Execution of your AGI will then continue
with your signal handler where you can clean up temporary files, roll back
database cruft, etc.
--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards [email protected] Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users