[asterisk-bugs] [Asterisk 0012960]: ast_merge_contexts_and_delete() does not merge switches and includes properly

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Jul 11 13:17:36 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12960 
====================================================================== 
Reported By:                mnicholson
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   12960
Category:                   Core/PBX
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 126574 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-30-2008 14:14 CDT
Last Modified:              07-11-2008 13:17 CDT
====================================================================== 
Summary:                    ast_merge_contexts_and_delete() does not merge
switches and includes properly
Description: 
When using pbx_config and pbx_ael at the same time, if  context exists in
both pbx_config and pbx_ael, the includes and switches from that context
are not properly merged.  Which ever module was loaded/reloaded last takes
precedence.

This only seems to be a problem if two modules are sharing a context.
====================================================================== 

---------------------------------------------------------------------- 
 svnbot - 07-11-08 13:17  
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 130145

U   trunk/main/pbx.c

------------------------------------------------------------------------
r130145 | murf | 2008-07-11 13:17:12 -0500 (Fri, 11 Jul 2008) | 40 lines

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

(closes issue http://bugs.digium.com/view.php?id=12960)
Reported by: mnicholson

In this 'omnibus' fix, I **think** I solved both
the problem in 13041, where unloading pbx_ael.so
caused crashes, or incomplete removal of previous
registrar'ed entries. And I added code to completely
remove all includes, switches, and ignorepats that
had a matching registrar entry, which should
appease 12960.

I also added a lot of seemingly useless brackets
around single statement if's, which helped debug 
so much that I'm leaving them there.

I added a routine to check the correlation between
the extension tree lists and the hashtab 
tables. It can be amazingly helpful when you have
lots of dialplan stuff, and need to narrow
down where a problem is occurring. It's ifdef'd
out by default.

I cleaned up the code around the new CIDmatch code.
It was leaving hanging extens with bad ptrs, getting confused
over which objects to remove, etc. I tightened
up the code and changed the call to remove_exten
in the merge_and_delete code.

I added more conditions to check for empty context
worthy of deletion. It's not empty if there are
any includes, switches, or ignorepats present.

If I've missed anything, please re-open this bug,
and be prepared to supply example dialplan code.


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

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

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-11-08 13:17  svnbot         Checkin                                      
07-11-08 13:17  svnbot         Note Added: 0090106                          
======================================================================




More information about the asterisk-bugs mailing list