Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 166901) +++ channels/chan_sip.c (working copy) @@ -14769,6 +14769,17 @@ 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 */ res = attempt_transfer(current, &target); ast_mutex_unlock(&targetcall_pvt->lock); Index: main/channel.c =================================================================== --- main/channel.c (revision 166901) +++ main/channel.c (working copy) @@ -4124,6 +4124,7 @@ for (/* ever */;;) { struct timeval now = { 0, }; int to; + const char *bridge_play_sound = NULL; to = -1; @@ -4206,6 +4207,16 @@ if (!ast_strlen_zero(pbx_builtin_getvar_helper(c1, "BRIDGEPEER"))) pbx_builtin_setvar_helper(c1, "BRIDGEPEER", c0->name); + /* See if we need to play an audio file to any side of the bridge */ + if ((bridge_play_sound = pbx_builtin_getvar_helper(c0, "BRIDGE_PLAY_SOUND"))) { + bridge_playfile(c0, c1, bridge_play_sound, 0); + pbx_builtin_setvar_helper(c0, "BRIDGE_PLAY_SOUND", NULL); + } + if ((bridge_play_sound = pbx_builtin_getvar_helper(c1, "BRIDGE_PLAY_SOUND"))) { + bridge_playfile(c1, c0, bridge_play_sound, 0); + pbx_builtin_setvar_helper(c1, "BRIDGE_PLAY_SOUND", NULL); + } + if (c0->tech->bridge && (config->timelimit == 0) && (c0->tech->bridge == c1->tech->bridge) && Index: configs/sip.conf.sample =================================================================== --- configs/sip.conf.sample (revision 166901) +++ configs/sip.conf.sample (working copy) @@ -672,6 +672,9 @@ ;username=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 caus +e the given audio file to be played + ; upon completion of an attended transfer ;[pre14-asterisk] ;type=friend