Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 247601) +++ apps/app_voicemail.c (working copy) @@ -386,6 +386,7 @@ char attachfmt[20]; /*!< Attachment format */ unsigned int flags; /*!< VM_ flags */ int saydurationm; + int minsecs; /*!< Minimum number of seconds per message for this mailbox */ int maxmsg; /*!< Maximum number of msgs per folder for this mailbox */ int maxdeletedmsg; /*!< Maximum number of deleted msgs saved for this mailbox */ int maxsecs; /*!< Maximum number of seconds per message for this mailbox */ @@ -775,6 +776,8 @@ ast_copy_string(vmu->dialout, dialcontext, sizeof(vmu->dialout)); ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit)); ast_copy_string(vmu->zonetag, zonetag, sizeof(vmu->zonetag)); + if (vmminsecs) + vmu->minsecs = vmminsecs; if (vmmaxsecs) vmu->maxsecs = vmmaxsecs; if (maxmsg) @@ -832,6 +835,8 @@ } else { ast_log(LOG_WARNING, "Invalid min duration for say duration\n"); } + } else if (!strcasecmp(var, "nextaftercmd")) { + ast_set2_flag(vmu, ast_true(value), VM_SKIPAFTERCMD); } else if (!strcasecmp(var, "forcename")) { ast_set2_flag(vmu, ast_true(value), VM_FORCENAME); } else if (!strcasecmp(var, "forcegreetings")) { @@ -842,6 +847,16 @@ ast_copy_string(vmu->dialout, value, sizeof(vmu->dialout)); } else if (!strcasecmp(var, "exitcontext")) { ast_copy_string(vmu->exit, value, sizeof(vmu->exit)); + } else if (!strcasecmp(var, "minmessage") || !strcasecmp(var, "minsecs")) { + vmu->minsecs = atoi(value); + if (vmu->minsecs <= 0) { + ast_log(LOG_WARNING, "Invalid max message length of %s. Using global value %d\n", value, vmmaxsecs); + vmu->minsecs = vmmaxsecs; + } else { + vmu->minsecs = atoi(value); + } + if (!strcasecmp(var, "minmessage")) + ast_log(LOG_WARNING, "Option 'minmessage' has been deprecated in favor of 'minsecs'. Please make that change in your voicemail config.\n"); } else if (!strcasecmp(var, "maxmessage") || !strcasecmp(var, "maxsecs")) { vmu->maxsecs = atoi(value); if (vmu->maxsecs <= 0) { @@ -4732,9 +4747,9 @@ res = play_record_review(chan, NULL, tmptxtfile, vmu->maxsecs, fmt, 1, vmu, &duration, NULL, options->record_gain, vms); if (txt) { - if (duration < vmminsecs) { + if (duration < vmu->minsecs) { fclose(txt); - ast_verb(3, "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmminsecs); + ast_verb(3, "Recording was %d seconds long but needs to be at least %d - abandoning\n", duration, vmu->minsecs); ast_filedelete(tmptxtfile, NULL); unlink(tmptxtfile); if (ast_check_realtime("voicemail_data")) { @@ -4833,7 +4848,7 @@ res = 0; } - if (duration < vmminsecs) { + if (duration < vmu->minsecs) { /* XXX We should really give a prompt too short/option start again, with leave_vm_out called only after a timeout XXX */ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED"); } else { @@ -8459,7 +8474,7 @@ vms.oldmessages++; cmd = ast_play_and_wait(chan, "vm-undeleted"); } - if (ast_test_flag((&globalflags), VM_SKIPAFTERCMD)) { + if (ast_test_flag((&globalflags), VM_SKIPAFTERCMD) || ast_test_flag(vmu, VM_SKIPAFTERCMD)) { if (vms.curmsg < vms.lastmsg) { vms.curmsg++; cmd = play_message(chan, vmu, &vms);