app_voicemail: Honor escape digits in "greeting only" mode

ASTERISK-21241 #close
Reported by: Eelco Brolman
Patches:
	Patch uploaded by Eelco Brolman (License 6442)

Change-Id: Icbe39b5c82a49b46cf1d168dc17766f3d84f54fe
certified/13.18
Sean Bright 8 years ago
parent 71753d67f4
commit 0af145de2d

@ -6490,6 +6490,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
int ausemacro = 0; int ausemacro = 0;
int ousemacro = 0; int ousemacro = 0;
int ouseexten = 0; int ouseexten = 0;
int greeting_only = 0;
char tmpdur[16]; char tmpdur[16];
char priority[16]; char priority[16];
char origtime[16]; char origtime[16];
@ -6549,6 +6550,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
ast_free(tmp); ast_free(tmp);
return res; 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 */ /* Setup pre-file if appropriate */
if (strcmp(vmu->context, "default")) if (strcmp(vmu->context, "default"))
snprintf(ext_context, sizeof(ext_context), "%s@%s", ext, vmu->context); 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); ast_set_flag(options, OPT_SILENT);
res = 0; 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)) { if (!res && !ast_test_flag(options, OPT_SILENT)) {
res = ast_stream_and_wait(chan, INTRO, ecodes); res = ast_stream_and_wait(chan, INTRO, ecodes);
if (res == '#') { if (res == '#') {
@ -6734,6 +6736,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
return res; 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) { if (res < 0) {
free_user(vmu); free_user(vmu);
pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED"); pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED");

Loading…
Cancel
Save