<table cellspacing='0' cellpadding='0' border='0' background='none' style='font-family:arial;font-size:10pt;color:rgb(51, 51, 51);background-color:rgb(255, 255, 255);width:100%;'><tr><td valign='top' style='font: inherit;'>Thanks to all the help. I think i have it now. I reset the CDR on the hangup channel.<br><br>[macro-dialout-trunk]<br>
exten =&gt; s,1,Wait(1)<br>
exten =&gt; s,n,Dial(SIP/${ARG1}@${ARG2},30,t)<br>
exten =&gt; s,n,Hangup()<br>
exten =&gt; h,1,ResetCDR(w)<br>
exten =&gt; h,n,NoCDR()<br>
exten =&gt; h,n,DEADAGI(get-total.php)<br>
<br><br>AGI Rx &lt;&lt; EXEC Noop ROWCOUNT=1<br>&nbsp;&nbsp;&nbsp; -- AGI Script Executing Application: (Noop) Options: (ROWCOUNT=1)<br>AGI Tx &gt;&gt; 200 result=0<br>AGI Rx &lt;&lt; EXEC Noop BILLSEC=21<br>&nbsp;&nbsp;&nbsp; -- AGI Script Executing Application: (Noop) Options: (BILLSEC=21)<br><br>now i can see my billsec. thanks again for all the help.<br><br>regards,<br>nhadie<br>--- On <b>Sat, 6/7/08, Nhadie Ramos <i>&lt;nhadie.ramos@yahoo.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Nhadie Ramos &lt;nhadie.ramos@yahoo.com&gt;<br>Subject: Re: [asterisk-users] Question on DeadAGI<br>To: "Asterisk Users Mailing List - Non-Commercial Discussion" &lt;asterisk-users@lists.digium.com&gt;<br>Date: Saturday, June 7, 2008, 10:39 PM<br><br><div id="yiv2061767745"><table style="font-family: arial; font-size: 10pt; color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);
 width: 100%;" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">Hi Sir,<br><br>I tried it this way, and now i can see my DEADGI being called next prob is on&nbsp; that script i query the cdr table with the uniqueid. tried counting the row result first , and result was 0.<br><br>how can i make sure that it was already at the CDR table before i call my agi? i tried to use ResetCDR() and also without ResetCDR() but still 0 result on the row.<br><br>but when i query manully on the mysql console, i can see the cll was logged.<br><br>Thank You<br>[macro-dialout-trunk]<br>exten =&gt; s,1,Wait(1)<br>exten =&gt; s,n,Dial(SIP/${ARG1}@${ARG2},30,t)<br>exten =&gt; s,n.ResetCDR()<br>exten =&gt; s,n,Hangup<br>exten =&gt; h,1,DEADAGI(get-total.php)<br><br><br>---
 On <b>Sat, 6/7/08, Lenz
 <i>&lt;lenz-ml@loway.it&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Lenz &lt;lenz-ml@loway.it&gt;<br>Subject: Re: [asterisk-users] Question on DeadAGI<br>To: "Asterisk Users Mailing List - Non-Commercial Discussion" &lt;asterisk-users@lists.digium.com&gt;<br>Date: Saturday, June 7, 2008, 12:50 PM<br><br><pre>You should use it on the hang-up extension and only after the channel is  <br>technically dead.<br>It works fine for that.<br>l.<br><br><br><br><br>On Sat, 07 Jun 2008 01:25:37 +0200, Nhadie Ramos &lt;nhadie.ramos@yahoo.com&gt;<br> <br>wrote:<br><br>&gt; Hi,<br>&gt;<br>&gt; How can i get the deadAGI to work at this scenario<br>&gt;<br>&gt; Basically when someonc calls international,&amp;nbsp; i will get the  <br>&gt; remaining balance using AGI get-available.php.<br>&gt;<br>&gt; but after the call i would like to get the usage by calling  <br>&gt; get-usage.php so
 i<br> can update users balance, but looking at the debug it  <br>&gt; seems the AGI was not called. is there som<br>&gt;<br>&gt; exten =&amp;gt; _00.,1,AGI(get-available.php)<br>&gt; exten =&amp;gt; _00.,n,GotoIf($["${CALLSTATUS}" =<br>"1"]?70)<br>&gt; exten =&amp;gt; _00.,n,GotoIf($["${CALLSTATUS}" =<br>"2"]?80)<br>&gt; exten =&amp;gt; _00.,70,Dial(SIP/${EXTEN}@sb-trunk)<br>&gt; exten =&amp;gt; _00.,n,Hangup<br>&gt; exten =&amp;gt; _00.,n,DEADAGI(get-usage.php)<br>&gt; exten =&amp;gt; _00.,80,Busy<br>&gt; exten =&amp;gt; _00.,n,Hangup<br>&gt;<br>&gt;<br>&gt; Regards,<br>&gt; Nhadie<br>&gt;<br>&gt;<br>&gt;<br><br><br><br>-- <br>Loway Research - Home of QueueMetrics<br>http://queuemetrics.com<br><br>_______________________________________________<br>-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>  <br>
 http://lists.digium.com/mailman/listinfo/asterisk-users</pre></blockquote></td></tr></tbody></table><br>

      </div><pre>_______________________________________________<br>-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>   http://lists.digium.com/mailman/listinfo/asterisk-users</pre></blockquote></td></tr></table><br>