[asterisk-bugs] [JIRA] (ASTERISK-27425) Calls are not billed correctly by a2billing - Asterisk 12 and 13

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Thu Nov 16 14:30:40 CST 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-27425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Mudgett updated ASTERISK-27425:
---------------------------------------

    Description: 
The CDR(billsec) and (ANSWEREDTIME) is not measuring the answered time accurately.

We debugging the issue and found what may the problem be.
According to [1] it seem that the CDR(billsec) is registering the answered time of the initial call and not the answered time of the bridged one (I mean after dialing the number on the DISA and the other party answering the call )

We CDR debug we found the right answered time data in the bridged CDR thread as shown in this log:
{noformat}
    -- SIP/sipetb-00000009 is ringing
    -- SIP/sipetb-00000009 is making progress passing it to SIP/sipetb-00000008
    -- SIP/sipetb-00000009 answered SIP/sipetb-00000008
0x7f2c04002830 - Set answered time to 1510800709.529550
Dial End message for SIP/sipetb-00000008, SIP/sipetb-00000009: 1510800709.00529783
0x7f2c04000970 - Processing Dial End message for channel SIP/sipetb-00000008, peer SIP/sipetb-00000009
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Dial to DialedPending
    -- Channel SIP/sipetb-00000009 joined 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
Bridge Enter message for channel SIP/sipetb-00000009: 1510800709.00529977
0x7f2c04002830 - Updating Party A SIP/sipetb-00000009 snapshot
0x7f2c04002830 - Processing bridge enter for SIP/sipetb-00000009
0x7f2c04002830 - Transitioning CDR for SIP/sipetb-00000009 from state Single to Bridged
    -- Channel SIP/sipetb-00000008 joined 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
       
Bridge Enter message for channel SIP/sipetb-00000008: 1510800709.00530039
0x7f2c04000970 - Updating Party A SIP/sipetb-00000008 snapshot
0x7f2c04000970 - Processing bridge enter for SIP/sipetb-00000008
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state DialedPending to Dial
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Dial to Bridged
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Channel SIP/sipetb-00000009 left 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
    -- Channel SIP/sipetb-00000008 left 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
Bridge Leave message for SIP/sipetb-00000009: 1510800739.00509557

0x7f2c04002830 - Processing Bridge Leave for SIP/sipetb-00000009
0x7f2c04002830 - Transitioning CDR for SIP/sipetb-00000009 from state Bridged to Finalized
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Bridged to Finalized
0x7f2c04002830 - Beginning finalize/dispatch for SIP/sipetb-00000009
0x7f2c04002830 - Dispatching CDR for Party A SIP/sipetb-00000009, Party B <none>
Bridge Leave message for SIP/sipetb-00000008: 1510800739.00509705
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1281 - uniqueid:1510800680.13 - DIAL SIP/sipetb/033168456954,60,rL(20460000:0)
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1164 - uniqueid:1510800680.13 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse-1 WHERE id_trunk='2']
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1433 - uniqueid:1510800680.13 - -> dialstatus : ANSWER, answered time is 47
 a2billing_cc3.php,6:
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1437 - uniqueid:1510800680.13 - [USEDRATECARD=0]
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:736 - uniqueid:1510800680.13 - :[DIALEDTIME: ->59<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:740 - uniqueid:1510800680.13 - :[DIALSTATUS: ->ANSWER<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:744 - uniqueid:1510800680.13 - :[CDRSTARTTIME: ->2017-11-15 21:51:31<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:748 - uniqueid:1510800680.13 - :[CDRANSWER: ->2017-11-15 21:51:31<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:752 - uniqueid:1510800680.13 - :[CDRend: ->2017-11-15 21:52:19<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:756 - uniqueid:1510800680.13 - :[CDRduration: ->47<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:760 - uniqueid:1510800680.13 - :[CDRbillsec: ->47<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:764 - uniqueid:1510800680.13 - :[CDRdisposition: ->ANSWERED<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:768 - uniqueid:1510800680.13 - :[ANSWERED: ->59<-]
{noformat}
What we need to do is to make the CDRANSWER variable to take the answered time registered in CDR thread 0x7f2c04002830 instead of using the one provided by the CDR thread 0x7f2c04000970


  was:
The CDR(billsec) and (ANSWEREDTIME) is not measuring the answered time accurately.

We debugging the issue and found what may the problem be.
According to [1] it seem that the CDR(billsec) is registering the answered time of the initial call and not the answered time of the bridged one (I mean after dialing the number on the DISA and the other party answering the call )

We CDR debug we found the right answered time data in the bridged CDR thread as shown in this log:

    -- SIP/sipetb-00000009 is ringing
    -- SIP/sipetb-00000009 is making progress passing it to SIP/sipetb-00000008
    -- SIP/sipetb-00000009 answered SIP/sipetb-00000008
0x7f2c04002830 - Set answered time to 1510800709.529550
Dial End message for SIP/sipetb-00000008, SIP/sipetb-00000009: 1510800709.00529783
0x7f2c04000970 - Processing Dial End message for channel SIP/sipetb-00000008, peer SIP/sipetb-00000009
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Dial to DialedPending
    -- Channel SIP/sipetb-00000009 joined 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
Bridge Enter message for channel SIP/sipetb-00000009: 1510800709.00529977
0x7f2c04002830 - Updating Party A SIP/sipetb-00000009 snapshot
0x7f2c04002830 - Processing bridge enter for SIP/sipetb-00000009
0x7f2c04002830 - Transitioning CDR for SIP/sipetb-00000009 from state Single to Bridged
    -- Channel SIP/sipetb-00000008 joined 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
       
Bridge Enter message for channel SIP/sipetb-00000008: 1510800709.00530039
0x7f2c04000970 - Updating Party A SIP/sipetb-00000008 snapshot
0x7f2c04000970 - Processing bridge enter for SIP/sipetb-00000008
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state DialedPending to Dial
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Dial to Bridged
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- Channel SIP/sipetb-00000009 left 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
    -- Channel SIP/sipetb-00000008 left 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
Bridge Leave message for SIP/sipetb-00000009: 1510800739.00509557

0x7f2c04002830 - Processing Bridge Leave for SIP/sipetb-00000009
0x7f2c04002830 - Transitioning CDR for SIP/sipetb-00000009 from state Bridged to Finalized
0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Bridged to Finalized
0x7f2c04002830 - Beginning finalize/dispatch for SIP/sipetb-00000009
0x7f2c04002830 - Dispatching CDR for Party A SIP/sipetb-00000009, Party B <none>
Bridge Leave message for SIP/sipetb-00000008: 1510800739.00509705
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1281 - uniqueid:1510800680.13 - DIAL SIP/sipetb/033168456954,60,rL(20460000:0)
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1164 - uniqueid:1510800680.13 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse-1 WHERE id_trunk='2']
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1433 - uniqueid:1510800680.13 - -> dialstatus : ANSWER, answered time is 47
 a2billing_cc3.php,6:
 a2billing_cc3.php,6: file:Class.RateEngine.php - line:1437 - uniqueid:1510800680.13 - [USEDRATECARD=0]
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:736 - uniqueid:1510800680.13 - :[DIALEDTIME: ->59<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:740 - uniqueid:1510800680.13 - :[DIALSTATUS: ->ANSWER<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:744 - uniqueid:1510800680.13 - :[CDRSTARTTIME: ->2017-11-15 21:51:31<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:748 - uniqueid:1510800680.13 - :[CDRANSWER: ->2017-11-15 21:51:31<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:752 - uniqueid:1510800680.13 - :[CDRend: ->2017-11-15 21:52:19<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:756 - uniqueid:1510800680.13 - :[CDRduration: ->47<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:760 - uniqueid:1510800680.13 - :[CDRbillsec: ->47<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:764 - uniqueid:1510800680.13 - :[CDRdisposition: ->ANSWERED<- ]17366200
 a2billing_cc3.php,6: file:a2billing_cc3.php - line:768 - uniqueid:1510800680.13 - :[ANSWERED: ->59<-]

What we need to do is to make the CDRANSWER variable to take the answered time registered in CDR thread 0x7f2c04002830 instead of using the one provided by the CDR thread 0x7f2c04000970



> Calls are not billed correctly by a2billing - Asterisk 12 and 13
> ----------------------------------------------------------------
>
>                 Key: ASTERISK-27425
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27425
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: CDR/General, Functions/func_cdr
>    Affects Versions: 12.0.0, 13.13.0
>         Environment: A2Billing 2.20 and Asterisk 13.
>            Reporter: Andrea Suarique
>
> The CDR(billsec) and (ANSWEREDTIME) is not measuring the answered time accurately.
> We debugging the issue and found what may the problem be.
> According to [1] it seem that the CDR(billsec) is registering the answered time of the initial call and not the answered time of the bridged one (I mean after dialing the number on the DISA and the other party answering the call )
> We CDR debug we found the right answered time data in the bridged CDR thread as shown in this log:
> {noformat}
>     -- SIP/sipetb-00000009 is ringing
>     -- SIP/sipetb-00000009 is making progress passing it to SIP/sipetb-00000008
>     -- SIP/sipetb-00000009 answered SIP/sipetb-00000008
> 0x7f2c04002830 - Set answered time to 1510800709.529550
> Dial End message for SIP/sipetb-00000008, SIP/sipetb-00000009: 1510800709.00529783
> 0x7f2c04000970 - Processing Dial End message for channel SIP/sipetb-00000008, peer SIP/sipetb-00000009
> 0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Dial to DialedPending
>     -- Channel SIP/sipetb-00000009 joined 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
> Bridge Enter message for channel SIP/sipetb-00000009: 1510800709.00529977
> 0x7f2c04002830 - Updating Party A SIP/sipetb-00000009 snapshot
> 0x7f2c04002830 - Processing bridge enter for SIP/sipetb-00000009
> 0x7f2c04002830 - Transitioning CDR for SIP/sipetb-00000009 from state Single to Bridged
>     -- Channel SIP/sipetb-00000008 joined 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
>        
> Bridge Enter message for channel SIP/sipetb-00000008: 1510800709.00530039
> 0x7f2c04000970 - Updating Party A SIP/sipetb-00000008 snapshot
> 0x7f2c04000970 - Processing bridge enter for SIP/sipetb-00000008
> 0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state DialedPending to Dial
> 0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Dial to Bridged
>     -- Remote UNIX connection
>     -- Remote UNIX connection disconnected
>     -- Remote UNIX connection
>     -- Remote UNIX connection disconnected
>     -- Remote UNIX connection
>     -- Remote UNIX connection disconnected
>     -- Channel SIP/sipetb-00000009 left 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
>     -- Channel SIP/sipetb-00000008 left 'simple_bridge' basic-bridge <40047399-8742-427f-8b36-e9f4eec1f8bc>
> Bridge Leave message for SIP/sipetb-00000009: 1510800739.00509557
> 0x7f2c04002830 - Processing Bridge Leave for SIP/sipetb-00000009
> 0x7f2c04002830 - Transitioning CDR for SIP/sipetb-00000009 from state Bridged to Finalized
> 0x7f2c04000970 - Transitioning CDR for SIP/sipetb-00000008 from state Bridged to Finalized
> 0x7f2c04002830 - Beginning finalize/dispatch for SIP/sipetb-00000009
> 0x7f2c04002830 - Dispatching CDR for Party A SIP/sipetb-00000009, Party B <none>
> Bridge Leave message for SIP/sipetb-00000008: 1510800739.00509705
>  a2billing_cc3.php,6: file:Class.RateEngine.php - line:1281 - uniqueid:1510800680.13 - DIAL SIP/sipetb/033168456954,60,rL(20460000:0)
>  a2billing_cc3.php,6: file:Class.RateEngine.php - line:1164 - uniqueid:1510800680.13 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse-1 WHERE id_trunk='2']
>  a2billing_cc3.php,6: file:Class.RateEngine.php - line:1433 - uniqueid:1510800680.13 - -> dialstatus : ANSWER, answered time is 47
>  a2billing_cc3.php,6:
>  a2billing_cc3.php,6: file:Class.RateEngine.php - line:1437 - uniqueid:1510800680.13 - [USEDRATECARD=0]
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:736 - uniqueid:1510800680.13 - :[DIALEDTIME: ->59<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:740 - uniqueid:1510800680.13 - :[DIALSTATUS: ->ANSWER<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:744 - uniqueid:1510800680.13 - :[CDRSTARTTIME: ->2017-11-15 21:51:31<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:748 - uniqueid:1510800680.13 - :[CDRANSWER: ->2017-11-15 21:51:31<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:752 - uniqueid:1510800680.13 - :[CDRend: ->2017-11-15 21:52:19<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:756 - uniqueid:1510800680.13 - :[CDRduration: ->47<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:760 - uniqueid:1510800680.13 - :[CDRbillsec: ->47<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:764 - uniqueid:1510800680.13 - :[CDRdisposition: ->ANSWERED<- ]17366200
>  a2billing_cc3.php,6: file:a2billing_cc3.php - line:768 - uniqueid:1510800680.13 - :[ANSWERED: ->59<-]
> {noformat}
> What we need to do is to make the CDRANSWER variable to take the answered time registered in CDR thread 0x7f2c04002830 instead of using the one provided by the CDR thread 0x7f2c04000970



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list