[asterisk-bugs] [Asterisk 0012982]: CDR(billsecs) is not set if the M() option is used and the dialed party answers but hangs up whilst the macro is running

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Aug 5 18:05:01 CDT 2008


The following issue has been RESOLVED. 
====================================================================== 
http://bugs.digium.com/view.php?id=12982 
====================================================================== 
Reported By:                bcnit
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   12982
Category:                   Applications/app_dial
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
Asterisk Version:           1.4.20.1 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-07-03 09:32 CDT
Last Modified:              2008-08-05 18:05 CDT
====================================================================== 
Summary:                    CDR(billsecs) is not set if the M() option is used
and the dialed party answers but hangs up whilst the macro is running
Description: 

I have classed this as 'major' because of the potential financial
liability this bug may impose.

Consider a simple snippet of dial plan:

--------------------
[test]
exten => s,1,Dial(SIP/403,5,M(test-macro))

[macro-test-macro]
exten => s,1,Wait(10)
exten => s,n,MacroExit()
---------------------

If '403' answers the call, but hangs up whilst the macro is running, the
following CDR is produced:

"","402","s","test","""""
<402>","SIP/402-b6b06d70","SIP/403-084fc050","Dial","SIP/403|5|M(test-macro)","2008-07-03
14:16:51","2008-07-03 14:17:01","2008-07-03
14:17:01",10,0,"ANSWERED","DOCUMENTATION","1215094611.65003",""

In the example above, billsecs shows as 0, but it should really be '8'.

However, if the callee hangs up after the macro has finished (and the
caller and callee are bridged), then billsecs shows the correct value (and
includes the amount of time the callee spent in the macro):

"","402","s","test","""""
<402>","SIP/402-b6b01ea8","SIP/403-084b8cb0","Dial","SIP/403|5|M(test-macro)","2008-07-03
14:20:30","2008-07-03 14:20:31","2008-07-03
14:20:46",16,15,"ANSWERED","DOCUMENTATION","1215094830.65021",""

This behaviour is, at best, inconsistent and, at worst, financially
costly. If the callee does answer but hangs up within the macro, it is
impossible to know what the billable part of the total call duration was.

I believe that if the call is answered, regardless of the value returned
in MACRO_RESULT or where the call was terminated, the CDR field 'billsecs'
should always contain the time between the callee answering the call and
the call being terminated irrespective of whatever hoops the callee has to
jump through to get the call bridged to the caller.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-08-05 18:05 svnbot         Status                   assigned => resolved
2008-08-05 18:05 svnbot         Resolution               open => fixed       
======================================================================




More information about the asterisk-bugs mailing list