[asterisk-users] deadagi and billsec or answeredtime

Giedrius Augys voipas at gmail.com
Tue Aug 28 03:17:48 CDT 2007


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...
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 '';
}

?>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070828/50e002b6/attachment.htm 


More information about the asterisk-users mailing list