[asterisk-commits] mmichelson: branch mmichelson/transfer_stasis r392490 - /team/mmichelson/tran...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 21 17:04:07 CDT 2013


Author: mmichelson
Date: Fri Jun 21 17:04:05 2013
New Revision: 392490

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392490
Log:
Adjust BlindTransfer manager event to have full channel and bridge snapshots.


Modified:
    team/mmichelson/transfer_stasis/main/stasis_bridging.c

Modified: team/mmichelson/transfer_stasis/main/stasis_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/main/stasis_bridging.c?view=diff&rev=392490&r1=392489&r2=392490
==============================================================================
--- team/mmichelson/transfer_stasis/main/stasis_bridging.c (original)
+++ team/mmichelson/transfer_stasis/main/stasis_bridging.c Fri Jun 21 17:04:05 2013
@@ -57,11 +57,47 @@
 					<note><para>A result of <literal>Success</literal> does not necessarily mean that a target was succesfully
 					contacted. It means that a party was succesfully placed into the dialplan at the expected location.</para></note>
 				</parameter>
-				<parameter name="Transferer">
+				<parameter name="TransfererChannel">
 					<para>The name of the channel that performed the transfer</para>
 				</parameter>
-				<parameter name="Bridge">
+				<parameter name="TransfererChannelStateDesc">
+					<enumlist>
+						<enum name="Down"/>
+						<enum name="Rsrvd"/>
+						<enum name="OffHook"/>
+						<enum name="Dialing"/>
+						<enum name="Ring"/>
+						<enum name="Ringing"/>
+						<enum name="Up"/>
+						<enum name="Busy"/>
+						<enum name="Dialing Offhook"/>
+						<enum name="Pre-ring"/>
+						<enum name="Unknown"/>
+					</enumlist>
+				</parameter>
+				<parameter name="TransfererCallerIDNum">
+				</parameter>
+				<parameter name="TransfererCallerIDName">
+				</parameter>
+				<parameter name="TransfererConnectedLineNum">
+				</parameter>
+				<parameter name="TransfererConnectedLineName">
+				</parameter>
+				<parameter name="TransfererAccountCode">
+				</parameter>
+				<parameter name="TransfererContext">
+				</parameter>
+				<parameter name="TransfererExten">
+				</parameter>
+				<parameter name="TransfererPriority">
+				</parameter>
+				<parameter name="TransfererUniqueid">
+				</parameter>
+				<parameter name="BridgeUniqueid">
 					<para>The ID of the bridge where the Transferer performed the transfer</para>
+				</parameter>
+				<parameter name="BridgeType">
+					<para>The type of the bridge where the Transferer performed the transfer</para>
 				</parameter>
 				<parameter name="IsExternal">
 					<para>Indicates if the transfer was performed outside of Asterisk. For instance,
@@ -137,6 +173,7 @@
 				<para>	<replaceable>Bridge1</replaceable>: None, since a call to Voicemail has no bridge.</para>
 				<para>	<replaceable>Transferer2</replaceable>: Alice's channel in the bridge with Bob.</para>
 				<para>	<replaceable>Bridge2</replaceable>: The bridge between Alice and Bob.</para>
+			</description>
 		</managerEventInstance>
 	</managerEvent>
  ***/
@@ -504,18 +541,27 @@
 
 static struct ast_manager_event_blob *blind_transfer_to_ami(struct stasis_message *msg)
 {
+	RAII_VAR(struct ast_str *, channel_state, NULL, ast_free_ptr);
+	RAII_VAR(struct ast_str *, bridge_state, NULL, ast_free_ptr);
 	struct ast_blind_transfer_message * transfer_msg = stasis_message_data(msg);
+
+	channel_state = ast_manager_build_channel_state_string_prefix(transfer_msg->transferer.channel_snapshot, "Transferer");
+	bridge_state = ast_manager_build_bridge_state_string(transfer_msg->transferer.bridge_snapshot, "");
+
+	if (!channel_state || !bridge_state) {
+		return NULL;
+	}
 
 	return ast_manager_event_blob_create(EVENT_FLAG_CALL, "BlindTransfer",
 			"Result: %s\r\n"
-			"Transferer: %s\r\n"
-			"Bridge: %s\r\n"
+			"%s"
+			"%s"
 			"IsExternal: %s\r\n"
 			"Context: %s\r\n"
 			"Extension: %s\r\n",
 			result_strs[transfer_msg->result],
-			transfer_msg->transferer.channel_snapshot->name,
-			transfer_msg->transferer.bridge_snapshot->uniqueid,
+			ast_str_buffer(channel_state),
+			ast_str_buffer(bridge_state),
 			transfer_msg->is_external ? "Yes" : "No",
 			transfer_msg->context,
 			transfer_msg->exten);




More information about the asterisk-commits mailing list