[svn-commits] oej: branch group/rana-moh-sip-transfer-1.8 r393118 - in /team/group/rana-moh...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 28 03:57:32 CDT 2013


Author: oej
Date: Fri Jun 28 03:57:28 2013
New Revision: 393118

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393118
Log:
Adding functionality. Yes sir.

Modified:
    team/group/rana-moh-sip-transfer-1.8/README.rana-moh-sip-transfer
    team/group/rana-moh-sip-transfer-1.8/channels/chan_sip.c

Modified: team/group/rana-moh-sip-transfer-1.8/README.rana-moh-sip-transfer
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-moh-sip-transfer-1.8/README.rana-moh-sip-transfer?view=diff&rev=393118&r1=393117&r2=393118
==============================================================================
--- team/group/rana-moh-sip-transfer-1.8/README.rana-moh-sip-transfer (original)
+++ team/group/rana-moh-sip-transfer-1.8/README.rana-moh-sip-transfer Fri Jun 28 03:57:28 2013
@@ -32,7 +32,7 @@
 ========
 1. Blind transfers in SIP	- works ok
 2. Attended transfers in SIP	- works ok
-3. Transfers to a queue
+3. Transfers to a queue 	- doesn't work
 
 ---
 BLIND Transfer
@@ -71,3 +71,18 @@
 - chan_mgcp:
 - chan_?
 - chan_local 		No changes needed
+
+Transfer to a queue
+===================
+
+When doing attended transfer to a queue we have
+
+A calls or answers B
+A puts B on hold, B gets music
+A calls the queue - no bridge, music provided by app_queue
+A transfers B to queue
+
+B now doesn't get any music
+
+As this is not a hold case we need to find a way to restart MOH on a channel
+with the previous settings.

Modified: team/group/rana-moh-sip-transfer-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-moh-sip-transfer-1.8/channels/chan_sip.c?view=diff&rev=393118&r1=393117&r2=393118
==============================================================================
--- team/group/rana-moh-sip-transfer-1.8/channels/chan_sip.c (original)
+++ team/group/rana-moh-sip-transfer-1.8/channels/chan_sip.c Fri Jun 28 03:57:28 2013
@@ -23858,6 +23858,7 @@
 	struct ast_party_connected_line connected_to_target;
 	char transferer_linkedid[32];
 	struct ast_channel *chans[2];
+	int target_chan1_mohstate = FALSE;
 
 	/* Check if the call ID of the replaces header does exist locally */
 	if (!(targetcall_pvt = get_sip_pvt_byid_locked(transferer->refer->replaces_callid, transferer->refer->replaces_callid_totag,
@@ -23897,6 +23898,11 @@
 	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 */
+		target_chan1_mohstate = ast_test_flag(target.chan1, AST_FLAG_MOH);
 	}
 
 	if (!target.chan2 || !(target.chan2->_state == AST_STATE_UP || target.chan2->_state == AST_STATE_RINGING) ) {
@@ -23908,6 +23914,7 @@
 		else
 			ast_debug(4, "SIP attended transfer: Attempting transfer in ringing state\n");
 	}
+
 
 	/* Transfer */
 	if (sipdebug) {
@@ -24002,6 +24009,10 @@
 
 		if (current->chan2 && current->chan2->_state == AST_STATE_RING) {
 			ast_indicate(target.chan1, AST_CONTROL_RINGING);
+		}
+		if (target_chan1_mohstate) {
+			ast_debug(4, "====> Turning on music on hold again. Trying to at least \n");
+			ast_moh_start(target.chan1, NULL, NULL);
 		}
 
 		if (target.chan2) {




More information about the svn-commits mailing list