Fix silence detection in app_record (bug #2883)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
387fbae462
commit
d1f802d254
1 changed files with 38 additions and 39 deletions
|
@ -114,13 +114,13 @@ static int record_exec(struct ast_channel *chan, void *data)
|
||||||
ast_log(LOG_WARNING, "No extension specified to filename!\n");
|
ast_log(LOG_WARNING, "No extension specified to filename!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (silstr) {
|
if (silstr) {
|
||||||
if ((sscanf(silstr, "%d", &i) == 1) && (i > -1))
|
if ((sscanf(silstr, "%d", &i) == 1) && (i > -1)) {
|
||||||
silence = i;
|
silence = i * 1000;
|
||||||
else if (!ast_strlen_zero(silstr))
|
} else if (!ast_strlen_zero(silstr)) {
|
||||||
ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", silstr);
|
ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", silstr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (maxstr) {
|
if (maxstr) {
|
||||||
if ((sscanf(maxstr, "%d", &i) == 1) && (i > -1))
|
if ((sscanf(maxstr, "%d", &i) == 1) && (i > -1))
|
||||||
|
@ -185,7 +185,6 @@ static int record_exec(struct ast_channel *chan, void *data)
|
||||||
|
|
||||||
/* The end of beep code. Now the recording starts */
|
/* The end of beep code. Now the recording starts */
|
||||||
|
|
||||||
|
|
||||||
if (silence > 0) {
|
if (silence > 0) {
|
||||||
rfmt = chan->readformat;
|
rfmt = chan->readformat;
|
||||||
res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
|
res = ast_set_read_format(chan, AST_FORMAT_SLINEAR);
|
||||||
|
|
Loading…
Reference in a new issue