[asterisk-commits] twilson: branch 1.4 r168716 - /branches/1.4/res/res_features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 15 12:22:50 CST 2009


Author: twilson
Date: Thu Jan 15 12:22:49 2009
New Revision: 168716

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168716
Log:
Convert call to park_call_full to masq_park_call_announce

Since we removed the AST_PBX_KEEPALIVE return value, we need to use masqueraded
parking, otherwise we will try to call ast_hangup() in __pbx_run() and in
do_parking_thread() and then promptly crash.
(closes issue #14215)
	Reported by: waverly360	
	Tested by: otherwiseguy
(closes issue #14228)
	Reported by: kobaz
	Tested by: otherwiseguy

Modified:
    branches/1.4/res/res_features.c

Modified: branches/1.4/res/res_features.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/res/res_features.c?view=diff&rev=168716&r1=168715&r2=168716
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Thu Jan 15 12:22:49 2009
@@ -175,8 +175,6 @@
 	struct ast_channel *chan;
 	struct ast_channel *peer;
 };
-
-
 
 /*! \brief store context, priority and extension */
 static void set_c_e_p(struct ast_channel *chan, const char *context, const char *ext, int pri)
@@ -510,6 +508,10 @@
 	/* Make the masq execute */
 	if ((f = ast_read(chan))) {
 		ast_frfree(f);
+	}
+
+	if (peer == rchan) {
+		peer = chan;
 	}
 
 	if (!play_announcement) {
@@ -1927,6 +1929,10 @@
 
 						ast_channel_unlock(chan);
 
+						if (!strncmp(peername, "Parked/", 7)) {
+							peername += 7;
+						}
+
 						if (dialfeatures)
 							snprintf(returnexten, sizeof(returnexten), "%s|30|%s", peername, dialfeatures->options);
 						else /* Existing default */
@@ -2059,7 +2065,6 @@
 	/* Cache the original channel name in case we get masqueraded in the middle
 	 * of a park--it is still theoretically possible for a transfer to happen before
 	 * we get here, but it is _really_ unlikely */
-	char *orig_chan_name = ast_strdupa(chan->name);
 	char orig_exten[AST_MAX_EXTENSION];
 	int orig_priority = chan->priority;
 
@@ -2084,11 +2089,7 @@
 		res = ast_safe_sleep(chan, 1000);
 	/* Park the call */
 	if (!res) {
-		res = park_call_full(chan, chan, 0, NULL, orig_chan_name);  /* In experiments, using the masq_park_call
-																	   func here yielded no difference with 
-																	   current implementation. I saw no advantage
-																	   in calling it instead.
-																	 */
+		res = masq_park_call_announce(chan, chan, 0, NULL);
 		/* Continue on in the dialplan */
 		if (res == 1) {
 			ast_copy_string(chan->exten, orig_exten, sizeof(chan->exten));




More information about the asterisk-commits mailing list