diff options
author | Malcolm Davenport <malcolmd@digium.com> | 2004-03-18 22:49:06 +0000 |
---|---|---|
committer | Malcolm Davenport <malcolmd@digium.com> | 2004-03-18 22:49:06 +0000 |
commit | 264bfb71210aa8b063cd07c98e96415a491b87cf (patch) | |
tree | 5f7a6cb14f71a2360afa6f0233a7daaf76f01999 /apps/app_voicemail.c | |
parent | d3b2cb19e480fd0fb115afb22dab0bcd18dc7c10 (diff) |
Bug # 1247: Add patch to specify minimum vmail length and discard that
which does not meet the minimum
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-x | apps/app_voicemail.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index ad3983c7b..f4e19ef6f 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -190,6 +190,7 @@ static char serveremail[80]; 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 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int } else close(fd); } + if (end - start < vmminmessage) { + ast_filedelete(fn, NULL); + goto leave_vm_out; + } stringp = fmt; strsep(&stringp, "|"); /* Send e-mail if applicable */ @@ -1510,6 +1515,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int } } else 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 @@ static int load_config(void) 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"); if (!fmt) fmt = "wav"; |