Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 218049) +++ apps/app_voicemail.c (working copy) @@ -7222,7 +7222,14 @@ } } else if ((!strcasecmp(vms->curbox, "INBOX") || !strcasecmp(vms->curbox, "Urgent")) && vms->heard[x] && ast_test_flag(vmu, VM_MOVEHEARD) && !vms->deleted[x]) { /* Move to old folder before deleting */ +#ifdef ODBC_STORAGE + // My attempt at making an UPDATE happen rather than an INSERT then DELETE + create_dirpath(fn2, sizeof(fn2), vmu->context, vmu->mailbox, mbox(1)); //"Old" + rename_file(vms->curdir,x,vmu->mailbox,vmu->context,fn2 ,vms->oldmessages++); + vms->deleted[x] = 0; //assumption +#else res = save_to_folder(vmu, vms, x, 1); +#endif if (res == ERROR_LOCK_PATH) { /* If save failed do not delete the message */ ast_log(AST_LOG_WARNING, "Save failed. Not moving message: %s.\n", res == ERROR_LOCK_PATH ? "unable to lock path" : "destination folder full");