diff options
author | Mark Spencer <markster@digium.com> | 2003-05-03 20:46:19 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-05-03 20:46:19 +0000 |
commit | 7fe77f16a7998470f1e66447168d1514eac09fb2 (patch) | |
tree | 81f00933f484cbc6c6514cb1a6a16a49d342919a /apps/app_voicemail.c | |
parent | 8b257ef3b66aa43eaf23309e30dd8158f2d5024e (diff) |
Silence updates
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rwxr-xr-x | apps/app_voicemail.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 727763264..8ee076acd 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -676,18 +676,18 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int free(sfmt[x]); } + sildet = ast_dsp_new(); //Create the silence detector if (silence > 0) { - rfmt = chan->readformat; - res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); - if (res < 0) { - ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n"); - return -1; - } - sildet = ast_dsp_new(); - if (!sildet) { - ast_log(LOG_WARNING, "Unable to create silence detector :(\n"); - return -1; - } + rfmt = chan->readformat; + res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); + if (res < 0) { + ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n"); + return -1; + } + if (!sildet) { + ast_log(LOG_WARNING, "Unable to create silence detector :(\n"); + return -1; + } ast_dsp_set_threshold(sildet, 50); } |