[asterisk-commits] rmudgett: branch rmudgett/hangup_handlers r369418 - in /team/rmudgett/hangup_...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 26 18:31:27 CDT 2012


Author: rmudgett
Date: Tue Jun 26 18:31:24 2012
New Revision: 369418

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=369418
Log:
Reviewboard changes for findings.

* Replace CHANNEL(hangup_handler_replace) with
CHANNEL(hangup_handler_wipe).

* Added comment in ast_pbx_h_exten_run().

* Moved a lock call in ast_pbx_hangup_handler_run().

Modified:
    team/rmudgett/hangup_handlers/funcs/func_channel.c
    team/rmudgett/hangup_handlers/main/pbx.c

Modified: team/rmudgett/hangup_handlers/funcs/func_channel.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hangup_handlers/funcs/func_channel.c?view=diff&rev=369418&r1=369417&r2=369418
==============================================================================
--- team/rmudgett/hangup_handlers/funcs/func_channel.c (original)
+++ team/rmudgett/hangup_handlers/funcs/func_channel.c Tue Jun 26 18:31:24 2012
@@ -113,8 +113,8 @@
 						optionally omitted context and exten are supplied by the
 						channel pushing the handler before it is pushed.</para>
 					</enum>
-					<enum name="hangup_handler_replace">
-						<para>W/O Replace the entire hangup handler stack
+					<enum name="hangup_handler_wipe">
+						<para>W/O Wipe the entire hangup handler stack and replace
 						with a new hangup handler on the channel if supplied.  The
 						assigned string is passed to the Gosub application when
 						the channel is hung up.  Any optionally omitted context
@@ -552,7 +552,7 @@
 		ast_pbx_hangup_handler_push(chan, value);
 	} else if (!strcasecmp(data, "hangup_handler_push")) {
 		ast_pbx_hangup_handler_push(chan, value);
-	} else if (!strcasecmp(data, "hangup_handler_replace")) {
+	} else if (!strcasecmp(data, "hangup_handler_wipe")) {
 		/* Pop all hangup handlers before pushing the new handler. */
 		while (ast_pbx_hangup_handler_pop(chan)) {
 		}

Modified: team/rmudgett/hangup_handlers/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/hangup_handlers/main/pbx.c?view=diff&rev=369418&r1=369417&r2=369418
==============================================================================
--- team/rmudgett/hangup_handlers/main/pbx.c (original)
+++ team/rmudgett/hangup_handlers/main/pbx.c Tue Jun 26 18:31:24 2012
@@ -5380,6 +5380,7 @@
 
 		ast_channel_lock(chan);
 		if (spawn_error) {
+			/* The code after the loop needs the channel locked. */
 			break;
 		}
 		ast_channel_priority_set(chan, ast_channel_priority(chan) + 1);
@@ -5429,7 +5430,6 @@
 		handlers = ast_channel_hangup_handlers(chan);
 		h_handler = AST_LIST_REMOVE_HEAD(handlers, node);
 		if (!h_handler) {
-			ast_channel_unlock(chan);
 			break;
 		}
 
@@ -5457,6 +5457,7 @@
 
 		ast_channel_lock(chan);
 	}
+	ast_channel_unlock(chan);
 	return 1;
 }
 




More information about the asterisk-commits mailing list