[asterisk-commits] twilson: trunk r161679 - in /trunk: CHANGES channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 8 10:02:44 CST 2008


Author: twilson
Date: Mon Dec  8 10:02:42 2008
New Revision: 161679

URL: http://svn.digium.com/view/asterisk?view=rev&rev=161679
Log:
Add the ability to play a courtesy tone to the transfer target in a native SIP attended transfer by setting the variable ATTENEDED_TRANSFER_COMPLETE_SOUND.

Modified:
    trunk/CHANGES
    trunk/channels/chan_sip.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=161679&r1=161678&r2=161679
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Mon Dec  8 10:02:42 2008
@@ -28,6 +28,8 @@
  * Added a new 'faxdetect=yes|no' configuration option to sip.conf.  When this
    option is enabled, a SIP channel will go to the fax extension (if it exists)
    after T38 is negotiated.  This option is disabled by default.
+ * If ATTENDED_TRANSFER_COMPLETE_SOUND is set, the sound will be played to the
+   target of an attended transfer
 
 Skinny Changes
 --------------

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=161679&r1=161678&r2=161679
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Dec  8 10:02:42 2008
@@ -18927,11 +18927,15 @@
 			ast_clear_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
 	} else {
 		/* Transfer succeeded! */
+		const char *xfersound = pbx_builtin_getvar_helper(target.chan1, "ATTENDED_TRANSFER_COMPLETE_SOUND");
 
 		/* Tell transferer that we're done. */
 		transmit_notify_with_sipfrag(transferer, seqno, "200 OK", TRUE);
 		append_history(transferer, "Xfer", "Refer succeeded");
 		transferer->refer->status = REFER_200OK;
+		if (target.chan2 && !ast_strlen_zero(xfersound) && ast_streamfile(target.chan2, xfersound, target.chan2->language) >= 0) {
+			ast_waitstream(target.chan2, "");
+		}
 		if (targetcall_pvt->owner) {
 			ast_debug(1, "SIP attended transfer: Unlocking channel %s\n", targetcall_pvt->owner->name);
 			ast_channel_unlock(targetcall_pvt->owner);




More information about the asterisk-commits mailing list