mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-06 18:13:45 +00:00
Merge NetBSD and Courtesty tone with modifications (bug #2329)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
*
|
||||
* Routines implementing call parking
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
@@ -61,6 +61,9 @@ static int parking_stop = 750;
|
||||
|
||||
static int transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
||||
|
||||
/* Default courtesy tone played when party joins conference */
|
||||
static char courtesytone[256] = "";
|
||||
|
||||
/* Registrar for operations */
|
||||
static char *registrar = "res_features";
|
||||
|
||||
@@ -692,6 +695,17 @@ static int park_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
if (peer) {
|
||||
/* Play a courtesy beep in the calling channel 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ast_moh_stop(peer);
|
||||
res = ast_channel_make_compatible(chan, peer);
|
||||
if (res < 0) {
|
||||
@@ -850,6 +864,8 @@ int load_module(void)
|
||||
transferdigittimeout = DEFAULT_TRANSFER_DIGIT_TIMEOUT;
|
||||
} else
|
||||
transferdigittimeout = transferdigittimeout * 1000;
|
||||
} else if (!strcasecmp(var->name, "courtesytone")) {
|
||||
strncpy(courtesytone, var->value, sizeof(courtesytone) - 1);
|
||||
}
|
||||
var = var->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user