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, chan->cid.cid_num, chan->cid.cid_name, fn, fmt, duration, 1, chan, NULL, 1);
+ 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);
/* read mail file to memory */
len = ftell(p);
rewind(p);
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, chan->cid.cid_num, chan->cid.cid_name);
+ 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));
return 0;
}
chan->exten,
chan->priority,
chan->name,
- ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num, "Unknown"),
+ 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"),
date, (long)time(NULL),
category ? category : "");
} else
#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, chan->cid.cid_num, chan->cid.cid_name);
+ 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));
DISPOSE(dir, msgnum);
}
}
STORE(todir, vmtmp->mailbox, vmtmp->context, vms->curmsg, chan, vmtmp, fmt, duration, vms);
- char *myserveremail = serveremail;
- if (!ast_strlen_zero(vmtmp->serveremail))
- myserveremail = vmtmp->serveremail;
- 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, chan->cid.cid_num, chan->cid.cid_name, vms->fn, fmt, duration, attach_user_voicemail, chan, NULL);
+ char *myserveremail = serveremail;
+ if (!ast_strlen_zero(vmtmp->serveremail))
+ myserveremail = vmtmp->serveremail;
+ 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);
+
#else
copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
#endif