[Home]

Summary:ASTERISK-16874: [patch] CDR's being written on caller hangup
Reporter:leearcher (leearcher)Labels:
Date Opened:2010-10-26 03:00:18Date Closed:2011-05-13 11:30:34
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CDR/cdr_adaptive_odbc
Versions:Frequency of
Occurrence
Related
Issues:
is related toASTERISK-17658 [patch] [regression] Blind transfers from queue are not logged into queue_log correctly
Environment:Attachments:( 0) issue18212_v1.8.patch
Description:I have an issue where I need to log who hung up on the CDR.  I have the various CDR(whohungup)=XXX in the dial plan and can see this on the console when I test each end hanging up first.  However the CDR is written instantly one party hangs up and not after all extensions have finished executing the CDR(whohungup) has been changed.  I have set endbeforehexten=no in cdr.conf but this doesn't seem to make any difference.

Comments:By: Tilghman Lesher (tilghman) 2010-10-29 13:00:19

Unless your logic is in the one and only "h" extension which executes at the conclusion of a call, then you're correct; it will not execute.

Some logs and dialplan would be helpful to see if this is actually a problem or just a misunderstanding of how this works.

By: leearcher (leearcher) 2010-11-02 10:35:27

Ah so the logic has to be in the h exten even though after hangup I can see the dialplan making the change?

By: leearcher (leearcher) 2010-11-02 10:45:52

Depending on who hangs up depends on whether the CDR gets updated.  By default I am setting the value to Client and if they have up first its ok.  The problem is when the other party hangs up.  Control returns to the dialplan and I can see it updating the value

Executing [s@ti:65] Set("SIP/192.168.254.178-00000014", "CDR(WhoHungUp)=Interpreter") in new stack

I've also put it into the hangup event but still the same thing.

Executing [h@ti:1] Set("SIP/192.168.254.178-00000014", "CDR(WhoHungUp)=otherparty") in new stack



calldate clid duration billsec disposition accountcode callid dnid server language interpreterused numbercalled NoOfTries WhoHungUp
2010-11-02 15:36:21.000 "0113XXXXXXX" <0113XXXXXXX> 17 6 ANSWERED 1 CA46E8ED-96E6-DF11-99C2-005056C00 2550 asterisktest 100 0012000000dQ1FCAA0 447791797676 1 Client



By: leearcher (leearcher) 2010-11-10 09:04:57.000-0600

Anything?

By: Tilghman Lesher (tilghman) 2010-11-10 11:39:36.000-0600

Your issue is in queue, please be patient, and we will get to it as time permits and developer resources become available.

By: Richard Mudgett (rmudgett) 2011-05-05 16:11:32

Is the dial application done inside a macro?

If so, the macro should have its own h exten.  When the bridge is broken because of a hangup, it will run the h exten found in the macro context before closing the CDR.

By: Richard Mudgett (rmudgett) 2011-05-05 16:16:13

The issue18212_v1.8.patch file makes the bridge look for the h exten in the current context and if inside a macro, the original context.

By: leearcher (leearcher) 2011-05-06 02:35:56

Hi, the dial calls a macro where the user is prompted to authenticate.  If they fail to authenticate the macro exits and the next user is tried, if they succeed then the call starts.

Any chance this could make it into 1.6.2?

Thanks

By: Richard Mudgett (rmudgett) 2011-05-06 11:50:14

Sorry, 1.6.2 is no longer receiving regular bug fixes.

By: Digium Subversion (svnbot) 2011-05-13 11:28:27

Repository: asterisk
Revision: 318868

U   branches/1.8/main/features.c

------------------------------------------------------------------------
r318868 | rmudgett | 2011-05-13 11:28:27 -0500 (Fri, 13 May 2011) | 19 lines

CDR's are being written immediately on caller hangup.

CDR's are being written immediately on caller hangup.  The dialplan is not
able to modify it in the h exten.  The h exten in the initial context is
not run before closing CDR's when the bridge is unlinked if a macro is
active and does not have an h exten.

* Make ast_bridge_call() check for an h exten in the current context and
if a macro is active then the initial context.  The first h exten found is
then run before closing the CDR.

(closes issue ASTERISK-16874)
Reported by: leearcher
Patches:
     issue18212_v1.8.patch uploaded by rmudgett (license 664)
Tested by: rmudgett

Review: https://reviewboard.asterisk.org/r/1206/

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=318868

By: Digium Subversion (svnbot) 2011-05-13 11:30:31

Repository: asterisk
Revision: 318869

_U  trunk/
U   trunk/main/features.c

------------------------------------------------------------------------
r318869 | rmudgett | 2011-05-13 11:30:30 -0500 (Fri, 13 May 2011) | 26 lines

Merged revisions 318868 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r318868 | rmudgett | 2011-05-13 11:28:26 -0500 (Fri, 13 May 2011) | 19 lines
 
 CDR's are being written immediately on caller hangup.
 
 CDR's are being written immediately on caller hangup.  The dialplan is not
 able to modify it in the h exten.  The h exten in the initial context is
 not run before closing CDR's when the bridge is unlinked if a macro is
 active and does not have an h exten.
 
 * Make ast_bridge_call() check for an h exten in the current context and
 if a macro is active then the initial context.  The first h exten found is
 then run before closing the CDR.
 
 (closes issue ASTERISK-16874)
 Reported by: leearcher
 Patches:
       issue18212_v1.8.patch uploaded by rmudgett (license 664)
 Tested by: rmudgett
 
 Review: https://reviewboard.asterisk.org/r/1206/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=318869