mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
added small feature from bug 5682 with one typo fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -12,6 +12,8 @@ context => parkedcalls ; Which context parked calls are in
|
|||||||
;courtesytone = beep ; Sound file to play to the parked caller
|
;courtesytone = beep ; Sound file to play to the parked caller
|
||||||
; when someone dials a parked call
|
; when someone dials a parked call
|
||||||
; or the Touch Monitor is activated/deactivated.
|
; or the Touch Monitor is activated/deactivated.
|
||||||
|
;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
|
;xfersound = beep ; to indicate an attended transfer is complete
|
||||||
;xferfailsound = beeperr ; to indicate a failed transfer
|
;xferfailsound = beeperr ; to indicate a failed transfer
|
||||||
;adsipark = yes ; if you want ADSI parking announcements
|
;adsipark = yes ; if you want ADSI parking announcements
|
||||||
|
@@ -94,6 +94,9 @@ static char courtesytone[256];
|
|||||||
static char xfersound[256];
|
static char xfersound[256];
|
||||||
static char xferfailsound[256];
|
static char xferfailsound[256];
|
||||||
|
|
||||||
|
/* Who to play the courtesy tone to */
|
||||||
|
static int parkedplay = 0;
|
||||||
|
|
||||||
/* First available extension for parking */
|
/* First available extension for parking */
|
||||||
static int parking_start;
|
static int parking_start;
|
||||||
|
|
||||||
@@ -1742,19 +1745,45 @@ static int park_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (peer) {
|
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_strlen_zero(courtesytone)) {
|
||||||
if (!ast_streamfile(chan, courtesytone, chan->language)) {
|
if (parkedplay == 0) {
|
||||||
if (ast_waitstream(chan, "") < 0) {
|
if (!ast_streamfile(chan, courtesytone, chan->language)) {
|
||||||
ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
|
if (ast_waitstream(chan, "") < 0) {
|
||||||
ast_hangup(peer);
|
ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
|
||||||
return -1;
|
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);
|
res = ast_channel_make_compatible(chan, peer);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for bridge\n", chan->name, peer->name);
|
ast_log(LOG_WARNING, "Could not make channels %s and %s compatible for bridge\n", chan->name, peer->name);
|
||||||
@@ -2029,6 +2058,13 @@ static int load_config(void)
|
|||||||
}
|
}
|
||||||
} else if (!strcasecmp(var->name, "courtesytone")) {
|
} else if (!strcasecmp(var->name, "courtesytone")) {
|
||||||
ast_copy_string(courtesytone, var->value, sizeof(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")) {
|
} else if (!strcasecmp(var->name, "xfersound")) {
|
||||||
ast_copy_string(xfersound, var->value, sizeof(xfersound));
|
ast_copy_string(xfersound, var->value, sizeof(xfersound));
|
||||||
} else if (!strcasecmp(var->name, "xferfailsound")) {
|
} else if (!strcasecmp(var->name, "xferfailsound")) {
|
||||||
|
Reference in New Issue
Block a user