[asterisk-commits] file: trunk r48402 - in /trunk: ./
apps/app_voicemail.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Dec 11 21:14:51 MST 2006
Author: file
Date: Mon Dec 11 22:14:50 2006
New Revision: 48402
URL: http://svn.digium.com/view/asterisk?view=rev&rev=48402
Log:
Merged revisions 48401 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r48401 | file | 2006-12-11 23:13:48 -0500 (Mon, 11 Dec 2006) | 2 lines
Use S_OR in my previous app_voicemail. This is the way it should have been done.
........
Modified:
trunk/ (props changed)
trunk/apps/app_voicemail.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=48402&r1=48401&r2=48402
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Dec 11 22:14:50 2006
@@ -2428,7 +2428,7 @@
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);
@@ -2658,7 +2658,7 @@
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;
}
@@ -3080,7 +3080,7 @@
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
@@ -3142,7 +3142,7 @@
#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);
}
}
@@ -4135,7 +4135,7 @@
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);
More information about the asterisk-commits
mailing list