[asterisk-commits] jpeeler: branch group/multiparking r114137 - /team/group/multiparking/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 15 11:28:42 CDT 2008


Author: jpeeler
Date: Tue Apr 15 11:28:42 2008
New Revision: 114137

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114137
Log:
fixes features reload errors and removes temporary hack from pbx.c

Modified:
    team/group/multiparking/main/features.c
    team/group/multiparking/main/pbx.c

Modified: team/group/multiparking/main/features.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/main/features.c?view=diff&rev=114137&r1=114136&r2=114137
==============================================================================
--- team/group/multiparking/main/features.c (original)
+++ team/group/multiparking/main/features.c Tue Apr 15 11:28:42 2008
@@ -2250,8 +2250,8 @@
 	int res = 0;
 	char parkingslot[AST_MAX_EXTENSION];
 
-	/* jpeeler: this either needs to be moved or is not necessary: */
-	/*parkinglot_addref(curlot);*/
+	/* TODO: I believe this reference increase is not necessary since the iterator in the calling function already did so */
+	//parkinglot_addref(curlot);
 	ao2_lock(curlot);
 	/* Lock parking list */
 	AST_LIST_LOCK(&curlot->parkings);
@@ -2771,8 +2771,10 @@
 	}
 
 	/* Add a parking extension into the context */
-	if (ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), ast_free, registrar) == -1)
-		error = 1;
+	if (!oldparkinglot) {
+		if (ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), ast_free, registrar) == -1)
+			error = 1;
+	}
 
 	ao2_unlock(parkinglot);
 
@@ -2838,6 +2840,7 @@
 
 	if (default_parkinglot) {
 		strcpy(old_parking_con, default_parkinglot->parking_con);
+		strcpy(old_parking_ext, parking_ext);
 	} else {
 		default_parkinglot = build_parkinglot(DEFAULT_PARKINGLOT, NULL);
 		if (default_parkinglot) {

Modified: team/group/multiparking/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/multiparking/main/pbx.c?view=diff&rev=114137&r1=114136&r2=114137
==============================================================================
--- team/group/multiparking/main/pbx.c (original)
+++ team/group/multiparking/main/pbx.c Tue Apr 15 11:28:42 2008
@@ -6425,7 +6425,7 @@
 			/* The pattern trie points to this exten; replace the pointer,
 			   and all will be well */
 			
-			if (x && x->exten) { /* this test for safety purposes */
+			if (x->exten) { /* this test for safety purposes */
 				x->exten = tmp; /* replace what would become a bad pointer */
 			} else {
 				ast_log(LOG_ERROR,"Trying to delete an exten from a context, but the pattern tree node returned isn't an extension\n");
@@ -6447,7 +6447,7 @@
  			con->root = tmp;
 			/* The pattern trie points to this exten; replace the pointer,
 			   and all will be well */
-			if (x && x->exten) { /* this test for safety purposes */
+			if (x->exten) { /* this test for safety purposes */
 				x->exten = tmp; /* replace what would become a bad pointer */
 			} else {
 				ast_log(LOG_ERROR,"Trying to delete an exten from a context, but the pattern tree node returned isn't an extension\n");




More information about the asterisk-commits mailing list