[asterisk-users] deadagi and billsec or answeredtime
Atis
atis at BEST.eu.org
Tue Aug 28 06:08:01 CDT 2007
On 8/28/07, Giedrius Augys <voipas at gmail.com> wrote:
> Hello,
> I want to create php rate script and I'm using Deadagi. But I allways get
> billsec 0 , or nothing. Can you help me to solve this problem...
It seems that there is problem with Answer(). Does it get executed
from AGI? Do you hear voice prompts?
You can try adding Answer() before DeadAgi().
Regards,
Atis
> My extension.conf:
> exten => _123,1,DeadAgi(rate.php)
> exten => _123,2,hangup
>
> And my simple test php script rate.php
> #!/usr/local/bin/php -q
> <?php
> include_once (dirname(__FILE__)."/phpagi.php");
> $AGI = new AGI();
>
> $AGI->answer();
>
> $AGI->stream_file('demo-thanks');
> $AGI->stream_file('vm-goodbye');
>
> $AGI->hangup();
>
> $billsec = get_var($AGI,"CDR(billsec)");
> debug("Billsec: $billsec", 1);
>
> function debug($string, $level=3) {
> global $AGI;
> $AGI->verbose($string, $level);
> }
>
> function get_var( $agi, $value) {
> $r = $agi->get_variable( $value );
>
> if ($r['result'] == 1) {
> $result = $r['data'];
> return $result;
> }
> else
> return '';
> }
>
> ?>
>
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
Atis Lezdins,
IT Responsible of BEST Riga,
atis at BEST.eu.org
ICQ: 142239285
Skype: atis.lezdins
Cell Phone: +371 28806004 [Tele2, Latvia]
Work phone: +1 800 7502835 [Toll free, USA]
?BEST? -> www.BEST.eu.org
More information about the asterisk-users
mailing list