[svn-commits] tilghman: trunk r134401 - in /trunk: ./ channels/ configs/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 30 11:40:44 CDT 2008


Author: tilghman
Date: Wed Jul 30 11:40:43 2008
New Revision: 134401

URL: http://svn.digium.com/view/asterisk?view=rev&rev=134401
Log:
Move implementation of an attended-transfer-complete sound from one channel
driver into a common place for multiple channel drivers.
(closes issue #13152)
 Reported by: caio1982
 Patches: 
       atxfer_complete_sound3.diff uploaded by caio1982 (license 22)

Modified:
    trunk/CHANGES
    trunk/channels/chan_sip.c
    trunk/configs/chan_dahdi.conf.sample
    trunk/configs/iax.conf.sample
    trunk/configs/sip.conf.sample
    trunk/configs/skinny.conf.sample
    trunk/main/features.c

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Wed Jul 30 11:40:43 2008
@@ -109,8 +109,6 @@
 
 SIP Changes
 -----------
- * The ATTENDED_TRANSFER_COMPLETE_SOUND can now be set using setvar to cause a given
-   audio file to be played upon completion of an attended transfer.
  * Added DNS manager support to registrations for peers referencing peer entries.
    DNS manager runs in the background which allows DNS lookups to be run asynchronously 
    as well as periodically updating the IP address. These properties allow for
@@ -179,6 +177,13 @@
   * A new configuration option, "timeoutpriority" has been added. Please see the section labeled
     "QUEUE TIMING OPTIONS" in configs/queues.conf.sample for a detailed explanation of the option
     as well as an explanation about timeout options in general
+
+Miscellaneous
+-------------
+  * The channel variable ATTENDED_TRANSFER_COMPLETE_SOUND can now be set using
+    the 'setvar' option to cause a given audio file to be played upon completion
+    of an attended transfer.  Currently it works for DAHDI, IAX2, SIP, and
+    Skinny channels only.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.4.X to Asterisk 1.6.0  -------------

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jul 30 11:40:43 2008
@@ -17747,17 +17747,6 @@
 	}
 
 	ast_set_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);	/* Delay hangup */
-
-	/* If we are performing an attended transfer and we have two channels involved then copy sound file information to play upon attended transfer completion */
-	if (target.chan2) {
-		const char *chan1_attended_sound = pbx_builtin_getvar_helper(target.chan1, "ATTENDED_TRANSFER_COMPLETE_SOUND"), *chan2_attended_sound = pbx_builtin_getvar_helper(target.chan2, "ATTENDED_TRANSFER_COMPLETE_SOUND");
-		if (!ast_strlen_zero(chan1_attended_sound)) {
-			pbx_builtin_setvar_helper(target.chan1, "BRIDGE_PLAY_SOUND", chan1_attended_sound);
-		}
-		if (!ast_strlen_zero(chan2_attended_sound)) {
-			pbx_builtin_setvar_helper(target.chan2, "BRIDGE_PLAY_SOUND", chan2_attended_sound);
-		}
-	}
 
 	/* Perform the transfer */
 	manager_event(EVENT_FLAG_CALL, "Transfer", "TransferMethod: SIP\r\nTransferType: Attended\r\nChannel: %s\r\nUniqueid: %s\r\nSIP-Callid: %s\r\nTargetChannel: %s\r\nTargetUniqueid: %s\r\n",

Modified: trunk/configs/chan_dahdi.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/chan_dahdi.conf.sample?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/configs/chan_dahdi.conf.sample (original)
+++ trunk/configs/chan_dahdi.conf.sample Wed Jul 30 11:40:43 2008
@@ -538,7 +538,11 @@
 pickupgroup=1
 
 ; Channel variable to be set for all calls from this channel
-;setvar=CHANNEL=42             
+;setvar=CHANNEL=42
+;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep   ; This channel variable will
+                                                ; cause the given audio file to
+                                                ; be played upon completion of
+                                                ; an attended transfer.
 
 ;
 ; Specify whether the channel should be answered immediately or if the simple

Modified: trunk/configs/iax.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/iax.conf.sample?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/configs/iax.conf.sample (original)
+++ trunk/configs/iax.conf.sample Wed Jul 30 11:40:43 2008
@@ -368,7 +368,10 @@
 ;context=local
 ;auth=md5,plaintext,rsa
 ;secret=markpasswd
-;setvar=foo=bar
+;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep   ; This channel variable will
+                                                ; cause the given audio file to
+                                                ; be played upon completion of
+                                                ; an attended transfer.
 ;dbsecret=mysecrets/place	; Secrets can be stored in astdb, too
 ;transfer=no		; Disable IAX native transfer
 ;transfer=mediaonly	; When doing IAX native transfers, transfer 

Modified: trunk/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/sip.conf.sample?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/configs/sip.conf.sample (original)
+++ trunk/configs/sip.conf.sample Wed Jul 30 11:40:43 2008
@@ -961,8 +961,10 @@
 ;defaultuser=goran		; Username to use when calling this device before registration
 				; Normally you do NOT need to set this parameter
 ;setvar=CUSTID=5678		; Channel variable to be set for all calls from this device
-;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep ; This channel variable will cause the given audio file to be played
-                                              ; upon completion of an attended transfer
+;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep   ; This channel variable will
+                                                ; cause the given audio file to
+                                                ; be played upon completion of
+                                                ; an attended transfer.
 
 ;[pre14-asterisk]
 ;type=friend

Modified: trunk/configs/skinny.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/skinny.conf.sample?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/configs/skinny.conf.sample (original)
+++ trunk/configs/skinny.conf.sample Wed Jul 30 11:40:43 2008
@@ -87,6 +87,10 @@
 ;nat=yes
 ;callerid="George W. Bush" <202-456-1414>
 ;setvar=CUSTID=5678	; Channel variable to be set for all calls from this device
+;setvar=ATTENDED_TRANSFER_COMPLETE_SOUND=beep   ; This channel variable will
+                                                ; cause the given audio file to
+                                                ; be played upon completion of
+                                                ; an attended transfer.
 ;mailbox=500
 ;callwaiting=yes
 ;transfer=yes

Modified: trunk/main/features.c
URL: http://svn.digium.com/view/asterisk/trunk/main/features.c?view=diff&rev=134401&r1=134400&r2=134401
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Wed Jul 30 11:40:43 2008
@@ -1235,6 +1235,21 @@
 
 	l = strlen(xferto);
 	snprintf(xferto + l, sizeof(xferto) - l, "@%s/n", transferer_real_context);	/* append context */
+
+	/* If we are performing an attended transfer and we have two channels involved then
+	   copy sound file information to play upon attended transfer completion */
+	if (transferee) {
+		const char *chan1_attended_sound = pbx_builtin_getvar_helper(transferer, "ATTENDED_TRANSFER_COMPLETE_SOUND");
+		const char *chan2_attended_sound = pbx_builtin_getvar_helper(transferee, "ATTENDED_TRANSFER_COMPLETE_SOUND");
+
+		if (!ast_strlen_zero(chan1_attended_sound)) {
+			pbx_builtin_setvar_helper(transferer, "BRIDGE_PLAY_SOUND", chan1_attended_sound);
+		}
+		if (!ast_strlen_zero(chan2_attended_sound)) {
+			pbx_builtin_setvar_helper(transferee, "BRIDGE_PLAY_SOUND", chan2_attended_sound);
+		}
+	}
+
 	newchan = ast_feature_request_and_dial(transferer, transferee, "Local", ast_best_codec(transferer->nativeformats),
 		xferto, atxfernoanswertimeout, &outstate, transferer->cid.cid_num, transferer->cid.cid_name, 1, transferer->language);
 




More information about the svn-commits mailing list