[asterisk-commits] mmichelson: branch mmichelson/transfer r386373 - /team/mmichelson/transfer/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 23 14:55:32 CDT 2013


Author: mmichelson
Date: Tue Apr 23 14:55:29 2013
New Revision: 386373

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386373
Log:
Blind transfer action is now handled by the bridge.


Modified:
    team/mmichelson/transfer/main/bridging.c

Modified: team/mmichelson/transfer/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/main/bridging.c?view=diff&rev=386373&r1=386372&r2=386373
==============================================================================
--- team/mmichelson/transfer/main/bridging.c (original)
+++ team/mmichelson/transfer/main/bridging.c Tue Apr 23 14:55:29 2013
@@ -1974,6 +1974,25 @@
 	ast_debug(1, "Playing DTMF stream '%s' out to %p(%s)\n",
 		dtmf, bridge_channel, ast_channel_name(bridge_channel->chan));
 	ast_dtmf_stream(bridge_channel->chan, NULL, dtmf, 0, 0);
+}
+
+/* XXX These buffer sizes could use more consideration. Currently
+ * just numbers pulled out of thin air.
+ */
+struct blind_transfer_data {
+	char transferer_name[128];
+	char transferee_name[128];
+	char exten[AST_MAX_EXTENSION];
+	char context[AST_MAX_CONTEXT];
+};
+
+static void bridge_channel_blind_transfer(struct ast_bridge_channel *bridge_channel,
+		struct blind_transfer_data *blind_data)
+{
+	if (!strncmp(ast_channel_name(bridge_channel->chan), blind_data->transferee_name, sizeof(blind_data->transferee_name))) {
+		ast_after_bridge_set_goto(bridge_channel->chan, blind_data->context, blind_data->exten, 1);
+		ast_bridge_remove(bridge_channel->bridge, bridge_channel->chan);
+	}
 }
 
 /*!
@@ -2029,6 +2048,8 @@
 		ast_indicate(bridge_channel->chan, AST_CONTROL_SRCUPDATE);
 		bridge_channel_unsuspend(bridge_channel);
 		break;
+	case AST_BRIDGE_ACTION_BLIND_TRANSFER:
+		bridge_channel_blind_transfer(bridge_channel, action->data.ptr);
 	default:
 		break;
 	}
@@ -4232,16 +4253,6 @@
 	return AST_BRIDGE_TRANSFER_SUCCESS;
 }
 
-/* XXX These buffer sizes could use more consideration. Currently
- * just numbers pulled out of thin air.
- */
-struct blind_transfer_data {
-	char transferer_name[128];
-	char transferee_name[128];
-	char exten[AST_MAX_EXTENSION];
-	char context[AST_MAX_CONTEXT];
-};
-
 static enum ast_transfer_result queue_blind_transfer_bridge_action(struct ast_bridge *bridge,
 		struct ast_channel *transferer, const char *exten, const char *context)
 {




More information about the asterisk-commits mailing list