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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 2 11:40:46 CDT 2013


Author: mmichelson
Date: Tue Jul  2 11:40:44 2013
New Revision: 393441

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393441
Log:
Add playing of transfer failure sounds during transfer failures.

Some of the failures result in complete teardown, but others result
in the original transferer and transferee being bridged still.


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=393441&r1=393440&r2=393441
==============================================================================
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Tue Jul  2 11:40:44 2013
@@ -1056,6 +1056,21 @@
 	clear_stimulus_queue(props);
 
 	ao2_cleanup(props);
+}
+
+static void play_sound(struct ast_channel *chan, const char *sound)
+{
+	RAII_VAR(struct ast_bridge_channel *, bridge_channel, NULL, ao2_cleanup);
+
+	ast_channel_lock(chan);
+	bridge_channel = ast_channel_get_bridge_channel(chan);
+	ast_channel_unlock(chan);
+
+	if (!bridge_channel) {
+		return;
+	}
+
+	ast_bridge_channel_queue_playfile(bridge_channel, NULL, sound, NULL);
 }
 
 static void hold(struct ast_channel *chan)
@@ -1361,6 +1376,7 @@
 {
 	switch (stimulus) {
 	case STIMULUS_TRANSFEREE_HANGUP:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_FAIL;
 	case STIMULUS_DTMF_ATXFER_COMPLETE:
 	case STIMULUS_TRANSFERER_HANGUP:
@@ -1371,6 +1387,7 @@
 	case STIMULUS_TRANSFER_TARGET_HANGUP:
 	case STIMULUS_TIMEOUT:
 	case STIMULUS_DTMF_ATXFER_ABORT:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_REBRIDGE;
 	case STIMULUS_DTMF_ATXFER_THREEWAY:
 		bridge_unhold(props->transferee_bridge);
@@ -1402,6 +1419,7 @@
 {
 	switch (stimulus) {
 	case STIMULUS_TRANSFEREE_HANGUP:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_FAIL;
 	case STIMULUS_DTMF_ATXFER_COMPLETE:
 	case STIMULUS_TRANSFERER_HANGUP:
@@ -1411,6 +1429,7 @@
 	case STIMULUS_TRANSFER_TARGET_HANGUP:
 	case STIMULUS_TIMEOUT:
 	case STIMULUS_DTMF_ATXFER_ABORT:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_RESUME;
 	case STIMULUS_DTMF_ATXFER_THREEWAY:
 		return TRANSFER_THREEWAY;
@@ -1469,6 +1488,7 @@
 		return TRANSFER_COMPLETE;
 	case STIMULUS_TRANSFER_TARGET_HANGUP:
 	case STIMULUS_DTMF_ATXFER_ABORT:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_REBRIDGE;
 	case STIMULUS_DTMF_ATXFER_THREEWAY:
 		bridge_unhold(props->transferee_bridge);
@@ -1500,6 +1520,7 @@
 {
 	switch (stimulus) {
 	case STIMULUS_TRANSFEREE_HANGUP:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_FAIL;
 	case STIMULUS_TRANSFERER_HANGUP:
 	case STIMULUS_DTMF_ATXFER_COMPLETE:
@@ -1508,6 +1529,7 @@
 		return TRANSFER_COMPLETE;
 	case STIMULUS_TRANSFER_TARGET_HANGUP:
 	case STIMULUS_DTMF_ATXFER_ABORT:
+		play_sound(props->transferer, props->failsound);
 		return TRANSFER_RESUME;
 	case STIMULUS_DTMF_ATXFER_THREEWAY:
 		bridge_unhold(props->target_bridge);




More information about the asterisk-commits mailing list