[asterisk-commits] app voicemail: Honor escape digits in "greeting only" mode (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 25 08:28:11 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6288 )

Change subject: app_voicemail: Honor escape digits in "greeting only" mode
......................................................................

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
---
M apps/app_voicemail.c
1 file changed, 15 insertions(+), 6 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Joshua Colp: Approved for Submit



diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 5f82128..f1b8bd1 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6488,6 +6488,7 @@
 	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 @@
 		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 @@
 		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 @@
 		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");

-- 
To view, visit https://gerrit.asterisk.org/6288
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icbe39b5c82a49b46cf1d168dc17766f3d84f54fe
Gerrit-Change-Number: 6288
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170825/42422196/attachment-0001.html>


More information about the asterisk-commits mailing list