mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
Formatting cleanup in app_voicemail.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -608,6 +608,7 @@ static void vm_change_password(struct ast_vm_user *vmu, char *newpassword)
|
||||
char tmpout[AST_CONFIG_MAX_PATH];
|
||||
char *user, *pass, *rest, *trim, *tempcontext;
|
||||
struct stat statbuf;
|
||||
|
||||
tempcontext = NULL;
|
||||
snprintf(tmpin, sizeof(tmpin), "%s/voicemail.conf", ast_config_AST_CONFIG_DIR);
|
||||
snprintf(tmpout, sizeof(tmpout), "%s/voicemail.conf.new", ast_config_AST_CONFIG_DIR);
|
||||
@@ -646,8 +647,7 @@ static void vm_change_password(struct ast_vm_user *vmu, char *newpassword)
|
||||
/* check for '[' (opening of context name ) */
|
||||
tempcontext = strchr(user, '[');
|
||||
if (tempcontext) {
|
||||
strncpy(currcontext, tempcontext +1,
|
||||
sizeof(currcontext) - 1);
|
||||
strncpy(currcontext, tempcontext +1, sizeof(currcontext) - 1);
|
||||
/* now check for ']' */
|
||||
tempcontext = strchr(currcontext, ']');
|
||||
if (tempcontext)
|
||||
@@ -751,9 +751,10 @@ inbuf(struct baseio *bio, FILE *fi)
|
||||
static int
|
||||
inchar(struct baseio *bio, FILE *fi)
|
||||
{
|
||||
if(bio->iocp>=bio->iolen)
|
||||
if (bio->iocp>=bio->iolen) {
|
||||
if (!inbuf(bio, fi))
|
||||
return EOF;
|
||||
}
|
||||
|
||||
return bio->iobuf[bio->iocp++];
|
||||
}
|
||||
@@ -957,13 +958,10 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *m
|
||||
ast_channel_free(ast);
|
||||
} else ast_log(LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
|
||||
} else
|
||||
if( *emailtitle)
|
||||
{
|
||||
if (*emailtitle) {
|
||||
fprintf(p, emailtitle, msgnum + 1, mailbox) ;
|
||||
fprintf(p,"\n") ;
|
||||
}
|
||||
else
|
||||
if (pbxskip)
|
||||
} else if (pbxskip)
|
||||
fprintf(p, "Subject: New message %d in mailbox %s\n", msgnum + 1, mailbox);
|
||||
else
|
||||
fprintf(p, "Subject: [PBX]: New message %d in mailbox %s\n", msgnum + 1, mailbox);
|
||||
@@ -2281,13 +2279,11 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
|
||||
if (!extensions || !valid_extensions)
|
||||
return res;
|
||||
vmtmp = extensions;
|
||||
if(flag==1)/*Send VoiceMail*/
|
||||
{
|
||||
if (flag==1) {
|
||||
/* Send VoiceMail */
|
||||
cmd=leave_voicemail(chan,username,0,0,0);
|
||||
}
|
||||
|
||||
else /*Forward VoiceMail*/
|
||||
{
|
||||
} else {
|
||||
/* Forward VoiceMail */
|
||||
cmd = vm_forwardoptions(chan, sender, dir, curmsg, vmfmts, context);
|
||||
if (!cmd) {
|
||||
while (!res && vmtmp) {
|
||||
@@ -2498,8 +2494,7 @@ static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms,
|
||||
res = wait_file2(chan, vms, "vm-from-phonenumber");
|
||||
res = ast_say_digit_str(chan, callerid, AST_DIGIT_ANY, chan->language);
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
/* Number unknown */
|
||||
ast_log(LOG_DEBUG, "VM-CID: From an unknown number");
|
||||
if (!res)
|
||||
@@ -3040,8 +3035,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
|
||||
char buf[256];
|
||||
int bytes=0;
|
||||
|
||||
if (adsi_available(chan))
|
||||
{
|
||||
if (adsi_available(chan)) {
|
||||
bytes += adsi_logo(buf + bytes);
|
||||
bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 3, ADSI_JUST_CENT, 0, "New User Setup", "");
|
||||
bytes += adsi_display(buf + bytes, ADSI_COMM_PAGE, 4, ADSI_JUST_CENT, 0, "Not Done", "");
|
||||
@@ -4159,7 +4153,8 @@ static int load_config(void)
|
||||
|
||||
calloper = 0;
|
||||
if (!(astcallop = ast_variable_retrieve(cfg, "general", "operator"))){
|
||||
ast_log(LOG_DEBUG,"VM Operator break disabled globally\n"); astcallop = "no";
|
||||
ast_log(LOG_DEBUG,"VM Operator break disabled globally\n");
|
||||
astcallop = "no";
|
||||
}
|
||||
calloper = ast_true(astcallop);
|
||||
|
||||
@@ -4612,10 +4607,9 @@ static int advanced_options(struct ast_channel *chan, struct ast_vm_user *vmu, s
|
||||
leave_voicemail(chan, num, 1, 0, 1);
|
||||
res = 't';
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
ast_verbose( VERBOSE_PREFIX_3 "No mailbox number '%s' in context '%s', no reply sent\n", num, vmu->context);
|
||||
} else {
|
||||
/* Sender has no mailbox, can't reply */
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user