[asterisk-commits] mmichelson: branch mmichelson/atxfer_features r393467 - /team/mmichelson/atxf...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 2 13:43:26 CDT 2013


Author: mmichelson
Date: Tue Jul  2 13:43:24 2013
New Revision: 393467

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393467
Log:
Publish stasis transfer failure messages on certain failure cases.

Only failures that occur while the transferer channel is still up will
cause such messages. Once the transferer is down, the transfer is considered
a successful transfer to a ringing extension.


Modified:
    team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diff&rev=393467&r1=393466&r2=393467
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Tue Jul  2 13:43:24 2013
@@ -1091,6 +1091,21 @@
 
 	ast_bridge_publish_attended_transfer_threeway(0, AST_BRIDGE_TRANSFER_SUCCESS,
 			&transferee, &transfer_target, &threeway);
+}
+
+static void publish_transfer_fail(struct attended_transfer_properties *props)
+{
+	struct ast_bridge_channel_pair transferee = {
+		.channel = props->transferer,
+		.bridge = props->transferee_bridge,
+	};
+	struct ast_bridge_channel_pair transfer_target = {
+		.channel = props->transferer,
+		.bridge = props->target_bridge,
+	};
+
+	ast_bridge_publish_attended_transfer_fail(0, AST_BRIDGE_TRANSFER_FAIL,
+			&transferee, &transfer_target);
 }
 
 static void play_sound(struct ast_channel *chan, const char *sound)
@@ -1412,6 +1427,7 @@
 	switch (stimulus) {
 	case STIMULUS_TRANSFEREE_HANGUP:
 		play_sound(props->transferer, props->failsound);
+		publish_transfer_fail(props);
 		return TRANSFER_FAIL;
 	case STIMULUS_DTMF_ATXFER_COMPLETE:
 	case STIMULUS_TRANSFERER_HANGUP:
@@ -1455,6 +1471,7 @@
 	switch (stimulus) {
 	case STIMULUS_TRANSFEREE_HANGUP:
 		play_sound(props->transferer, props->failsound);
+		publish_transfer_fail(props);
 		return TRANSFER_FAIL;
 	case STIMULUS_DTMF_ATXFER_COMPLETE:
 	case STIMULUS_TRANSFERER_HANGUP:
@@ -1557,6 +1574,7 @@
 	switch (stimulus) {
 	case STIMULUS_TRANSFEREE_HANGUP:
 		play_sound(props->transferer, props->failsound);
+		publish_transfer_fail(props);
 		return TRANSFER_FAIL;
 	case STIMULUS_TRANSFERER_HANGUP:
 	case STIMULUS_DTMF_ATXFER_COMPLETE:




More information about the asterisk-commits mailing list