[asterisk-bugs] [Asterisk 0018349]: AGI CDR Update bug

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Nov 22 03:12:40 CST 2010


The following issue has been SUBMITTED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18349 
====================================================================== 
Reported By:                gobris
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18349
Category:                   Applications/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.2.11 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-11-22 03:12 CST
Last Modified:              2010-11-22 03:12 CST
====================================================================== 
Summary:                    AGI CDR Update bug
Description: 
We are trying to adapt an php-agi script to calculate billing. At hangup
detected, we run a script called aftercall.php to calculate total bill and
set this value to CDR. We added two additional fields as cost and rate to
CDR table.
in aftercall.php we calculate the values and update the fields with 
$agi->exec("set", "CDR(userfield)={$cost}");
$agi->exec("set", "CDR(rate)={$rateArray['data']}");
$agi->exec("set", "CDR(cost)={$cost}");

When a call made and other party doenst answer, it updates rate field
correctly(which is a constant value) but, if other party answers set
function doesnt work and no data written to this 2 fields . THis is when
hangup deteceted without anwer:
aftercall.php: >>>>>>>>>>rate:0.04830
aftercall.php: >>>>>>>>>>duration:
    -- AGI Script Executing Application: (set) Options:
(CDR(userfield)=0)
    -- AGI Script Executing Application: (set) Options:
(CDR(rate)=0.04830)
    -- AGI Script Executing Application: (set) Options: (CDR(cost)=0)
aftercall.php: >>>>>>>>>>>>>>>>cost:0
    -- <SIP/10010-0000000c>AGI Script aftercall.php completed, returning
0
at the end cdr fields (rate and cost field) set correctly on logs.

This is call after answer:
aftercall.php: >>>>>>>>>>duration:5
    -- AGI Script Executing Application: (set) Options:
(CDR(userfield)=0.0483)
    -- AGI Script Executing Application: (set) Options:
(CDR(rate)=0.04830)
    -- AGI Script Executing Application: (set) Options:
(CDR(cost)=0.0483)
 aftercall.php: >>>>>>>>>>>>>>>>cost:0.0483
At the end cdr fields rate and cost set empty (As default values of sql
0.00)
There is no difference between 2 calls except one is no answer, other is
answered.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-11-22 03:12 gobris         New Issue                                    
2010-11-22 03:12 gobris         Asterisk Version          => 1.6.2.11        
2010-11-22 03:12 gobris         Regression                => No              
2010-11-22 03:12 gobris         SVN Branch (only for SVN checkouts, not tarball
releases) => N/A             
======================================================================




More information about the asterisk-bugs mailing list