Index: configs/voicemail.conf.sample =================================================================== RCS file: /usr/cvsroot/asterisk/configs/voicemail.conf.sample,v retrieving revision 1.20 diff -u -r1.20 voicemail.conf.sample --- configs/voicemail.conf.sample 27 Jan 2004 00:37:47 -0000 1.20 +++ configs/voicemail.conf.sample 18 Mar 2004 19:16:49 -0000 @@ -12,6 +12,8 @@ attach=yes ; Maximum length of a voicemail message ;maxmessage=180 +; Minimum length of a voicemail message +;minmessage=3 ; Maximum length of greetings ;maxgreet=60 ; How many miliseconds to skip forward/back when rew/ff in message playback Index: apps/app_voicemail.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v retrieving revision 1.60 diff -u -r1.60 app_voicemail.c --- apps/app_voicemail.c 8 Mar 2004 05:04:11 -0000 1.60 +++ apps/app_voicemail.c 18 Mar 2004 19:16:52 -0000 @@ -190,6 +190,7 @@ static char mailcmd[160]; /* Configurable mail cmd */ static char vmfmts[80]; +static int vmminmessage; static int vmmaxmessage; static int maxgreet; static int skipms; @@ -1484,6 +1485,10 @@ } else close(fd); } + if (end - start < vmminmessage) { + ast_filedelete(fn, NULL); + goto leave_vm_out; + } stringp = fmt; strsep(&stringp, "|"); /* Send e-mail if applicable */ @@ -1509,7 +1514,8 @@ ast_log(LOG_WARNING, "No more messages possible\n"); } } else - ast_log(LOG_WARNING, "No format for saving voicemail?\n"); + ast_log(LOG_WARNING, "No format for saving voicemail?\n"); +leave_vm_out: free_user(vmu); } else { ast_log(LOG_WARNING, "No entry in voicemail config file for '%s'\n", ext); @@ -3242,6 +3248,15 @@ vmmaxmessage = x; } else { ast_log(LOG_WARNING, "Invalid max message time length\n"); + } + } + + vmminmessage = 0; + if ((s = ast_variable_retrieve(cfg, "general", "minmessage"))) { + if (sscanf(s, "%d", &x) == 1) { + vmminmessage = x; + } else { + ast_log(LOG_WARNING, "Invalid min message time length\n"); } } fmt = ast_variable_retrieve(cfg, "general", "format");