mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
app_followme: Add a prompt to be read when a call is connected
This patch adds the ability to configure a prompt which will be read to the "winner" who pressed 1 (or the configured value) and received the call. ASTERISK-24372 #close Change-Id: I6ec1c6c883347f7d1e1f597189544993c8d65272
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -60,6 +60,11 @@ cdr_syslog
|
|||||||
--- Functionality changes from Asterisk 15.2.0 to Asterisk 15.3.0 ------------
|
--- Functionality changes from Asterisk 15.2.0 to Asterisk 15.3.0 ------------
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
app_followme
|
||||||
|
------------------
|
||||||
|
* Added a new prompt, connecting-prompt, which will be played
|
||||||
|
(if configured) to the "winner" callee before connecting the call.
|
||||||
|
|
||||||
res_pjsip
|
res_pjsip
|
||||||
------------------
|
------------------
|
||||||
* Users who are matching endpoints by SIP header need to reevaluate their
|
* Users who are matching endpoints by SIP header need to reevaluate their
|
||||||
|
@@ -176,6 +176,7 @@ struct call_followme {
|
|||||||
char plsholdprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
char plsholdprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
char statusprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
char statusprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
char sorryprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
char sorryprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
|
char connprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
|
|
||||||
AST_LIST_HEAD_NOLOCK(numbers, number) numbers; /*!< Head of the list of follow-me numbers */
|
AST_LIST_HEAD_NOLOCK(numbers, number) numbers; /*!< Head of the list of follow-me numbers */
|
||||||
AST_LIST_HEAD_NOLOCK(blnumbers, number) blnumbers; /*!< Head of the list of black-listed numbers */
|
AST_LIST_HEAD_NOLOCK(blnumbers, number) blnumbers; /*!< Head of the list of black-listed numbers */
|
||||||
@@ -212,6 +213,7 @@ struct fm_args {
|
|||||||
char plsholdprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
char plsholdprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
char statusprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
char statusprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
char sorryprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
char sorryprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
|
char connprompt[PATH_MAX]; /*!< Sound prompt name and path */
|
||||||
struct ast_flags followmeflags;
|
struct ast_flags followmeflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -277,6 +279,7 @@ static char optionsprompt[PATH_MAX] = "followme/options";
|
|||||||
static char plsholdprompt[PATH_MAX] = "followme/pls-hold-while-try";
|
static char plsholdprompt[PATH_MAX] = "followme/pls-hold-while-try";
|
||||||
static char statusprompt[PATH_MAX] = "followme/status";
|
static char statusprompt[PATH_MAX] = "followme/status";
|
||||||
static char sorryprompt[PATH_MAX] = "followme/sorry";
|
static char sorryprompt[PATH_MAX] = "followme/sorry";
|
||||||
|
static char connprompt[PATH_MAX] = "";
|
||||||
|
|
||||||
|
|
||||||
static AST_RWLIST_HEAD_STATIC(followmes, call_followme);
|
static AST_RWLIST_HEAD_STATIC(followmes, call_followme);
|
||||||
@@ -333,6 +336,7 @@ static void init_profile(struct call_followme *f, int activate)
|
|||||||
ast_copy_string(f->plsholdprompt, plsholdprompt, sizeof(f->plsholdprompt));
|
ast_copy_string(f->plsholdprompt, plsholdprompt, sizeof(f->plsholdprompt));
|
||||||
ast_copy_string(f->statusprompt, statusprompt, sizeof(f->statusprompt));
|
ast_copy_string(f->statusprompt, statusprompt, sizeof(f->statusprompt));
|
||||||
ast_copy_string(f->sorryprompt, sorryprompt, sizeof(f->sorryprompt));
|
ast_copy_string(f->sorryprompt, sorryprompt, sizeof(f->sorryprompt));
|
||||||
|
ast_copy_string(f->connprompt, connprompt, sizeof(f->connprompt));
|
||||||
if (activate) {
|
if (activate) {
|
||||||
f->active = 1;
|
f->active = 1;
|
||||||
}
|
}
|
||||||
@@ -366,7 +370,9 @@ static void profile_set_param(struct call_followme *f, const char *param, const
|
|||||||
ast_copy_string(f->statusprompt, val, sizeof(f->statusprompt));
|
ast_copy_string(f->statusprompt, val, sizeof(f->statusprompt));
|
||||||
else if (!strcasecmp(param, "followme-sorry-prompt") || !strcasecmp(param, "sorry_prompt"))
|
else if (!strcasecmp(param, "followme-sorry-prompt") || !strcasecmp(param, "sorry_prompt"))
|
||||||
ast_copy_string(f->sorryprompt, val, sizeof(f->sorryprompt));
|
ast_copy_string(f->sorryprompt, val, sizeof(f->sorryprompt));
|
||||||
else if (failunknown) {
|
else if (!strcasecmp(param, "followme-connecting-prompt") || !strcasecmp(param, "connecting_prompt")) {
|
||||||
|
ast_copy_string(f->connprompt, val, sizeof(f->connprompt));
|
||||||
|
} else if (failunknown) {
|
||||||
if (linenum >= 0)
|
if (linenum >= 0)
|
||||||
ast_log(LOG_WARNING, "Unknown keyword in profile '%s': %s at line %d of followme.conf\n", f->name, param, linenum);
|
ast_log(LOG_WARNING, "Unknown keyword in profile '%s': %s at line %d of followme.conf\n", f->name, param, linenum);
|
||||||
else
|
else
|
||||||
@@ -489,6 +495,13 @@ static int reload_followme(int reload)
|
|||||||
ast_copy_string(sorryprompt, tmpstr, sizeof(sorryprompt));
|
ast_copy_string(sorryprompt, tmpstr, sizeof(sorryprompt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((tmpstr = ast_variable_retrieve(cfg, "general", "connecting-prompt")) && !ast_strlen_zero(tmpstr)) {
|
||||||
|
ast_copy_string(connprompt, tmpstr, sizeof(connprompt));
|
||||||
|
} else if ((tmpstr = ast_variable_retrieve(cfg, "general", "connecting_prompt")) && !ast_strlen_zero(tmpstr)) {
|
||||||
|
ast_copy_string(connprompt, tmpstr, sizeof(connprompt));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Chug through config file */
|
/* Chug through config file */
|
||||||
while ((cat = ast_category_browse(cfg, cat))) {
|
while ((cat = ast_category_browse(cfg, cat))) {
|
||||||
int new = 0;
|
int new = 0;
|
||||||
@@ -1408,6 +1421,7 @@ static int app_exec(struct ast_channel *chan, const char *data)
|
|||||||
ast_copy_string(targs->plsholdprompt, f->plsholdprompt, sizeof(targs->plsholdprompt));
|
ast_copy_string(targs->plsholdprompt, f->plsholdprompt, sizeof(targs->plsholdprompt));
|
||||||
ast_copy_string(targs->statusprompt, f->statusprompt, sizeof(targs->statusprompt));
|
ast_copy_string(targs->statusprompt, f->statusprompt, sizeof(targs->statusprompt));
|
||||||
ast_copy_string(targs->sorryprompt, f->sorryprompt, sizeof(targs->sorryprompt));
|
ast_copy_string(targs->sorryprompt, f->sorryprompt, sizeof(targs->sorryprompt));
|
||||||
|
ast_copy_string(targs->connprompt, f->connprompt, sizeof(targs->connprompt));
|
||||||
/* Copy the numbers we're going to use into another list in case the master list should get modified
|
/* Copy the numbers we're going to use into another list in case the master list should get modified
|
||||||
(and locked) while we're trying to do a follow-me */
|
(and locked) while we're trying to do a follow-me */
|
||||||
AST_LIST_HEAD_INIT_NOLOCK(&targs->cnumbers);
|
AST_LIST_HEAD_INIT_NOLOCK(&targs->cnumbers);
|
||||||
@@ -1495,6 +1509,14 @@ static int app_exec(struct ast_channel *chan, const char *data)
|
|||||||
res = 0;
|
res = 0;
|
||||||
} else {
|
} else {
|
||||||
caller = chan;
|
caller = chan;
|
||||||
|
|
||||||
|
/* Play "connecting" message to the winner, if configured. */
|
||||||
|
if (!ast_strlen_zero(targs->connprompt)) {
|
||||||
|
ast_autoservice_start(caller);
|
||||||
|
ast_stream_and_wait(outbound, targs->connprompt, "");
|
||||||
|
ast_autoservice_stop(caller);
|
||||||
|
}
|
||||||
|
|
||||||
/* Bridge the two channels. */
|
/* Bridge the two channels. */
|
||||||
|
|
||||||
memset(&config, 0, sizeof(config));
|
memset(&config, 0, sizeof(config));
|
||||||
|
@@ -39,7 +39,11 @@ status_prompt=>followme/status
|
|||||||
sorry_prompt=>followme/sorry
|
sorry_prompt=>followme/sorry
|
||||||
; The global default for 'I'm sorry, but we were unable to locate your party' message.
|
; The global default for 'I'm sorry, but we were unable to locate your party' message.
|
||||||
;
|
;
|
||||||
;
|
connecting_prompt=>
|
||||||
|
; The global default sound file name for 'Please say hello to the caller' message.
|
||||||
|
; Setting to an empty string skips playing the prompt. The default is no prompt
|
||||||
|
; file name.
|
||||||
|
|
||||||
[default]
|
[default]
|
||||||
musicclass=>default
|
musicclass=>default
|
||||||
; The moh class that should be used for the caller while they are waiting to be connected.
|
; The moh class that should be used for the caller while they are waiting to be connected.
|
||||||
@@ -95,3 +99,9 @@ status_prompt=>followme/status
|
|||||||
sorry_prompt=>followme/sorry
|
sorry_prompt=>followme/sorry
|
||||||
; The 'I'm sorry, but we were unable to locate your party' message prompt. Default
|
; The 'I'm sorry, but we were unable to locate your party' message prompt. Default
|
||||||
; is the global default.
|
; is the global default.
|
||||||
|
;
|
||||||
|
connecting_prompt=>
|
||||||
|
; The sound file name for 'Please say hello to the caller' message. Default is the
|
||||||
|
; global default.
|
||||||
|
;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user