<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Thanks for the input but I am not sure if that answer my question of if it&#39;s normal behaviour for AGI scrip to terminate after the &quot;h&quot; extension rather than end of &quot;x&quot; extension even if it was only run in &quot;x&quot; extension.<div>

<br></div><div>Regards,</div></span><br><div class="gmail_quote">On Mon, Apr 11, 2011 at 6:34 AM, Pezhman Lali <span dir="ltr">&lt;<a href="mailto:lopl@lopl.net">lopl@lopl.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Dear<div>there is some problem.</div><div>the true way for running php script, is using agi not system.</div><div>second after 5 sec, a lot of channel variables were removed, it makes your program wrong. </div><div>with some little experience you can add your script to a2billing, try it.</div>



<div><br></div><div>best </div><div><br><div class="gmail_quote"><div><div></div><div class="h5">On Sat, Apr 9, 2011 at 7:22 PM, Bruce B <span dir="ltr">&lt;<a href="mailto:bruceb444@gmail.com" target="_blank">bruceb444@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">

Hi Everyone,<div><br></div><div>Trying to run a php script after DeadAGI for A2Billing does it&#39;s magic. This is the dialplan:</div><div><br></div><div><div>[a2billing]</div><div>exten =&gt; _X.,1,System(php pre-call.php ${CALLERID(num)} ${EXTEN} ${UNIQUEID})</div>





<div>exten =&gt; _X.,n,AGI(a2billing.php,1)</div><div>exten =&gt; _X.,n,Hangup()</div><div><b>exten =&gt; h,1,Wait(5)</b></div><div><b>exten =&gt; h,n,System(php post-call.php ${CALLERID(num)} ${UNIQUEID})</b></div></div>





<div><br></div><div>As you can see above, I even added a 5 seconds wait time before running my post-call script but the problem is that DeadAGI and AGI actually terminates after the &quot;h,n&quot; extension is run. I thought this weired because &quot;X&quot; extension is already finished at &quot;X,3&quot;.</div>





<div><br></div><div>Is this normal behavioral for AGI/DeadAGI?</div><div>Is there a workaround this other than including my post-call script into the a2billing.php itself?</div><div><br></div><div>Output from CLI for proof:</div>





<div><br></div><div><div> -- Executing [h@a2billing:1] Wait(&quot;SIP/101-00000034&quot;, &quot;5&quot;) in new stack</div><div>    <b>-- Executing [h@a2billing:2]</b> System(&quot;SIP/101-00000034&quot;, &quot;php post-call.php 101 1302360230.52&quot;) in new stack</div>





<div>    -<b>- &lt;SIP/101-00000034&gt;AGI Script a2billing.php completed, returning -1</b></div></div><div><b><br></b></div><div>Thanks,</div>
<br></div></div>--<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></div>
</blockquote></div><br>