Index: res/res_features.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_features.c,v retrieving revision 1.81 diff -u -r1.81 res_features.c --- res/res_features.c 9 Nov 2005 00:16:08 -0000 1.81 +++ res/res_features.c 10 Nov 2005 21:38:52 -0000 @@ -93,6 +93,9 @@ static char xfersound[256]; static char xferfailsound[256]; +/* Who to play the couresy tone to */ +static int parkedplay = 0; + /* First available extension for parking */ static int parking_start; @@ -1728,19 +1731,45 @@ } if (peer) { - /* Play a courtesy beep in the calling channel to prefix the bridge connecting */ + /* Play a courtesy to the source(s) configured to prefix the bridge connecting */ if (!ast_strlen_zero(courtesytone)) { - if (!ast_streamfile(chan, courtesytone, chan->language)) { - if (ast_waitstream(chan, "") < 0) { - ast_log(LOG_WARNING, "Failed to play courtesy tone!\n"); - ast_hangup(peer); - return -1; + if (parkedplay == 0) { + if (!ast_streamfile(chan, courtesytone, chan->language)) { + if (ast_waitstream(chan, "") < 0) { + ast_log(LOG_WARNING, "Failed to play courtesy tone!\n"); + ast_hangup(peer); + return -1; + } + } + ast_moh_stop(peer); + ast_indicate(peer, AST_CONTROL_UNHOLD); + } else { + ast_moh_stop(peer); + ast_indicate(peer, AST_CONTROL_UNHOLD); + if (parkedplay == 2) { + if (!ast_streamfile(chan, courtesytone, chan->language) && !ast_streamfile(peer, courtesytone, chan->language)) { + res = ast_waitstream(chan, ""); + if (res >= 0) + res = ast_waitstream(peer, ""); + if (res < 0) { + ast_log(LOG_WARNING, "Failed to play courtesy tones!\n"); + ast_hangup(peer); + return -1; + } + } + } else if (parkedplay == 1) { + if (!ast_streamfile(peer, courtesytone, chan->language)) { + if (ast_waitstream(peer, "") < 0) { + ast_log(LOG_WARNING, "Failed to play courtesy tone!\n"); + ast_hangup(peer); + return -1; + } + } } } + } - ast_moh_stop(peer); - ast_indicate(peer, AST_CONTROL_UNHOLD); res = ast_channel_make_compatible(chan, peer); if (res < 0) { ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for bridge\n", chan->name, peer->name); @@ -2014,6 +2043,13 @@ } } else if (!strcasecmp(var->name, "courtesytone")) { ast_copy_string(courtesytone, var->value, sizeof(courtesytone)); + } else if (!strcasecmp(var->name, "parkedplay")) { + if (!strcasecmp(var->value, "both")) + parkedplay = 2; + else if (!strcasecmp(var->value, "parked")) + parkedplay = 1; + else + parkedplay = 0; } else if (!strcasecmp(var->name, "xfersound")) { ast_copy_string(xfersound, var->value, sizeof(xfersound)); } else if (!strcasecmp(var->name, "xferfailsound")) { Index: configs/features.conf.sample =================================================================== RCS file: /usr/cvsroot/asterisk/configs/features.conf.sample,v retrieving revision 1.12 diff -u -r1.12 features.conf.sample --- configs/features.conf.sample 3 Nov 2005 21:53:44 -0000 1.12 +++ configs/features.conf.sample 10 Nov 2005 21:38:52 -0000 @@ -11,6 +11,8 @@ ;transferdigittimeout => 3 ; Number of seconds to wait between digits when transfering a call ;courtesytone = beep ; Sound file to play to the parked caller ; when someone dials a parked call +;parkedplay = caller ; Who to play the courtesy tone to when picking up a parked call + ; one of: parked, caller, both (default is caller) ;xfersound = beep ; to indicate an attended transfer is complete ;xferfailsound = beeperr ; to indicate a failed transfer ;adsipark = yes ; if you want ADSI parking announcements