aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 12:17:25 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 12:17:25 +0000
commit8abb5a32f2e1226a24279c81b71cbd63456aad34 (patch)
tree3131c75cfb53e67d818bbffbc481980291d995e5
parente297382a9ec2a86397cfc6460695c0685484eaea (diff)
fix indentation of two large blocks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26416 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c202
1 files changed, 101 insertions, 101 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a6b371709..9b3d2ad27 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -6767,84 +6767,84 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
if (ast_strlen_zero(cid))
break;
- ast_callerid_parse(cid, &name, &num);
- while ((res > -1) && (res != 't')) {
- switch(res) {
- case '1':
- if (num) {
- /* Dial the CID number */
- res = dialout(chan, vmu, num, vmu->callback);
- if (res)
- return 9;
- } else {
- res = '2';
- }
- break;
+ ast_callerid_parse(cid, &name, &num);
+ while ((res > -1) && (res != 't')) {
+ switch(res) {
+ case '1':
+ if (num) {
+ /* Dial the CID number */
+ res = dialout(chan, vmu, num, vmu->callback);
+ if (res)
+ return 9;
+ } else {
+ res = '2';
+ }
+ break;
- case '2':
- /* Want to enter a different number, can only do this if there's a dialout context for this user */
- if (!ast_strlen_zero(vmu->dialout)) {
- res = dialout(chan, vmu, NULL, vmu->dialout);
- if (res)
- return 9;
- } else {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
- res = ast_play_and_wait(chan, "vm-sorry");
- }
- return res;
- case '*':
- res = 't';
- break;
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case '0':
-
- res = ast_play_and_wait(chan, "vm-sorry");
- retries++;
- break;
- default:
- if (num) {
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
- res = ast_play_and_wait(chan, "vm-num-i-have");
- if (!res)
- res = play_message_callerid(chan, vms, num, vmu->context, 1);
- if (!res)
- res = ast_play_and_wait(chan, "vm-tocallnum");
- /* Only prompt for a caller-specified number if there is a dialout context specified */
- if (!ast_strlen_zero(vmu->dialout)) {
- if (!res)
- res = ast_play_and_wait(chan, "vm-calldiffnum");
- }
- } else {
- res = ast_play_and_wait(chan, "vm-nonumber");
- if (!ast_strlen_zero(vmu->dialout)) {
- if (!res)
- res = ast_play_and_wait(chan, "vm-toenternumber");
- }
- }
- if (!res)
- res = ast_play_and_wait(chan, "vm-star-cancel");
+ case '2':
+ /* Want to enter a different number, can only do this if there's a dialout context for this user */
+ if (!ast_strlen_zero(vmu->dialout)) {
+ res = dialout(chan, vmu, NULL, vmu->dialout);
+ if (res)
+ return 9;
+ } else {
+ if (option_verbose > 2)
+ ast_verbose( VERBOSE_PREFIX_3 "Caller can not specify callback number - no dialout context available\n");
+ res = ast_play_and_wait(chan, "vm-sorry");
+ }
+ return res;
+ case '*':
+ res = 't';
+ break;
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '0':
+
+ res = ast_play_and_wait(chan, "vm-sorry");
+ retries++;
+ break;
+ default:
+ if (num) {
+ if (option_verbose > 2)
+ ast_verbose( VERBOSE_PREFIX_3 "Confirm CID number '%s' is number to use for callback\n", num);
+ res = ast_play_and_wait(chan, "vm-num-i-have");
+ if (!res)
+ res = play_message_callerid(chan, vms, num, vmu->context, 1);
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-tocallnum");
+ /* Only prompt for a caller-specified number if there is a dialout context specified */
+ if (!ast_strlen_zero(vmu->dialout)) {
if (!res)
- res = ast_waitfordigit(chan, 6000);
+ res = ast_play_and_wait(chan, "vm-calldiffnum");
+ }
+ } else {
+ res = ast_play_and_wait(chan, "vm-nonumber");
+ if (!ast_strlen_zero(vmu->dialout)) {
if (!res)
- retries++;
- if (retries > 3)
- res = 't';
- break;
-
+ res = ast_play_and_wait(chan, "vm-toenternumber");
}
- if (res == 't')
- res = 0;
- else if (res == '*')
- res = -1;
}
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-star-cancel");
+ if (!res)
+ res = ast_waitfordigit(chan, 6000);
+ if (!res)
+ retries++;
+ if (retries > 3)
+ res = 't';
+ break;
+
+ }
+ if (res == 't')
+ res = 0;
+ else if (res == '*')
+ res = -1;
+ }
break;
case 1: /* Reply */
@@ -6852,38 +6852,38 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
if (ast_strlen_zero(cid))
break;
- ast_callerid_parse(cid, &name, &num);
- if (!num) {
+ ast_callerid_parse(cid, &name, &num);
+ if (!num) {
+ if (option_verbose > 2)
+ ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
+ if (!res)
+ res = ast_play_and_wait(chan, "vm-nonumber");
+ return res;
+ } else {
+ if (find_user(NULL, vmu->context, num)) {
+ struct leave_vm_options leave_options;
+ char mailbox[AST_MAX_EXTENSION * 2 + 2];
+ snprintf(mailbox, sizeof(mailbox), "%s@%s", num, vmu->context);
+
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "No CID number available, no reply sent\n");
+ ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
+
+ memset(&leave_options, 0, sizeof(leave_options));
+ leave_options.record_gain = record_gain;
+ res = leave_voicemail(chan, mailbox, &leave_options);
if (!res)
- res = ast_play_and_wait(chan, "vm-nonumber");
+ res = 't';
return res;
} else {
- if (find_user(NULL, vmu->context, num)) {
- struct leave_vm_options leave_options;
- char mailbox[AST_MAX_EXTENSION * 2 + 2];
- snprintf(mailbox, sizeof(mailbox), "%s@%s", num, vmu->context);
-
- if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Leaving voicemail for '%s' in context '%s'\n", num, vmu->context);
-
- memset(&leave_options, 0, sizeof(leave_options));
- leave_options.record_gain = record_gain;
- res = leave_voicemail(chan, mailbox, &leave_options);
- if (!res)
- res = 't';
- return res;
- } else {
- /* Sender has no mailbox, can't reply */
- if (option_verbose > 2)
- ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
- ast_play_and_wait(chan, "vm-nobox");
- res = 't';
- return res;
- }
- }
- res = 0;
+ /* Sender has no mailbox, can't reply */
+ if (option_verbose > 2)
+ ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
+ ast_play_and_wait(chan, "vm-nobox");
+ res = 't';
+ return res;
+ }
+ }
+ res = 0;
break;
}