Index: apps/app_voicemail.c =================================================================== --- apps/app_voicemail.c (revision 247595) +++ 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) @@ -842,6 +845,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 +4745,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 +4846,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 {