aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-12 04:13:48 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-12-12 04:13:48 +0000
commit6961fd05a32e95e633100e02102a7b00b05f6804 (patch)
treee134b5dd31ae4649d82ab39e462bcf030465ad88
parentb0a1dc91600c6001e99bd53648d130e5463f18d8 (diff)
Use S_OR in my previous app_voicemail. This is the way it should have been done.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48401 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 3692ca44c..cc063de2b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2407,7 +2407,7 @@ static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, i
ast_log(LOG_WARNING, "Unable to store '%s' (can't create temporary file)\n", fn);
return -1;
} else {
- make_email_file(p, myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, (!ast_strlen_zero(chan->cid.cid_num) ? chan->cid.cid_num : NULL), (!ast_strlen_zero(chan->cid.cid_name) ? chan->cid.cid_name : NULL), fn, fmt, duration, 1, chan, NULL, 1);
+ make_email_file(p, myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), fn, fmt, duration, 1, chan, NULL, 1);
/* read mail file to memory */
len = ftell(p);
rewind(p);
@@ -2641,7 +2641,7 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i
ast_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
}
ast_unlock_path(todir);
- notify_new_message(chan, recip, recipmsgnum, duration, fmt, (!ast_strlen_zero(chan->cid.cid_num) ? chan->cid.cid_num : NULL), (!ast_strlen_zero(chan->cid.cid_name) ? chan->cid.cid_name : NULL));
+ notify_new_message(chan, recip, recipmsgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
return 0;
}
@@ -3058,7 +3058,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
chan->exten,
chan->priority,
chan->name,
- ast_callerid_merge(callerid, sizeof(callerid), (!ast_strlen_zero(chan->cid.cid_name) ? chan->cid.cid_name : NULL), (!ast_strlen_zero(chan->cid.cid_num) ? chan->cid.cid_num : NULL), "Unknown"),
+ ast_callerid_merge(callerid, sizeof(callerid), S_OR(chan->cid.cid_name, NULL), S_OR(chan->cid.cid_num, NULL), "Unknown"),
date, (long)time(NULL),
category ? category : "");
} else
@@ -3124,7 +3124,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
#endif
if (ast_fileexists(fn, NULL, NULL)) {
STORE(dir, vmu->mailbox, vmu->context, msgnum, chan, vmu, fmt, duration, vms);
- notify_new_message(chan, vmu, msgnum, duration, fmt, (!ast_strlen_zero(chan->cid.cid_num) ? chan->cid.cid_num : NULL), (!ast_strlen_zero(chan->cid.cid_name) ? chan->cid.cid_name : NULL));
+ notify_new_message(chan, vmu, msgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
DISPOSE(dir, msgnum);
}
}
@@ -4117,7 +4117,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
int attach_user_voicemail = ast_test_flag((&globalflags), VM_ATTACH);
attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
/* NULL category for IMAP storage */
- sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, (!ast_strlen_zero(chan->cid.cid_num) ? chan->cid.cid_num : NULL), (!ast_strlen_zero(chan->cid.cid_name) ? chan->cid.cid_name : NULL), vms->fn, fmt, duration, attach_user_voicemail, chan, NULL);
+ sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vms->fn, fmt, duration, attach_user_voicemail, chan, NULL);
#else
copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
#endif