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: https://origsvn.digium.com/svn/asterisk/trunk@134401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-07-30 16:40:43 +00:00
parent f4fe5be9df
commit 853f6a8b3e
7 changed files with 39 additions and 17 deletions

View File

@@ -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);