summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-08-25 08:12:26 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-08-25 08:12:26 -0500
commitc0251ae004815ee8d4925db5e78c89d99d29272b (patch)
tree8f86cdf3a45f8d72e7059a5b94de76716780b013 /apps
parentd251a961ace674218488e6a906a874d2ef2212c1 (diff)
parent0af145de2dba865abf446324672503c7dd8acafc (diff)
Merge "app_voicemail: Honor escape digits in "greeting only" mode" into 13
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 943a883f6..58b4e64a4 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6490,6 +6490,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];
@@ -6549,6 +6550,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);
@@ -6673,12 +6681,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 == '#') {
@@ -6734,6 +6736,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");