diff options
author | Joshua Colp <jcolp@digium.com> | 2017-08-25 08:28:11 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-08-25 08:28:11 -0500 |
commit | 7c9ab297dff1a8ab305b3a9e9b76928012afb4c6 (patch) | |
tree | 6f8e2bfc0d43e0ef8c180f5a2fc00c0fe757c639 | |
parent | 7937d5b8b3f4c5ccac64e0646afb46448e1db63c (diff) | |
parent | b1097be13432dddd351c63d87525ed1ec115de86 (diff) |
Merge "app_voicemail: Honor escape digits in "greeting only" mode"
-rw-r--r-- | apps/app_voicemail.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 5f8212859..f1b8bd1e1 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -6488,6 +6488,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ int ausemacro = 0; int ousemacro = 0; int ouseexten = 0; + int greeting_only = 0; char tmpdur[16]; char priority[16]; char origtime[16]; @@ -6547,6 +6548,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ ast_free(tmp); return res; } + + /* If maxmsg is zero, act as a "greetings only" voicemail: Exit successfully without recording */ + if (vmu->maxmsg == 0) { + greeting_only = 1; + ast_set_flag(options, OPT_SILENT); + } + /* Setup pre-file if appropriate */ if (strcmp(vmu->context, "default")) snprintf(ext_context, sizeof(ext_context), "%s@%s", ext, vmu->context); @@ -6671,12 +6679,6 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ ast_set_flag(options, OPT_SILENT); res = 0; } - /* If maxmsg is zero, act as a "greetings only" voicemail: Exit successfully without recording */ - if (vmu->maxmsg == 0) { - ast_debug(3, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n"); - pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS"); - goto leave_vm_out; - } if (!res && !ast_test_flag(options, OPT_SILENT)) { res = ast_stream_and_wait(chan, INTRO, ecodes); if (res == '#') { @@ -6732,6 +6734,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ return res; } + if (greeting_only) { + ast_debug(3, "Greetings only VM (maxmsg=0), Skipping voicemail recording\n"); + pbx_builtin_setvar_helper(chan, "VMSTATUS", "SUCCESS"); + res = 0; + goto leave_vm_out; + } + if (res < 0) { free_user(vmu); pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED"); |