[asterisk-bugs] [JIRA] (ASTERISK-24786) Asterisk terminates when playing a voicemail stored in LDAP
Graham Barnett (JIRA)
noreply at issues.asterisk.org
Fri Feb 13 06:31:34 CST 2015
Graham Barnett created ASTERISK-24786:
-----------------------------------------
Summary: Asterisk terminates when playing a voicemail stored in LDAP
Key: ASTERISK-24786
URL: https://issues.asterisk.org/jira/browse/ASTERISK-24786
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Applications/app_voicemail
Affects Versions: 13.2.0
Reporter: Graham Barnett
Severity: Critical
Symptom
1. If user has no greetings and user opens mailbox (*97) and tries to play a message, asterisk terminates
2. If user has at least one greeting, playing back a message gives:
[14626][C-0000002c]: app_voicemail.c:8677 play_message: No origtime?!
Why?
vms_x = get_vm_state_by_imapuser(user, x)
caches existing states by user.
The states are looked up my imap version, user name, interactive=2 || interactive matches.
Why does this matter?
int fold = 0;
vms_p = get_vm_state_by_imapuser(vmu->imapuser, 0);
if (!vms_p) {
vms_p = get_vm_state_by_mailbox(mailbox, context, 1);
}
ret = init_mailstream(vms_p, fold);
vs
if (!(vmu = find_user(NULL, context, mailbox))) {
RETRIEVE(tempfile, -1, vmu->mailbox, vmu->context);
res = imap_retrieve_greeting(dir, msgnum, vmu);
if (!(vms_p = get_vm_state_by_mailbox(vmu->mailbox, vmu->context, 1)) &&
if (init_mailstream(vms_p, GREETINGS_FOLDER) || !vms_p->mailstream) {
i.e. the mailstream can be left pointed at the GREETINGS and not the Inbox
And why does that matter?
imap_retrieve_file
if (!(vms = get_vm_state_by_mailbox(vmu->mailbox, vmu->context, 1)) && !(vms = get_vm_state_by_mailbox(vmu->mailbox, vmu->context, 0))) {
# CAN BE WRONG MAILSTREAM !!!!!
header_content = mail_fetchheader (vms->mailstream, vms->msgArray[msgnum]);
What is the fix?
We need to init the mailstream in imap_retrieve_file after getting the vm_state_by_mailbox
/* Ensure we have the correct stream
*/
init_mailstream(vms, 0);
if (!vms->mailstream) {
ast_log(AST_LOG_ERROR, "IMAP mailstream for %s is NULL\n", vmu->mailbox);
res = -1;
goto exit;
}
Will post patch file later.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list