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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 24 09:39:33 CDT 2013


Author: oej
Date: Fri May 24 09:39:29 2013
New Revision: 389725

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389725
Log:
A tiny commit for a huge problem

Maybe this fixes blind transfers. Not blond or brunette transfers though.

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
    team/group/rana-moh-sip-transfer-1.8/channels/sip/include/sip.h

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=389725&r1=389724&r2=389725
==============================================================================
--- 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 May 24 09:39:29 2013
@@ -22,3 +22,24 @@
 C doesn't get music on hold - just silence.
 
 The moh status is not following the transfer.
+
+---
+BLIND Transfer
+
+chan1 ->transferer to asterisk
+chan2 ->asterisk to transferee
+target -> new channel
+
+Todo: Copy MOH status from chan1 to target.
+Or after target is set up, check hold status on chan2 and take action on that
+-------
+Attended transfer
+
+- Chan1 -> transferer to asterisk
+- Chan2 -> asterisk to transferee
+- target.chan1 Target channel
+- target.chan2 channel bridged to target
+- What's the name of the channel between transferer and asterisk bridged to target???
+We're bridging chan2 to target.chan1
+
+

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=389725&r1=389724&r2=389725
==============================================================================
--- 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 May 24 09:39:29 2013
@@ -7356,10 +7356,12 @@
 		res = -1;
 		break;
 	case AST_CONTROL_HOLD:
+		ast_set_flag(&p->flags[2], SIP_PAGE3_ONHOLD_BY_BRIDGEPEER);
 		ast_rtp_instance_update_source(p->rtp);
 		ast_moh_start(ast, data, p->mohinterpret);
 		break;
 	case AST_CONTROL_UNHOLD:
+		ast_clear_flag(&p->flags[2], SIP_PAGE3_ONHOLD_BY_BRIDGEPEER);
 		ast_rtp_instance_update_source(p->rtp);
 		ast_moh_stop(ast);
 		break;
@@ -24110,6 +24112,7 @@
 	int localtransfer = 0;
 	int attendedtransfer = 0;
 	int res = 0;
+	int currentlyonhold = ast_test_flag(&p->flags[2], SIP_PAGE3_ONHOLD_BY_BRIDGEPEER);;
 
 	if (req->debug) {
 		ast_verbose("Call %s got a SIP call transfer from %s: (REFER)!\n",
@@ -24294,6 +24297,7 @@
 		}
 		/* Fallthrough if we can't find the call leg internally */
 	}
+
 
 	/* Copy data we can not safely access after letting the pvt lock go. */
 	refer_to = ast_strdupa(p->refer->refer_to);
@@ -24423,6 +24427,10 @@
 	sip_pvt_unlock(p);
 	ast_indicate(current.chan2, AST_CONTROL_UNHOLD);
 	res = ast_async_goto(current.chan2, refer_to_context, refer_to, 1);
+	if (currentlyonhold) {
+		/* If this call was put on hold, let's put the new call on hold too */
+		ast_indicate(current.chan2, AST_CONTROL_HOLD);
+	}
 
 	if (!res) {
 		ast_manager_event_multichan(EVENT_FLAG_CALL, "Transfer", 2, chans,

Modified: team/group/rana-moh-sip-transfer-1.8/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/group/rana-moh-sip-transfer-1.8/channels/sip/include/sip.h?view=diff&rev=389725&r1=389724&r2=389725
==============================================================================
--- team/group/rana-moh-sip-transfer-1.8/channels/sip/include/sip.h (original)
+++ team/group/rana-moh-sip-transfer-1.8/channels/sip/include/sip.h Fri May 24 09:39:29 2013
@@ -359,6 +359,7 @@
 
 #define SIP_PAGE3_SNOM_AOC               (1 << 0)  /*!< DPG: Allow snom aoc messages */
 #define SIP_PAGE3_DIRECT_MEDIA_OUTGOING  (1 << 1)  /*!< DP: Only send direct media reinvites on outgoing calls */
+#define SIP_PAGE3_ONHOLD_BY_BRIDGEPEER  (1 << 17)  /*!< D: We're put on hold and play music */
 
 #define SIP_PAGE3_FLAGS_TO_COPY \
 	(SIP_PAGE3_SNOM_AOC | SIP_PAGE3_DIRECT_MEDIA_OUTGOING)




More information about the svn-commits mailing list