[svn-commits] oej: branch oej/rana-moh-queue-transfer-1.8 r393120 - in /team/oej/rana-moh-q...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 28 08:28:21 CDT 2013


Author: oej
Date: Fri Jun 28 08:28:18 2013
New Revision: 393120

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393120
Log:
Ready for tests

Modified:
    team/oej/rana-moh-queue-transfer-1.8/channels/chan_sip.c
    team/oej/rana-moh-queue-transfer-1.8/channels/sip/include/sip.h
    team/oej/rana-moh-queue-transfer-1.8/res/res_musiconhold.c

Modified: team/oej/rana-moh-queue-transfer-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-moh-queue-transfer-1.8/channels/chan_sip.c?view=diff&rev=393120&r1=393119&r2=393120
==============================================================================
--- team/oej/rana-moh-queue-transfer-1.8/channels/chan_sip.c (original)
+++ team/oej/rana-moh-queue-transfer-1.8/channels/chan_sip.c Fri Jun 28 08:28:18 2013
@@ -23882,7 +23882,12 @@
 	target.chan2 = ast_bridged_channel(targetcall_pvt->owner);	/* Asterisk to target */
 	if (target.chan2) {
 		ast_channel_ref(target.chan2);
-	}
+	} else {
+		/* Target chan1 is running a one-legged call, maybe queue or IVR */
+		/* If this channel is serviced by music, we need to make sure that it 
+		   continues */
+		ast_copy_string(target.chan1_musicclass, ast_moh_query(target.chan1), sizeof (target.chan1_musicclass));
+	}  
 
 	if (!target.chan2 || !(target.chan2->_state == AST_STATE_UP || target.chan2->_state == AST_STATE_RINGING) ) {
 		/* Wrong state of new channel */
@@ -23979,6 +23984,9 @@
 
 		if (current->chan2 && current->chan2->_state == AST_STATE_RING) {
 			ast_indicate(target.chan1, AST_CONTROL_RINGING);
+		}
+		if (!ast_strlen_zero(target.chan1_musicclass)) {
+			ast_moh_start(target.chan1, target.chan1_musicclass, target.chan1_musicclass);
 		}
 
 		if (target.chan2) {

Modified: team/oej/rana-moh-queue-transfer-1.8/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-moh-queue-transfer-1.8/channels/sip/include/sip.h?view=diff&rev=393120&r1=393119&r2=393120
==============================================================================
--- team/oej/rana-moh-queue-transfer-1.8/channels/sip/include/sip.h (original)
+++ team/oej/rana-moh-queue-transfer-1.8/channels/sip/include/sip.h Fri Jun 28 08:28:18 2013
@@ -789,6 +789,8 @@
 	uint32_t seqno;              /*!< Sequence number */
 	char *park_exten;
 	char *park_context;
+	char chan1_musicclass[MAX_MUSICCLASS];	/* Music class if chan2 is one-legged and getting
+						   serviced by MOH */
 };
 
 /*! \brief Parameters to the transmit_invite function */

Modified: team/oej/rana-moh-queue-transfer-1.8/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/rana-moh-queue-transfer-1.8/res/res_musiconhold.c?view=diff&rev=393120&r1=393119&r2=393120
==============================================================================
--- team/oej/rana-moh-queue-transfer-1.8/res/res_musiconhold.c (original)
+++ team/oej/rana-moh-queue-transfer-1.8/res/res_musiconhold.c Fri Jun 28 08:28:18 2013
@@ -1547,11 +1547,16 @@
 	if (!chan) {
 		return NULL;
 	}
+	if (!ast_test_flag(chan, AST_FLAG_MOH)) {
+		ast_debug(2, "===> Not currently playing music \n");
+		return NULL;
+	}
 	ast_channel_lock(chan);
 	ast_channel_unlock(chan);
 	if (chan->music_state) {
 		state = chan->music_state;
 		if (state->class) {
+			ast_debug(2, "===> Playing music - class %s \n", state->class->name);
 			return state->class->name;
 		}
 	}




More information about the svn-commits mailing list