On Tue, 31 Aug 2010, Tim Nelson wrote:

> I have some dialplan code on an Asterisk 1.2.x box that basically dials 
> a call, then after call completion, runs a command via System(). 
> However, I'm finding that roughly 5% of the time, the System() command 
> never executes and seems to be on specific destinations. 
> Simplified/paraphrased example:
>
> exten => 1,1,Set(VARIABLE=SOMEVALUE)
> exten => > 1,n,Dial(SIP/somepeer/1234567980)
> exten => 1,n,System(/bin/bash > /root/bin/somescript.sh ${VARIABLE}
>
> It almost seems to be related to how fast the destination 'hangs up' and 
> whether or not the dialplan has time to run the System command before 
> jumping to 'h'.
>
> I have to believe there is a better way to do this, possibly using 
> DeadAGI?

I think you're on the right track -- moving from system() to [dead]agi().

I think you should be using agi() instead of deadagi() since the call 
isn't "dead" yet. IMO, trapping HUP is a prerequisite for a "well written 
AGI."

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwa...@sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to