[asterisk-bugs] [Asterisk 0010668]: Incomplete CDR lock

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Jun 13 11:39:08 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10668 
====================================================================== 
Reported By:                arkadia
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   10668
Category:                   CDR/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             09-07-2007 08:26 CDT
Last Modified:              06-13-2008 11:39 CDT
====================================================================== 
Summary:                    Incomplete CDR lock
Description: 
This is all about the meaning of AST_CDR_FLAG_LOCKED flag for CDR. 
I assume if CDR has this flag set then it wont be updated anymore by any
ast_cdr_ functions except cases when we force such update. ast_cdr_reset()
is example of function which allows to update locked CDRs if special flag
is given.

Based on this assumption I prepared the patch with such changes:

  ast_cdr_setvar() - not allowed to touch locked CDRs. I don't see any
cases when we need to change locked CDRs too. Not touching locked CDRs is
helpfull when ForkCDR being used and every new CDR may have different
custom variables.

  ast_cdr_answer() - don't change status of locked CDRs. That might be
helpfull when we have a chain of CDRs for one incoming call for which we
perform several tries to make outgoing call. Every outgoing attempt may
finish with its own completion code. And if the final attempt is 'answered'
then we have only one CDR with 'answered' status. All other will keep
connection error codes which is very helpful for error monitoring.

 ast_cdr_end() - don't change locked CDRs by the same reason as
ast_cdr_answer()

As there will be no changes in CDR after lock, app_forkcdr.c should be
updated to end original locked CDR.
Also it'll be great to make optional cdr reset in this application, but
thats a theme for another patch.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0012726 ForkCDR application fails to set duration
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 06-13-08 11:39  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 122590

_U  team/murf/CDRfix4/
U   team/murf/CDRfix4/CHANGES
U   team/murf/CDRfix4/acinclude.m4
U   team/murf/CDRfix4/apps/app_chanspy.c
A   team/murf/CDRfix4/apps/app_dahdibarge.c
A   team/murf/CDRfix4/apps/app_dahdiras.c
A   team/murf/CDRfix4/apps/app_dahdiscan.c
U   team/murf/CDRfix4/apps/app_dial.c
U   team/murf/CDRfix4/apps/app_disa.c
U   team/murf/CDRfix4/apps/app_flash.c
U   team/murf/CDRfix4/apps/app_forkcdr.c
U   team/murf/CDRfix4/apps/app_getcpeid.c
U   team/murf/CDRfix4/apps/app_meetme.c
U   team/murf/CDRfix4/apps/app_page.c
U   team/murf/CDRfix4/apps/app_parkandannounce.c
U   team/murf/CDRfix4/apps/app_read.c
U   team/murf/CDRfix4/apps/app_rpt.c
D   team/murf/CDRfix4/apps/app_zapbarge.c
D   team/murf/CDRfix4/apps/app_zapras.c
D   team/murf/CDRfix4/apps/app_zapscan.c
U   team/murf/CDRfix4/build_tools/menuselect-deps.in
A   team/murf/CDRfix4/channels/chan_dahdi.c
U   team/murf/CDRfix4/channels/chan_iax2.c
U   team/murf/CDRfix4/channels/chan_mgcp.c
U   team/murf/CDRfix4/channels/chan_misdn.c
D   team/murf/CDRfix4/channels/chan_zap.c
A   team/murf/CDRfix4/codecs/codec_dahdi.c
D   team/murf/CDRfix4/codecs/codec_zap.c
U   team/murf/CDRfix4/configure
U   team/murf/CDRfix4/configure.ac
U   team/murf/CDRfix4/contrib/utils/zones2indications.c
U   team/murf/CDRfix4/funcs/func_cdr.c
U   team/murf/CDRfix4/funcs/func_channel.c
U   team/murf/CDRfix4/include/asterisk/autoconfig.h.in
U   team/murf/CDRfix4/include/asterisk/cdr.h
U   team/murf/CDRfix4/include/asterisk/channel.h
A   team/murf/CDRfix4/include/asterisk/dahdi_compat.h
U   team/murf/CDRfix4/include/asterisk/indications.h
U   team/murf/CDRfix4/include/asterisk/options.h
U   team/murf/CDRfix4/main/app.c
U   team/murf/CDRfix4/main/asterisk.c
U   team/murf/CDRfix4/main/cdr.c
U   team/murf/CDRfix4/main/channel.c
U   team/murf/CDRfix4/main/file.c
U   team/murf/CDRfix4/main/indications.c
U   team/murf/CDRfix4/main/loader.c
U   team/murf/CDRfix4/makeopts.in
U   team/murf/CDRfix4/pbx/pbx_config.c
U   team/murf/CDRfix4/res/res_features.c
U   team/murf/CDRfix4/res/res_indications.c
U   team/murf/CDRfix4/res/res_musiconhold.c
U   team/murf/CDRfix4/res/snmp/agent.c

------------------------------------------------------------------------
r122590 | murf | 2008-06-13 11:39:02 -0500 (Fri, 13 Jun 2008) | 108 lines

Merged revisions
122046,122127,122130,122137,122208,122259,122311,122314,122589 via svnmerge
from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r122046 | murf | 2008-06-12 07:47:34 -0600 (Thu, 12 Jun 2008) | 37 lines

(closes issue http://bugs.digium.com/view.php?id=10668)
Reported by: arkadia
Tested by: murf, arkadia

Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.

The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.

The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.

The T option was added to forkCDR to force 
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.

The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via 
email, irc, etc, over the past months/year)

The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.

Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!


........
r122127 | murf | 2008-06-12 08:51:44 -0600 (Thu, 12 Jun 2008) | 1 line

Arkadia tried to warn me, but the code added to ast_cdr_busy, _failed, and
_noanswer was redundant. Didn't spot it until I was resolving conflicts in
trunk. Ugh. Redundant code removed. It wasn't harmful. Just dumb.
........
r122130 | tilghman | 2008-06-12 09:11:30 -0600 (Thu, 12 Jun 2008) | 4
lines

Occasionally, the alertpipe loses its nonblocking status, so detect and
correct
that situation before it causes a deadlock.  (Reported and tested by
ctooley
via #asterisk-dev)

........
r122137 | tilghman | 2008-06-12 09:18:39 -0600 (Thu, 12 Jun 2008) | 8
lines

Flipflop the sections for two options, since the section for 'X' (exit
context)
may otherwise absorb keypresses meant for 's' (admin/user menu).
(closes issue http://bugs.digium.com/view.php?id=12836)
 Reported by: blitzrage
 Patches: 
       20080611__bug12836.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage

........
r122208 | jpeeler | 2008-06-12 09:46:08 -0600 (Thu, 12 Jun 2008) | 5 lines

(closes issue http://bugs.digium.com/view.php?id=12193)
Reported by: davidw
Patch by: Corydon76, modified by me to work properly with ParkAndAnnounce
app


........
r122259 | russell | 2008-06-12 12:22:44 -0600 (Thu, 12 Jun 2008) | 3 lines

Fix some race conditions that cause ast_assert() to report that chan_iax2
tried
to remove an entry that wasn't in the scheduler

........
r122311 | mmichelson | 2008-06-12 12:50:58 -0600 (Thu, 12 Jun 2008) | 9
lines

Properly play a holdtime message if the announce-holdtime option is
set to "once."

(closes issue http://bugs.digium.com/view.php?id=12842)
Reported by: ramonpeek
Patches:
      patch001.diff uploaded by ramonpeek (license 266)


........
r122314 | jpeeler | 2008-06-12 13:08:20 -0600 (Thu, 12 Jun 2008) | 2 lines

Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap
stuff should continue working. Release announcement to follow.

........
r122589 | twilson | 2008-06-13 10:29:07 -0600 (Fri, 13 Jun 2008) | 7 lines

This should fix the behavior of the 'T' dial feature being passed
incorrectly to the transferee when builtin_atxfers are used.
Also, doing a builtin_atxfer to parking was broken and is fixed here as
well.

(closes issue http://bugs.digium.com/view.php?id=11898)
	Reported by: sergee
	Tested by: otherwiseguy

........

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

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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-13-08 11:39  svnbot         Note Added: 0088676                          
======================================================================




More information about the asterisk-bugs mailing list