Index: app_voicemail.c =================================================================== --- app_voicemail.c (revision 48581) +++ app_voicemail.c (working copy) @@ -312,6 +312,7 @@ unsigned int flags; /*!< VM_ flags */ int saydurationm; int maxmsg; /*!< Maximum number of msgs per folder for this mailbox */ + int vmmaxmessage; /*!< Maximum number of seconds per message */ #ifdef IMAP_STORAGE char imapuser[80]; /* IMAP server login */ char imappassword[80]; /* IMAP server password if authpassword not defined */ @@ -561,6 +562,8 @@ ast_copy_string(vmu->dialout, dialcontext, sizeof(vmu->dialout)); if (exitcontext) ast_copy_string(vmu->exit, exitcontext, sizeof(vmu->exit)); + if (vmmaxmessage) + vmu->vmmaxmessage = vmmaxmessage; if (maxmsg) vmu->maxmsg = maxmsg; vmu->volgain = volgain; @@ -617,6 +620,8 @@ 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, "maxmessage")) { + vmu->vmmaxmessage = atoi(value); } else if (!strcasecmp(var, "maxmsg")) { vmu->maxmsg = atoi(value); if (vmu->maxmsg <= 0) { @@ -668,6 +673,7 @@ struct ast_variable *tmp; tmp = var; while (tmp) { + ast_log(LOG_DEBUG, "Name: %s Value: %s\n",tmp->name,tmp->value); if (!strcasecmp(tmp->name, "password")) { ast_copy_string(retval->password, tmp->value, sizeof(retval->password)); } else if (!strcasecmp(tmp->name, "uniqueid")) { @@ -2866,7 +2872,6 @@ pbx_builtin_setvar_helper(chan, "VMSTATUS", "FAILED"); return res; } - /* Setup pre-file if appropriate */ if (strcmp(vmu->context, "default")) snprintf(ext_context, sizeof(ext_context), "%s@%s", ext, vmu->context); @@ -3085,7 +3090,8 @@ category ? category : ""); } else ast_log(LOG_WARNING, "Error opening text file for output\n"); - res = play_record_review(chan, NULL, tmptxtfile, vmmaxmessage, fmt, 1, vmu, &duration, NULL, options->record_gain); + ast_log(LOG_DEBUG, "Global max message length: %i User max message length: %i \n",vmmaxmessage,vmu->vmmaxmessage); + res = play_record_review(chan, NULL, tmptxtfile, vmu->vmmaxmessage, fmt, 1, vmu, &duration, NULL, options->record_gain); if (txt) { if (duration < vmminmessage) {