diff options
author | Mark Spencer <markster@digium.com> | 2004-08-31 13:32:11 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2004-08-31 13:32:11 +0000 |
commit | 2a108b9b06e52027aea370bc5c19705db74851d6 (patch) | |
tree | 8b96ade1ef4f07a1645bf7bdbfc34fcaa2b725db /res | |
parent | 6749f1b8b5ad2a9ba4bde209f401e4c747d5ea53 (diff) |
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
Diffstat (limited to 'res')
-rwxr-xr-x | res/res_features.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/res/res_features.c b/res/res_features.c index 4d219298a..7cab65b10 100755 --- a/res/res_features.c +++ b/res/res_features.c @@ -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; } |