ast_unlock_path(dir);
+ /* We must store the file first, before copying the message, because
+ * ODBC storage does the entire copy with SQL.
+ */
+ if (ast_fileexists(fn, NULL, NULL) > 0) {
+ STORE(dir, vmu->mailbox, vmu->context, msgnum);
+ }
+
/* Are there to be more recipients of this message? */
while (tmpptr) {
struct ast_vm_user recipu, *recip;
free_user(recip);
}
}
+
+ /* Notification and disposal needs to happen after the copy, though. */
if (ast_fileexists(fn, NULL, NULL) > 0) {
- STORE(dir, vmu->mailbox, vmu->context, msgnum);
notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name);
DISPOSE(dir, msgnum);
}
while(f) {
/* Send a copy immediately */
if ((f->callno == callno) && iaxs[f->callno] &&
- (f->oseqno >= last)) {
+ ((unsigned char ) (f->oseqno - last) < 128)) {
send_packet(f);
}
f = f->next;