Merged revisions 48391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r48391 | file | 2006-12-11 16:31:23 -0500 (Mon, 11 Dec 2006) | 2 lines Return non-existant callerid handling to that which it was before. In 1.4 and trunk callerid can be allocated but not have any contents so we have to use ast_strlen_zero before passing it to the relevant functions. (issue #8567 reported by pabelanger) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
d45644b3ce
commit
c393e8f664
1 changed files with 12 additions and 11 deletions
|
@ -2428,7 +2428,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);
|
ast_log(LOG_WARNING, "Unable to store '%s' (can't create temporary file)\n", fn);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} 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 */
|
/* read mail file to memory */
|
||||||
len = ftell(p);
|
len = ftell(p);
|
||||||
rewind(p);
|
rewind(p);
|
||||||
|
@ -2658,7 +2658,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_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
|
||||||
}
|
}
|
||||||
ast_unlock_path(todir);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3080,7 +3080,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
|
||||||
chan->exten,
|
chan->exten,
|
||||||
chan->priority,
|
chan->priority,
|
||||||
chan->name,
|
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),
|
date, (long)time(NULL),
|
||||||
category ? category : "");
|
category ? category : "");
|
||||||
} else
|
} else
|
||||||
|
@ -3142,7 +3142,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
|
||||||
#endif
|
#endif
|
||||||
if (ast_fileexists(fn, NULL, NULL)) {
|
if (ast_fileexists(fn, NULL, NULL)) {
|
||||||
STORE(dir, vmu->mailbox, vmu->context, msgnum, chan, vmu, fmt, duration, vms);
|
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);
|
DISPOSE(dir, msgnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4129,13 +4129,14 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
|
||||||
|
|
||||||
STORE(todir, vmtmp->mailbox, vmtmp->context, vms->curmsg, chan, vmtmp, fmt, duration, vms);
|
STORE(todir, vmtmp->mailbox, vmtmp->context, vms->curmsg, chan, vmtmp, fmt, duration, vms);
|
||||||
|
|
||||||
char *myserveremail = serveremail;
|
char *myserveremail = serveremail;
|
||||||
if (!ast_strlen_zero(vmtmp->serveremail))
|
if (!ast_strlen_zero(vmtmp->serveremail))
|
||||||
myserveremail = vmtmp->serveremail;
|
myserveremail = vmtmp->serveremail;
|
||||||
int attach_user_voicemail = ast_test_flag((&globalflags), VM_ATTACH);
|
int attach_user_voicemail = ast_test_flag((&globalflags), VM_ATTACH);
|
||||||
attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
|
attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
|
||||||
/* NULL category for IMAP storage */
|
/* 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);
|
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
|
#else
|
||||||
copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
|
copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue