diff options
author | Joshua Colp <jcolp@digium.com> | 2008-03-25 15:18:41 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2008-03-25 15:18:41 +0000 |
commit | 738e4ec94e7144147b21c158764dc7d8fbbc20bf (patch) | |
tree | b4442a43ce0035f8b86c6c864e171fcf650fca3c /channels | |
parent | 358ac2f76a0313f1008627ab91e374e5bcaf4873 (diff) |
Add a special dialplan variable to chan_sip which will cause an audio file to be played upon completion of an attended transfer.
(closes issue #9239)
Reported by: sunder
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a6e6b4bb5..128175234 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -16869,6 +16869,17 @@ 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, |