Thanks for the useful information, I had forgotten about SIGHUP since I usually work with asterisk 1.6. <br>I think however that it would be more acurate to say that the channel is hanging up due to the script crash. I tried moving the command around in the script and it crashes exactly on the system call. Also if I remove the system call it works perfectly. I have a feeling calling the system command is producing the condition to crash the script and hang up the channel.<br>
You did remind me of DeadAGI however, and that actually worked. I was using AGI ( again, thanks to asterisk 1.6 experience ) and I forgot asterisk 1.4 is a little more picky. Once I changed to DeadAGI the script worked.<br>
I did try adding an ignore handler for SIGHUP but that did not work. It is very strange, but I would say from this experience that it is not wise to use a system call from a script started with AGI() in asterisk 1.4.<br>
<br>Thanks for the lead, it helped greatly.<br><br><div class="gmail_quote">On Wed, Feb 2, 2011 at 1:13 PM, Tilghman Lesher <span dir="ltr"><<a href="mailto:tilghman@meg.abyt.es">tilghman@meg.abyt.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Tuesday 01 February 2011 23:43:34 Charles Solar wrote:<br>
> Hey guys I was hoping I could get a few pointers on a problem I have<br>
> been trying to debug for the last couple of months regarding asterisk<br>
> AGI scripts and unexpected termination.<br>
> I have this agi script that accepts incoming faxes using RxFax on the<br>
> latest asterisk 1.4 branch. Its written with perl and it works fine<br>
> except for one line that causes the entire script to terminate<br>
> unexpectedly.<br>
</div><snip><br>
<div class="im">> AGI Tx >> 200 result=0<br>
> AGI Rx << VERBOSE "Converting /tmp/1296624119.53.tiff to<br>
> /tmp/1296624119.53.pdf" 1<br>
> fax.agi: Converting /tmp/1296624119.53.tiff to /tmp/1296624119.53.pdf<br>
> AGI Tx >> 200 result=1<br>
> Really destroying SIP dialog '371b80c6324ece0c779653c34d2e88a2@XXX'<br>
> Method: INVITE<br>
> == Spawn extension (from-trunk, XXXXXXXXXX, 3) exited non-zero on<br>
> 'SIP/trunk-00000035'<br>
<br>
</div>This isn't the script terminating non-zero. It's the channel hanging up.<br>
<br>
One possible problem might be that your script is not properly handling the<br>
SIGHUP signal sent to the AGI process when a hangup occurs. If that is the<br>
case, then your script may be terminating early due to the signal. The<br>
best way to handle that is to set a signal handler in your script (this is<br>
dependent upon the language you're using), although there's also a<br>
workaround for people who are unwilling or unable to set a signal handler.<br>
<br>
Just remember that prior to Asterisk 1.6.2, once you receive the SIGHUP,<br>
you may no longer interact with the Asterisk process. That includes<br>
setting and retrieving variables and using the VERBOSE command. Starting<br>
with Asterisk 1.6.2, an AGI is free to continue interacting with Asterisk<br>
(the setting of final variables is likely the most productive task).<br>
<br>
--<br>
Tilghman<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</blockquote></div><br>