Merged revisions 51213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r51213 | file | 2007-01-17 19:48:55 -0500 (Wed, 17 Jan 2007) | 2 lines Build the IMAP remote directory string better and properly. Fix an issue with encoding the GSM voicemail when attaching to the voicemail. (issue #8808 reported by akohlsmith) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
461d49d2bd
commit
180eb47bcb
1 changed files with 18 additions and 8 deletions
|
@ -2000,7 +2000,7 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
|
||||||
snprintf(fname, sizeof(fname), "%s.%s", attach, format);
|
snprintf(fname, sizeof(fname), "%s.%s", attach, format);
|
||||||
base_encode(fname, p);
|
base_encode(fname, p);
|
||||||
/* only attach if necessary */
|
/* only attach if necessary */
|
||||||
if (imap && strcmp(format, "gsm")) {
|
if (imap && !strcmp(format, "gsm")) {
|
||||||
fprintf(p, "--%s\r\n", bound);
|
fprintf(p, "--%s\r\n", bound);
|
||||||
fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\r\n", msgnum, format);
|
fprintf(p, "Content-Type: audio/x-gsm; name=\"msg%04d.%s\"\r\n", msgnum, format);
|
||||||
fprintf(p, "Content-Transfer-Encoding: base64\r\n");
|
fprintf(p, "Content-Transfer-Encoding: base64\r\n");
|
||||||
|
@ -4605,7 +4605,8 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
|
||||||
#ifdef IMAP_STORAGE
|
#ifdef IMAP_STORAGE
|
||||||
static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int use_folder)
|
static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int use_folder)
|
||||||
{
|
{
|
||||||
char tmp[256];
|
char tmp[256], *t = tmp;
|
||||||
|
size_t left = sizeof(tmp);
|
||||||
|
|
||||||
if (box == 1) {
|
if (box == 1) {
|
||||||
ast_copy_string(vms->curbox, mbox(0), sizeof(vms->curbox));
|
ast_copy_string(vms->curbox, mbox(0), sizeof(vms->curbox));
|
||||||
|
@ -4615,11 +4616,20 @@ static void imap_mailbox_name(char *spec, struct vm_state *vms, int box, int use
|
||||||
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
|
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(authuser) > 0) {
|
/* Build up server information */
|
||||||
snprintf(tmp, sizeof(tmp), "{%s:%s/imap/authuser=%s/%s/user=%s}",imapserver,imapport,authuser,imapflags,vms->imapuser);
|
ast_build_string(&t, &left, "{%s:%s/imap", imapserver, imapport);
|
||||||
} else {
|
|
||||||
snprintf(tmp, sizeof(tmp), "{%s:%s/imap/%s/user=%s}",imapserver,imapport,imapflags,vms->imapuser);
|
/* Add authentication user if present */
|
||||||
}
|
if (!ast_strlen_zero(authuser))
|
||||||
|
ast_build_string(&t, &left, "/%s", authuser);
|
||||||
|
|
||||||
|
/* Add flags if present */
|
||||||
|
if (!ast_strlen_zero(imapflags))
|
||||||
|
ast_build_string(&t, &left, "/%s", imapflags);
|
||||||
|
|
||||||
|
/* End with username */
|
||||||
|
ast_build_string(&t, &left, "/user=%s}", vms->imapuser);
|
||||||
|
|
||||||
if(box == 0 || box == 1)
|
if(box == 0 || box == 1)
|
||||||
sprintf(spec, "%s%s", tmp, use_folder? imapfolder: "INBOX");
|
sprintf(spec, "%s%s", tmp, use_folder? imapfolder: "INBOX");
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue