To answer you, yes I’ve tried a lot of things.
Specifying only 1 format: if I specify only gsm, it doesn’t create the wav, but it still sends 2 messages, both have the .gsm.
I’ve looked into app_voicemail.c, and it seems like it’s doing one mail with the format you’ve configured, and one mail with the first format that is written (so if you’ve put format=wav|gsm, first mail will be wav + gsm, second will be only wav). The gsm is always needed for asterisk, if you want your users to hear the voicemail using a phone, so you’ve to let it there.
When i create the mailbox,by example:
555 => 0000,Example Mailbox,toto@localhost,imapuser=toto|imappassword=toto
Here, it’ll use this email for the 2nd message that is sent (the one with the 1st format only). If i add attach=no, it’ll not attach the file, but it’ll still send the message. If I don’t write an email, it still sends it to the email o.O (but I have to try that after a reboot, maybe it kept the email somewhere so I have to reboot?).
Then I looked into the app_voicemail.c
I’ve found out where it sent the mail with the first formay only, search for “Sent mail to” in the file and remplace lines by that:
} else {
/*
make_email_file(p, srcemail, vmu, msgnum, context, mailbox, cidnum, cidname, attach, format, duration, attach_user_voicemail, chan, category, 0);
*/
fclose(p);
/*
snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
*/
ast_safe_system(tmp2);
ast_log(LOG_DEBUG, "Sent mail to %s with command '%s'\n", vmu->email, mailcmd);
}
Now for my 2nd problem, I haven’t found it yet in the code, as it’s more compexe when it copies the file, but I’ll find it!!
If someone changes the file of folder using a phone, and then he tries to login using a mail client too fast, it’ll lock the account for a few minutes, because Asterisk was still connected to it. Well that’s how I understand what it did
I think you can change the lock timer somewhere in the uw-imap source, but I haven’t found it, only found it in the ipop source, which is useless for me