aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-30 16:40:43 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-30 16:40:43 +0000
commit9573bd94027ffc4edf5ad3f359da4fc52497746d (patch)
tree9f5955624340e340e4e0ad03a715382dc494ff92
parentc874d37df5d706dc4fc52e30d2a95c5f093e0796 (diff)
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) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@134401 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--CHANGES9
-rw-r--r--channels/chan_sip.c11
-rw-r--r--configs/chan_dahdi.conf.sample6
-rw-r--r--configs/iax.conf.sample5
-rw-r--r--configs/sip.conf.sample6
-rw-r--r--configs/skinny.conf.sample4
-rw-r--r--main/features.c15
7 files changed, 39 insertions, 17 deletions
diff --git a/CHANGES b/CHANGES
index 28b224ad3..7418e195b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -109,8 +109,6 @@ Application Changes
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
@@ -180,6 +178,13 @@ Queue changes
"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 -------------
------------------------------------------------------------------------------
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 746edfd23..af353db1a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -17748,17 +17748,6 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
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",
transferer->owner->name,
diff --git a/configs/chan_dahdi.conf.sample b/configs/chan_dahdi.conf.sample
index 9c486b13d..6c86a0842 100644
--- a/configs/chan_dahdi.conf.sample
+++ b/configs/chan_dahdi.conf.sample
@@ -538,7 +538,11 @@ callgroup=1
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
diff --git a/configs/iax.conf.sample b/configs/iax.conf.sample
index 97faa2b98..bbdfdca89 100644
--- a/configs/iax.conf.sample
+++ b/configs/iax.conf.sample
@@ -368,7 +368,10 @@ inkeys=freeworlddialup
;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
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index 9bdced5c3..0dcbced76 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -961,8 +961,10 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;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
diff --git a/configs/skinny.conf.sample b/configs/skinny.conf.sample
index 0cfb4fb6f..389e986fd 100644
--- a/configs/skinny.conf.sample
+++ b/configs/skinny.conf.sample
@@ -87,6 +87,10 @@ keepalive=120
;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
diff --git a/main/features.c b/main/features.c
index 0d8ea9363..a7eeedb2d 100644
--- a/main/features.c
+++ b/main/features.c
@@ -1235,6 +1235,21 @@ static int builtin_atxfer(struct ast_channel *chan, struct ast_channel *peer, st
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);