I solve this problem. I'm not sure, but you get billsec when you use Dial application. Using dial app , I get billsec.<br><br><div><span class="gmail_quote">2007/8/28, Atis <<a href="mailto:atis@best.eu.org">atis@best.eu.org
</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 8/28/07, Giedrius Augys <<a href="mailto:voipas@gmail.com">voipas@gmail.com
</a>> wrote:<br>> Hello,<br>> I want to create php rate script and I'm using Deadagi. But I allways get<br>> billsec 0 , or nothing. Can you help me to solve this problem...<br><br>It seems that there is problem with Answer(). Does it get executed
<br>from AGI? Do you hear voice prompts?<br><br>You can try adding Answer() before DeadAgi().<br><br>Regards,<br>Atis<br><br>> My extension.conf:<br>> exten => _123,1,DeadAgi(rate.php)<br>> exten => _123,2,hangup
<br>><br>> And my simple test php script rate.php<br>> #!/usr/local/bin/php -q<br>> <?php<br>> include_once (dirname(__FILE__)."/phpagi.php");<br>> $AGI = new AGI();<br>><br>> $AGI->answer();
<br>><br>> $AGI->stream_file('demo-thanks');<br>> $AGI->stream_file('vm-goodbye');<br>><br>> $AGI->hangup();<br>><br>> $billsec = get_var($AGI,"CDR(billsec)");<br>> debug("Billsec: $billsec", 1);
<br>><br>> function debug($string, $level=3) {<br>> global $AGI;<br>> $AGI->verbose($string, $level);<br>> }<br>><br>> function get_var( $agi, $value) {<br>> $r = $agi->get_variable( $value );
<br>><br>> if ($r['result'] == 1) {<br>> $result = $r['data'];<br>> return $result;<br>> }<br>> else<br>> return '';<br>> }<br>><br>
> ?><br>><br>><br>> _______________________________________________<br>> --Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">http://www.api-digital.com--</a><br>><br>> asterisk-users mailing list
<br>> To UNSUBSCRIBE or update options visit:<br>><br>> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>><br><br><br>--<br>Atis Lezdins,
<br>IT Responsible of BEST Riga,<br><a href="mailto:atis@BEST.eu.org">atis@BEST.eu.org</a><br>ICQ: 142239285<br>Skype: atis.lezdins<br>Cell Phone: +371 28806004 [Tele2, Latvia]<br>Work phone: +1 800 7502835 [Toll free, USA]
<br>?BEST? -> <a href="http://www.BEST.eu.org">www.BEST.eu.org</a><br><br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--">http://www.api-digital.com--
</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">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote>
</div><br><br clear="all"><br>-- <br>Pagarbiai / Best Regards,<br>Giedrius Augys