[asterisk-commits] app voicemail: Allow 'Comedian Mail' branding to be overriden (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 14 17:42:08 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/4942 )

Change subject: app_voicemail: Allow 'Comedian Mail' branding to be overriden
......................................................................


app_voicemail: Allow 'Comedian Mail' branding to be overriden

Original patch by John Covert, slight modifications by me.

ASTERISK-17428 #close
Reported by: John Covert
Patches:
	app_voicemail.c.patch (license #5512) patch uploaded by
        John Covert

Change-Id: Ic3361b0782e5a5397a19ab18eb8550923a9bd6a6
---
M CHANGES
M apps/app_voicemail.c
M configs/samples/voicemail.conf.sample
3 files changed, 22 insertions(+), 4 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/CHANGES b/CHANGES
index 79a1840..fafaa21 100644
--- a/CHANGES
+++ b/CHANGES
@@ -88,6 +88,11 @@
  * Added new 'u' option to Record() application which prevents Asterisk from
    truncating silence from the end of recorded files.
 
+app_voicemail
+------------------
+ * The 'Comedian Mail' prompts can now be overriden using the 'vm-login' and
+   'vm-newuser' configuration options in voicemail.conf.
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 14.2.0 to Asterisk 14.3.0 ------------
 ------------------------------------------------------------------------------
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 3016f65..af9ffef 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1034,6 +1034,8 @@
 static char listen_control_stop_key[12];
 
 /* custom password sounds */
+static char vm_login[80] = "vm-login";
+static char vm_newuser[80] = "vm-newuser";
 static char vm_password[80] = "vm-password";
 static char vm_newpassword[80] = "vm-newpassword";
 static char vm_passchanged[80] = "vm-passchanged";
@@ -10483,7 +10485,7 @@
 }
 
 
-static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain)
+static int vm_newuser_setup(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain)
 {
 	int cmd = 0;
 	int duration = 0;
@@ -11073,7 +11075,7 @@
 	adsi_begin(chan, &useadsi);
 	if (!skipuser && useadsi)
 		adsi_login(chan);
-	if (!silent && !skipuser && ast_streamfile(chan, "vm-login", ast_channel_language(chan))) {
+	if (!silent && !skipuser && ast_streamfile(chan, vm_login, ast_channel_language(chan))) {
 		ast_log(AST_LOG_WARNING, "Couldn't stream login file\n");
 		return -1;
 	}
@@ -11570,9 +11572,9 @@
 	/* Check to see if this is a new user */
 	if (!strcasecmp(vmu->mailbox, vmu->password) && 
 		(ast_test_flag(vmu, VM_FORCENAME | VM_FORCEGREET))) {
-		if (ast_play_and_wait(chan, "vm-newuser") == -1)
+		if (ast_play_and_wait(chan, vm_newuser) == -1)
 			ast_log(AST_LOG_WARNING, "Couldn't stream new user file\n");
-		cmd = vm_newuser(chan, vmu, &vms, vmfmts, record_gain);
+		cmd = vm_newuser_setup(chan, vmu, &vms, vmfmts, record_gain);
 		if ((cmd == 't') || (cmd == '#')) {
 			/* Timeout */
 			ast_test_suite_event_notify("TIMEOUT", "Message: response from user timed out");
@@ -13989,6 +13991,10 @@
 		}
 
 		/* load password sounds configuration */
+		if ((val = ast_variable_retrieve(cfg, "general", "vm-login")))
+			ast_copy_string(vm_login, val, sizeof(vm_login));
+		if ((val = ast_variable_retrieve(cfg, "general", "vm-newuser")))
+			ast_copy_string(vm_newuser, val, sizeof(vm_newuser));
 		if ((val = ast_variable_retrieve(cfg, "general", "vm-password")))
 			ast_copy_string(vm_password, val, sizeof(vm_password));
 		if ((val = ast_variable_retrieve(cfg, "general", "vm-newpassword")))
diff --git a/configs/samples/voicemail.conf.sample b/configs/samples/voicemail.conf.sample
index 248e142..1c91ffb 100644
--- a/configs/samples/voicemail.conf.sample
+++ b/configs/samples/voicemail.conf.sample
@@ -333,6 +333,13 @@
                     ; The default is "no".
 ; minpassword=0 ; Enforce minimum password length
 
+; vm-login=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "Comedian Mail. Mailbox?"
+; vm-newuser=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "Welcome to Comedian Mail. First, I will
+			;     guide you through a short setup process."
 ; vm-password=custom_sound
 			;     Customize which sound file is used instead of the default
 			;     prompt that says: "password"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3361b0782e5a5397a19ab18eb8550923a9bd6a6
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list