[svn-commits] russell: trunk r46360 - in /trunk: ./ apps/ configs/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Oct 27 09:47:45 MST 2006


Author: russell
Date: Fri Oct 27 11:47:44 2006
New Revision: 46360

URL: http://svn.digium.com/view/asterisk?rev=46360&view=rev
Log:
Add the ability to customize some of the prompts used within the voicemail
application by configuring them in voicemail.conf (issue #7415, patch by
fkasumovic, with some fixes and documentation updates by myself)

Modified:
    trunk/CHANGES
    trunk/apps/app_voicemail.c
    trunk/configs/voicemail.conf.sample

Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?rev=46360&r1=46359&r2=46360&view=diff
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Fri Oct 27 11:47:44 2006
@@ -1,7 +1,9 @@
 Changes since Asterisk 1.4-beta was branched:
-  * rev.45982: enable https support for builtin web server.
+  * Added the ability to customize which sound files are used for some of the
+    prompts within the Voicemail application by changing them in voicemail.conf
+  * enable https support for builtin web server.
      See configs/http.conf.sample for details.
-  * rev.45945: add a new option, match_auth_username, to sip.conf,
+  * add a new option, match_auth_username, to sip.conf,
      to improve the matching of incoming requests.
      If set, and the incoming request carries authentication info,
      the username to match in the users list is taken from there

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=46360&r1=46359&r2=46360&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri Oct 27 11:47:44 2006
@@ -505,6 +505,13 @@
 static int maxgreet;
 static int skipms;
 static int maxlogins;
+
+/* cutom password sounds */
+static char vm_password[80] = "vm-password";
+static char vm_newpassword[80] = "vm-newpassword";
+static char vm_passchanged[80] = "vm-passchanged";
+static char vm_reenterpassword[80] = "vm-reenterpassword";
+static char vm_mismatch[80] = "vm-mismatch";
 
 static struct ast_flags globalflags = {0};
 
@@ -5471,7 +5478,7 @@
 	   so they won't get here again */
 	for (;;) {
 		newpassword[1] = '\0';
-		newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword");
+		newpassword[0] = cmd = ast_play_and_wait(chan, vm_newpassword);
 		if (cmd == '#')
 			newpassword[0] = '\0';
 		if (cmd < 0 || cmd == 't' || cmd == '#')
@@ -5480,7 +5487,7 @@
 		if (cmd < 0 || cmd == 't' || cmd == '#')
 			return cmd;
 		newpassword2[1] = '\0';
-		newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword");
+		newpassword2[0] = cmd = ast_play_and_wait(chan, vm_reenterpassword);
 		if (cmd == '#')
 			newpassword2[0] = '\0';
 		if (cmd < 0 || cmd == 't' || cmd == '#')
@@ -5491,7 +5498,7 @@
 		if (!strcmp(newpassword, newpassword2))
 			break;
 		ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2);
-		cmd = ast_play_and_wait(chan, "vm-mismatch");
+		cmd = ast_play_and_wait(chan, vm_mismatch);
 		if (++tries == 3)
 			return -1;
 	}
@@ -5501,7 +5508,7 @@
 		vm_change_password_shell(vmu,newpassword);
 	if (option_debug)
 		ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
-	cmd = ast_play_and_wait(chan,"vm-passchanged");
+	cmd = ast_play_and_wait(chan, vm_passchanged);
 
 	/* If forcename is set, have the user record their name */	
 	if (ast_test_flag(vmu, VM_FORCENAME)) {
@@ -5571,7 +5578,7 @@
 				break;
 			}
 			newpassword[1] = '\0';
-			newpassword[0] = cmd = ast_play_and_wait(chan,"vm-newpassword");
+			newpassword[0] = cmd = ast_play_and_wait(chan, vm_newpassword);
 			if (cmd == '#')
 				newpassword[0] = '\0';
 			else {
@@ -5582,7 +5589,7 @@
 				}
 			}
 			newpassword2[1] = '\0';
-			newpassword2[0] = cmd = ast_play_and_wait(chan,"vm-reenterpassword");
+			newpassword2[0] = cmd = ast_play_and_wait(chan, vm_reenterpassword);
 			if (cmd == '#')
 				newpassword2[0] = '\0';
 			else {
@@ -5595,7 +5602,7 @@
 			}
 			if (strcmp(newpassword, newpassword2)) {
 				ast_log(LOG_NOTICE,"Password mismatch for user %s (%s != %s)\n", vms->username, newpassword, newpassword2);
-				cmd = ast_play_and_wait(chan, "vm-mismatch");
+				cmd = ast_play_and_wait(chan, vm_mismatch);
 				break;
 			}
 			if (ast_strlen_zero(ext_pass_cmd)) 
@@ -5604,7 +5611,7 @@
 				vm_change_password_shell(vmu,newpassword);
 			if (option_debug)
 				ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
-			cmd = ast_play_and_wait(chan,"vm-passchanged");
+			cmd = ast_play_and_wait(chan, vm_passchanged);
 			break;
 		case '*': 
 			cmd = 't';
@@ -5854,7 +5861,7 @@
 			/* saved password is blank, so don't bother asking */
 			password[0] = '\0';
 		} else {
-			if (ast_streamfile(chan, "vm-password", chan->language)) {
+			if (ast_streamfile(chan, vm_password, chan->language)) {
 				ast_log(LOG_WARNING, "Unable to stream password file\n");
 				return -1;
 			}
@@ -6844,6 +6851,11 @@
 	const char *extpc;
 	const char *emaildateformatstr;
 	const char *volgainstr;
+	const char *vm_paswd;
+	const char *vm_newpasswd;
+	const char *vm_passchange;
+	const char *vm_reenterpass;
+	const char *vm_mism;
 	int x;
 	int tmpadsi[4];
 
@@ -7167,6 +7179,18 @@
 		} else {
 			exitcontext[0] = '\0';
 		}
+		
+		/* load password sounds configuration */
+		if ((vm_paswd = ast_variable_retrieve(cfg, "general", "vm-password")))
+			ast_copy_string(vm_password, vm_paswd, sizeof(vm_password));
+		if ((vm_newpasswd = ast_variable_retrieve(cfg, "general", "vm-newpassword")))
+			ast_copy_string(vm_newpassword, vm_newpasswd, sizeof(vm_newpassword));
+		if ((vm_passchange = ast_variable_retrieve(cfg, "general", "vm-passchanged")))
+			ast_copy_string(vm_passchanged, vm_passchange, sizeof(vm_passchanged));
+		if ((vm_reenterpass = ast_variable_retrieve(cfg, "general", "vm-reenterpassword")))
+			ast_copy_string(vm_reenterpassword, vm_reenterpass, sizeof(vm_reenterpassword));
+		if ((vm_mism = ast_variable_retrieve(cfg, "general", "vm-mismatch")))
+			ast_copy_string(vm_mismatch, vm_mism, sizeof(vm_mismatch));
 
 		if (!(astdirfwd = ast_variable_retrieve(cfg, "general", "usedirectory"))) 
 			astdirfwd = "no";

Modified: trunk/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/voicemail.conf.sample?rev=46360&r1=46359&r2=46360&view=diff
==============================================================================
--- trunk/configs/voicemail.conf.sample (original)
+++ trunk/configs/voicemail.conf.sample Fri Oct 27 11:47:44 2006
@@ -203,7 +203,25 @@
 			;     greetings.  The default is "no".
 ; hidefromdir=yes	; Hide this mailbox from the directory produced by app_directory
 			;     The default is "no".
-;tempgreetwarn=yes	; Remind the user that their temporary greeting is set
+; tempgreetwarn=yes	; Remind the user that their temporary greeting is set
+; vm-password=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "password"
+; vm-newpassword=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "Please enter your new password followed by
+			;     the pound key."
+; vm-passchanged=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "Your password has been changed."
+; vm-reenterpassword=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "Please re-enter your password followed by
+			;     the pound key"
+; vm-mismatch=custom_sound
+			;     Customize which sound file is used instead of the default
+			;     prompt that says: "The passwords you entered and re-entered
+			;     did not match.  Please try again."
 
 [zonemessages]
 eastern=America/New_York|'vm-received' Q 'digits/at' IMp



More information about the svn-commits mailing list