[asterisk-commits] trunk r26345 - /trunk/apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 10 03:10:03 MST 2006


Author: rizzo
Date: Wed May 10 05:10:03 2006
New Revision: 26345

URL: http://svn.digium.com/view/asterisk?rev=26345&view=rev
Log:
use 'switch' insteaf of multiple 'if'


Modified:
    trunk/apps/app_voicemail.c

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=26345&r1=26344&r2=26345&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed May 10 05:10:03 2006
@@ -6192,7 +6192,7 @@
 
 	AST_LIST_LOCK(&users);
 	while ((cur = AST_LIST_REMOVE_HEAD(&users, list))) {
-		ast_set_flag(cur, VM_ALLOCED);	
+		ast_set_flag(cur, VM_ALLOCED);
 		free_user(cur);
 	}
 
@@ -6752,16 +6752,17 @@
 	if (!strncasecmp("macro",context,5)) /* Macro names in contexts are useless for our needs */
 		context = ast_variable_retrieve(msg_cfg, "message","macrocontext");
 
-	if (option == 3) {
-
+	switch (option) {
+	case 3:
 		if (!res)
 			res = play_message_datetime(chan, vmu, origtime, filename);
 		if (!res)
 			res = play_message_callerid(chan, vms, cid, context, 0);
 
 		res = 't';
-
-	} else if (option == 2) { /* Call back */
+		break;
+
+	case 2:	/* Call back */
 
 		if (!ast_strlen_zero(cid)) {
 			ast_callerid_parse(cid, &name, &num);
@@ -6843,9 +6844,9 @@
 						res = -1;
 				}
 			}
-
-	}
-	else if (option == 1) { /* Reply */
+		break;
+
+	case 1:	/* Reply */
 		/* Send reply directly to sender */
 		if (!ast_strlen_zero(cid)) {
 			ast_callerid_parse(cid, &name, &num);
@@ -6881,6 +6882,7 @@
 			} 
 			res = 0;
 		}
+		break;
 	}
 
 	ast_config_destroy(msg_cfg);



More information about the asterisk-commits mailing list