<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hello all,<br>
    I have a perl script that updates a M$ SQL DB based on an ivr that
    is run on asterisk.  <br>
    When it runs as a normal agi, it works great.<br>
    <br>
    when run as a DeadAGI it does not work.<br>
    <br>
    When i execute the script from h channel withDeadAGI and agi debug
    on i get:<br>
    <br>
    [2010-12-20 01:08:54]     -- Launched AGI Script
    /var/lib/asterisk/agi-bin/insert_10day_var.pl<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_request:
    insert_10day_var.pl<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_channel: SIP/xxxxxxxxxxxx<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_language: en<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_type: SIP<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_uniqueid: 1292825277.243<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_callerid: <appropriate
    caller id><br>
    [2010-12-20 01:08:54] AGI Tx >> agi_calleridname:
    <appropriate name><br>
    [2010-12-20 01:08:54] AGI Tx >> agi_callingpres: 0<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_callingani2: 0<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_callington: 0<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_callingtns: 0<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_dnid: unknown<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_rdnis: unknown<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_context: <my ivr
    context><br>
    [2010-12-20 01:08:54] AGI Tx >> agi_extension: h<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_priority: 3<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_enhanced: 0.0<br>
    [2010-12-20 01:08:54] AGI Tx >> agi_accountcode: <the
    account code set in call file><br>
    [2010-12-20 01:08:54] AGI Tx >> <br>
    [2010-12-20 01:08:54]     -- AGI Script insert_10day_var.pl
    completed, returning 0<br>
    <br>
    Which is identical to the debug output when it work from the live
    channel AGI<br>
    <br>
    but I do not get the data in the db as it does when run by hand.<br>
    I am very tired, frustrated and have been googleing my butt of, no
    luck.<br>
    <br>
    I know the script is getting the vars in as I had mistakenly left a
    print statement in, which of course caused the script to bail but it
    showed the correct info before it failed.<br>
    <br>
    Could it be that even though it is running DeadAGI that there is a
    sighup killing the script?  if any suggestions on what to do about
    it?  <br>
    AT:  <a class="moz-txt-link-freetext" href="http://www.voip-info.org/wiki/view/Asterisk+cmd+DeadAGI">http://www.voip-info.org/wiki/view/Asterisk+cmd+DeadAGI</a><br>
    I did see that in 1.2 even on a deadagi I might have to catch the
    sighup and it said<br>
    <br>
    Your script will have to block SIGHUP signals, which you can do like
    so:
    <br>
    <br>
    Perl:
    <br>
    <span style="font-family: monospace;"> $SIG{HUP} = "IGNORE"<br>
    </span><span style="font-family: monospace;"></span><br>
    I tried this and now at least I get a status after the DeadAGI
    returns, which it did not get with out it.  Although the status is
    FAILURE.<br>
    <br>
    Any suggestions?<br>
    Thanks,<br>
    JohnM<br>
    <br>
    <br>
    <br>
    <br>
  </body>
</html>