aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 10:10:03 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 10:10:03 +0000
commit0b9d26e5a1e6872ef5c3153bc4e23be3cdf0c62d (patch)
tree8f9600f617dfa23c3319709b79048e07be982a95 /apps
parent9e8603c06dc57ac8be815bb92a152ad5aa175f23 (diff)
use 'switch' insteaf of multiple 'if'
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26345 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 063eff45b..884cbdd88 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6192,7 +6192,7 @@ static int load_config(void)
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 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
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';
+ break;
- } else if (option == 2) { /* Call back */
+ case 2: /* Call back */
if (!ast_strlen_zero(cid)) {
ast_callerid_parse(cid, &name, &num);
@@ -6843,9 +6844,9 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
res = -1;
}
}
+ break;
- }
- else if (option == 1) { /* Reply */
+ case 1: /* Reply */
/* Send reply directly to sender */
if (!ast_strlen_zero(cid)) {
ast_callerid_parse(cid, &name, &num);
@@ -6881,6 +6882,7 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
}
res = 0;
}
+ break;
}
ast_config_destroy(msg_cfg);