[asterisk-commits] mmichelson: branch mmichelson/more_transfer r388882 - in /team/mmichelson/mor...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 15 12:09:42 CDT 2013


Author: mmichelson
Date: Wed May 15 12:09:40 2013
New Revision: 388882

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388882
Log:
Address the smaller findings from Richard's review.

The two remaining items include the use of unreal channels.


Modified:
    team/mmichelson/more_transfer/CHANGES
    team/mmichelson/more_transfer/bridges/bridge_builtin_features.c
    team/mmichelson/more_transfer/include/asterisk/bridging.h
    team/mmichelson/more_transfer/include/asterisk/channel.h
    team/mmichelson/more_transfer/main/channel.c
    team/mmichelson/more_transfer/main/features.c

Modified: team/mmichelson/more_transfer/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/CHANGES?view=diff&rev=388882&r1=388881&r2=388882
==============================================================================
--- team/mmichelson/more_transfer/CHANGES (original)
+++ team/mmichelson/more_transfer/CHANGES Wed May 15 12:09:40 2013
@@ -75,7 +75,7 @@
  * The Bridge Manager action's Playtone header now accepts more fine-grained
    options. "Channel1" and "Channel2" may be specified in order to play a tone
    to the specific channel. "Both" may be specified to play a tone to both
-   channels. The old "yes" options is still accepted as a way of playing the
+   channels. The old "yes" option is still accepted as a way of playing the
    tone to Channel2 only.
 
 Channel Drivers

Modified: team/mmichelson/more_transfer/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/bridges/bridge_builtin_features.c?view=diff&rev=388882&r1=388881&r2=388882
==============================================================================
--- team/mmichelson/more_transfer/bridges/bridge_builtin_features.c (original)
+++ team/mmichelson/more_transfer/bridges/bridge_builtin_features.c Wed May 15 12:09:40 2013
@@ -198,12 +198,14 @@
 	if (!ast_strlen_zero(goto_on_blindxfr)) {
 		ast_debug(1, "After transfer, transferer %s goes to %s\n",
 				ast_channel_name(bridge_channel->chan), goto_on_blindxfr);
-		ast_replace_subargument_delimiter(goto_on_blindxfr);
 		ast_after_bridge_set_go_on(bridge_channel->chan, NULL, NULL, 0, goto_on_blindxfr);
 	}
 
-	ast_bridge_transfer_blind(bridge_channel->chan, exten, context, blind_transfer_cb,
-			bridge_channel->chan);
+	if (ast_bridge_transfer_blind(bridge_channel->chan, exten, context, blind_transfer_cb,
+			bridge_channel->chan) != AST_BRIDGE_TRANSFER_SUCCESS &&
+			!ast_strlen_zero(goto_on_blindxfr)) {
+		ast_after_bridge_goto_discard(bridge_channel->chan);
+	}
 
 	return 0;
 }

Modified: team/mmichelson/more_transfer/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/include/asterisk/bridging.h?view=diff&rev=388882&r1=388881&r2=388882
==============================================================================
--- team/mmichelson/more_transfer/include/asterisk/bridging.h (original)
+++ team/mmichelson/more_transfer/include/asterisk/bridging.h Wed May 15 12:09:40 2013
@@ -1337,7 +1337,6 @@
  *
  * \param to_transferee Transferer channel on initial call (presumably bridged to transferee)
  * \param to_transfer_target Transferer channel on consultation call (presumably bridged to transfer target)
- * \param hook A frame hook to attach to the resultant call
  * \return The success or failure of the attended transfer
  */
 enum ast_transfer_result ast_bridge_transfer_attended(struct ast_channel *to_transferee,

Modified: team/mmichelson/more_transfer/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/include/asterisk/channel.h?view=diff&rev=388882&r1=388881&r2=388882
==============================================================================
--- team/mmichelson/more_transfer/include/asterisk/channel.h (original)
+++ team/mmichelson/more_transfer/include/asterisk/channel.h Wed May 15 12:09:40 2013
@@ -4232,9 +4232,8 @@
  * \since 12
  * \brief Move a channel from its current location to a new location
  *
- * The intention of this function is to take the source channel and have it
- * take the place of the destination channel. Any application running on the
- * destination channel will now be running on the source channel instead.
+ * The intention of this function is to have the destination channel
+ * take on the identity of the source channel.
  *
  * \note This function is NOT intended to be used on bridged channels. If you
  * wish to move an unbridged channel into the place of a bridged channel, then

Modified: team/mmichelson/more_transfer/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/main/channel.c?view=diff&rev=388882&r1=388881&r2=388882
==============================================================================
--- team/mmichelson/more_transfer/main/channel.c (original)
+++ team/mmichelson/more_transfer/main/channel.c Wed May 15 12:09:40 2013
@@ -11306,7 +11306,7 @@
 
 struct ast_channel *ast_channel_yank(struct ast_channel *yankee)
 {
-	struct ast_channel *tmpchan;
+	struct ast_channel *yanked_chan;
 	struct {
 		char *accountcode;
 		char *exten;
@@ -11314,40 +11314,39 @@
 		char *linkedid;
 		char *name;
 		int amaflags;
-		int state;
 		struct ast_format readformat;
 		struct ast_format writeformat;
-	} tmpvars = { 0, };
+	} my_vars = { 0, };
 
 	ast_channel_lock(yankee);
-	tmpvars.accountcode = ast_strdupa(ast_channel_accountcode(yankee));
-	tmpvars.exten = ast_strdupa(ast_channel_exten(yankee));
-	tmpvars.context = ast_strdupa(ast_channel_context(yankee));
-	tmpvars.linkedid = ast_strdupa(ast_channel_linkedid(yankee));
-	tmpvars.name = ast_strdupa(ast_channel_name(yankee));
-	tmpvars.amaflags = ast_channel_amaflags(yankee);
-	ast_format_copy(&tmpvars.writeformat, ast_channel_writeformat(yankee));
-	ast_format_copy(&tmpvars.readformat, ast_channel_readformat(yankee));
+	my_vars.accountcode = ast_strdupa(ast_channel_accountcode(yankee));
+	my_vars.exten = ast_strdupa(ast_channel_exten(yankee));
+	my_vars.context = ast_strdupa(ast_channel_context(yankee));
+	my_vars.linkedid = ast_strdupa(ast_channel_linkedid(yankee));
+	my_vars.name = ast_strdupa(ast_channel_name(yankee));
+	my_vars.amaflags = ast_channel_amaflags(yankee);
+	ast_format_copy(&my_vars.writeformat, ast_channel_writeformat(yankee));
+	ast_format_copy(&my_vars.readformat, ast_channel_readformat(yankee));
 	ast_channel_unlock(yankee);
 
 	/* Do not hold any channel locks while calling channel_alloc() since the function
 	 * locks the channel container when linking the new channel in. */
-	if (!(tmpchan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, tmpvars.accountcode,
-					tmpvars.exten, tmpvars.context, tmpvars.linkedid, tmpvars.amaflags,
-					"Surrogate/%s", tmpvars.name))) {
+	if (!(yanked_chan = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, my_vars.accountcode,
+					my_vars.exten, my_vars.context, my_vars.linkedid, my_vars.amaflags,
+					"Surrogate/%s", my_vars.name))) {
 		return NULL;
 	}
 
 	/* Make formats okay */
-	ast_format_copy(ast_channel_readformat(tmpchan), &tmpvars.readformat);
-	ast_format_copy(ast_channel_writeformat(tmpchan), &tmpvars.writeformat);
-
-	if (ast_channel_move(tmpchan, yankee)) {
-		ast_hangup(tmpchan);
+	ast_format_copy(ast_channel_readformat(yanked_chan), &my_vars.readformat);
+	ast_format_copy(ast_channel_writeformat(yanked_chan), &my_vars.writeformat);
+
+	if (ast_channel_move(yanked_chan, yankee)) {
+		ast_hangup(yanked_chan);
 		return NULL;
 	}
 
-	return tmpchan;
+	return yanked_chan;
 }
 
 int ast_channel_move(struct ast_channel *dest, struct ast_channel *source)

Modified: team/mmichelson/more_transfer/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/main/features.c?view=diff&rev=388882&r1=388881&r2=388882
==============================================================================
--- team/mmichelson/more_transfer/main/features.c (original)
+++ team/mmichelson/more_transfer/main/features.c Wed May 15 12:09:40 2013
@@ -6799,6 +6799,7 @@
 			</see-also>
 		</managerEventInstance>
 	***/
+/* BUGBUG This event used to use ast_manager_event_multichan. Now channel variables are not included in the event */
 	manager_event(EVENT_FLAG_CALL, "BridgeAction",
 				"Response: Success\r\n"
 				"Channel1: %s\r\n"
@@ -7461,6 +7462,7 @@
 	}
 
 	if (ast_bridge_features_init(&chan_features)) {
+		ast_bridge_features_cleanup(&chan_features);
 		goto done;
 	}
 




More information about the asterisk-commits mailing list