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

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Dec 6 14:45:16 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18349 
====================================================================== 
Reported By:                gobris
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18349
Category:                   Applications/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
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-12-06 14:45 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0129366) lmadsen (administrator) - 2010-12-06 14:45
 https://issues.asterisk.org/view.php?id=18349#c129366 
---------------------------------------------------------------------- 
This may be related to the "Who hung up?" stuff we discussed at AstriCon
this year:

https://wiki.asterisk.org/wiki/display/AST/AstriDevCon+2010#AstriDevCon2010-%28P3%29


Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-12-06 14:45 lmadsen        Note Added: 0129366                          
======================================================================




More information about the asterisk-bugs mailing list