[asterisk-commits] branch jcollie/bug7063 r27021 - in /team/jcollie/bug7063: ./ apps/ channels/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 11 14:20:54 MST 2006


Author: jcollie
Date: Thu May 11 16:20:53 2006
New Revision: 27021

URL: http://svn.digium.com/view/asterisk?rev=27021&view=rev
Log:
Merged revisions 26989-26992 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r26989 | rizzo | 2006-05-11 15:03:52 -0500 (Thu, 11 May 2006) | 4 lines

oops, missing ! in matchcid...
this should fix bug #7142


........
r26990 | russell | 2006-05-11 15:07:44 -0500 (Thu, 11 May 2006) | 7 lines

 - The recent change to linklists.h broke the build on linux for some reason.
   So, I have removed all of the uses of AST_LIST_HEAD_INIT and replaced them
   with the equivalent static initializations.
 - On passing, fix a memory leak in the unload_module() function of chan_agent.
   The agents list mutex was never destroyed, and the elements in the agents
   list were not freed.

........
r26991 | rizzo | 2006-05-11 15:21:11 -0500 (Thu, 11 May 2006) | 3 lines

set correct type for lock initializers


........
r26992 | russell | 2006-05-11 15:29:00 -0500 (Thu, 11 May 2006) | 3 lines

use config.status instead of include/autoconfig.h as the dependency
for menuselect

........

Modified:
    team/jcollie/bug7063/   (props changed)
    team/jcollie/bug7063/Makefile
    team/jcollie/bug7063/apps/app_externalivr.c
    team/jcollie/bug7063/channels/chan_agent.c
    team/jcollie/bug7063/dnsmgr.c
    team/jcollie/bug7063/include/asterisk/linkedlists.h
    team/jcollie/bug7063/include/asterisk/lock.h
    team/jcollie/bug7063/pbx.c
    team/jcollie/bug7063/res/res_features.c

Propchange: team/jcollie/bug7063/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 11 16:20:53 2006
@@ -1,1 +1,1 @@
-/trunk:1-26985
+/trunk:1-27020

Modified: team/jcollie/bug7063/Makefile
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/Makefile?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/Makefile (original)
+++ team/jcollie/bug7063/Makefile Thu May 11 16:20:53 2006
@@ -990,7 +990,7 @@
 menuselect: build_tools/menuselect makeopts.xml
 	- at build_tools/menuselect ${GLOBAL_MAKEOPTS} ${USER_MAKEOPTS} menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!"
 
-build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h include/autoconfig.h mxml/libmxml.a $(MENUSELECT_OBJS)
+build_tools/menuselect: build_tools/menuselect.c build_tools/menuselect_curses.c build_tools/menuselect.h config.status mxml/libmxml.a $(MENUSELECT_OBJS)
 	$(MAKE) -C build_tools menuselect
 
 mxml/libmxml.a:

Modified: team/jcollie/bug7063/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/apps/app_externalivr.c?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/apps/app_externalivr.c (original)
+++ team/jcollie/bug7063/apps/app_externalivr.c Thu May 11 16:20:53 2006
@@ -258,14 +258,14 @@
 	FILE *child_commands = NULL;
 	FILE *child_errors = NULL;
 	FILE *child_events = NULL;
-	struct ivr_localuser foo, *u = &foo;
-
-	bzero(u, sizeof(*u));
+	struct ivr_localuser foo = {
+		.playlist = AST_LIST_HEAD_INIT_VALUE,
+		.finishlist = AST_LIST_HEAD_INIT_VALUE,
+	};
+	struct ivr_localuser *u = &foo;
 
 	LOCAL_USER_ADD(lu);
 	
-	AST_LIST_HEAD_INIT(&u->playlist);
-	AST_LIST_HEAD_INIT(&u->finishlist);
 	u->abort_current_sound = 0;
 	u->chan = chan;
 	

Modified: team/jcollie/bug7063/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/channels/chan_agent.c?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/channels/chan_agent.c (original)
+++ team/jcollie/bug7063/channels/chan_agent.c Thu May 11 16:20:53 2006
@@ -2597,19 +2597,16 @@
 	ast_manager_unregister("AgentLogoff");
 	ast_manager_unregister("AgentCallbackLogin");
 	/* Unregister channel */
-	ast_channel_unregister(&agent_tech);
-	if (!AST_LIST_LOCK(&agents)) {
-		/* Hangup all interfaces if they have an owner */
-		AST_LIST_TRAVERSE(&agents, p, list) {
-			if (p->owner)
-				ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
-		}
-		AST_LIST_UNLOCK(&agents);
-		AST_LIST_HEAD_INIT(&agents);
-	} else {
-		ast_log(LOG_WARNING, "Unable to lock the monitor\n");
-		return -1;
-	}		
+	AST_LIST_LOCK(&agents);
+	/* Hangup all interfaces if they have an owner */
+	while ((p = AST_LIST_REMOVE_HEAD(&agents, list))) {
+		if (p->owner)
+			ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
+		free(p);
+	}
+	AST_LIST_UNLOCK(&agents);
+	AST_LIST_HEAD_DESTROY(&agents);
+
 	return 0;
 }
 

Modified: team/jcollie/bug7063/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/dnsmgr.c?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/dnsmgr.c (original)
+++ team/jcollie/bug7063/dnsmgr.c Thu May 11 16:20:53 2006
@@ -58,7 +58,7 @@
 	char name[1];
 };
 
-static AST_LIST_HEAD(entry_list, ast_dnsmgr_entry) entry_list;
+static AST_LIST_HEAD_STATIC(entry_list, ast_dnsmgr_entry);
 
 AST_MUTEX_DEFINE_STATIC(refresh_lock);
 
@@ -285,7 +285,6 @@
 		ast_log(LOG_ERROR, "Unable to create schedule context.\n");
 		return -1;
 	}
-	AST_LIST_HEAD_INIT(&entry_list);
 	ast_cli_register(&cli_reload);
 	ast_cli_register(&cli_status);
 	return do_reload(1);

Modified: team/jcollie/bug7063/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/include/asterisk/linkedlists.h?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/include/asterisk/linkedlists.h (original)
+++ team/jcollie/bug7063/include/asterisk/linkedlists.h Thu May 11 16:20:53 2006
@@ -354,20 +354,6 @@
 #define AST_LIST_TRAVERSE_SAFE_END  }
 
 /*!
-  \brief Initializes a list head structure.
-  \param head This is a pointer to the list head structure
-
-  This macro initializes a list head structure by setting the head
-  entry to \a NULL (empty list) and recreating the embedded lock.
-*/
-#define AST_LIST_HEAD_INIT(head) {					\
-	(head)->first = NULL;						\
-	(head)->last = NULL;						\
-	(head)->lock = AST_MUTEX_INIT_VALUE;				\
-	ast_mutex_init(&(head)->lock);					\
-}
-
-/*!
   \brief Destroys a list head structure.
   \param head This is a pointer to the list head structure
 

Modified: team/jcollie/bug7063/include/asterisk/lock.h
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/include/asterisk/lock.h?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/include/asterisk/lock.h (original)
+++ team/jcollie/bug7063/include/asterisk/lock.h Thu May 11 16:20:53 2006
@@ -571,10 +571,10 @@
 #else /* !DEBUG_THREADS */
 
 
-#define AST_MUTEX_INIT_VALUE	PTHREAD_MUTEX_INIT_VALUE
-
 
 typedef pthread_mutex_t ast_mutex_t;
+
+#define AST_MUTEX_INIT_VALUE	((ast_mutex_t)PTHREAD_MUTEX_INIT_VALUE)
 
 static inline int ast_mutex_init(ast_mutex_t *pmutex)
 {

Modified: team/jcollie/bug7063/pbx.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/pbx.c?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/pbx.c (original)
+++ team/jcollie/bug7063/pbx.c Thu May 11 16:20:53 2006
@@ -950,7 +950,7 @@
 		int match = extension_match_core(eroot->exten, exten, action);
 		/* 0 on fail, 1 on match, 2 on earlymatch */
 
-		if (!match || (eroot->matchcid && matchcid(eroot->cidmatch, callerid)))
+		if (!match || (eroot->matchcid && !matchcid(eroot->cidmatch, callerid)))
 			continue;	/* keep trying */
 		if (match == 2 && action == E_MATCHMORE) {
 			/* We match an extension ending in '!'.
@@ -3465,14 +3465,12 @@
 void ast_merge_contexts_and_delete(struct ast_context **extcontexts, const char *registrar)
 {
 	struct ast_context *tmp, *lasttmp = NULL;
-	struct store_hints store;
+	struct store_hints store = AST_LIST_HEAD_INIT_VALUE;
 	struct store_hint *this;
 	struct ast_hint *hint;
 	struct ast_exten *exten;
 	int length;
 	struct ast_state_cb *thiscb, *prevcb;
-
-	AST_LIST_HEAD_INIT(&store);
 
 	/* it is very important that this function hold the hint list lock _and_ the conlock
 	   during its operation; not only do we need to ensure that the list of contexts

Modified: team/jcollie/bug7063/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug7063/res/res_features.c?rev=27021&r1=27020&r2=27021&view=diff
==============================================================================
--- team/jcollie/bug7063/res/res_features.c (original)
+++ team/jcollie/bug7063/res/res_features.c Thu May 11 16:20:53 2006
@@ -782,7 +782,7 @@
 };
 
 
-static AST_LIST_HEAD(feature_list,ast_call_feature) feature_list;
+static AST_LIST_HEAD_STATIC(feature_list,ast_call_feature);
 
 /*! \brief register new feature into feature_list*/
 void ast_register_feature(struct ast_call_feature *feature)
@@ -2104,7 +2104,6 @@
 	int res;
 	
 	__mod_desc = mod;
-	AST_LIST_HEAD_INIT(&feature_list);
 	memset(parking_ext, 0, sizeof(parking_ext));
 	memset(parking_con, 0, sizeof(parking_con));
 



More information about the asterisk-commits mailing list