|
|
@ -1235,9 +1235,8 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
|
|
|
int dspsilence = 0;
|
|
|
|
int dspsilence = 0;
|
|
|
|
int silence = 0; /* amount of silence to allow */
|
|
|
|
int silence = 0; /* amount of silence to allow */
|
|
|
|
int gotsilence = 0; /* did we timeout for silence? */
|
|
|
|
int gotsilence = 0; /* did we timeout for silence? */
|
|
|
|
char *silencestr=NULL;
|
|
|
|
char *silencestr = NULL;
|
|
|
|
int rfmt=0;
|
|
|
|
int rfmt = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* XXX EAGI FIXME XXX */
|
|
|
|
/* XXX EAGI FIXME XXX */
|
|
|
|
|
|
|
|
|
|
|
@ -1380,10 +1379,10 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (gotsilence) {
|
|
|
|
if (gotsilence) {
|
|
|
|
ast_stream_rewind(fs, silence-1000);
|
|
|
|
ast_stream_rewind(fs, silence-1000);
|
|
|
|
ast_truncstream(fs);
|
|
|
|
ast_truncstream(fs);
|
|
|
|
sample_offset = ast_tellstream(fs);
|
|
|
|
sample_offset = ast_tellstream(fs);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ast_agi_fdprintf(chan, agi->fd, "200 result=%d (timeout) endpos=%ld\n", res, sample_offset);
|
|
|
|
ast_agi_fdprintf(chan, agi->fd, "200 result=%d (timeout) endpos=%ld\n", res, sample_offset);
|
|
|
|
ast_closestream(fs);
|
|
|
|
ast_closestream(fs);
|
|
|
@ -1393,8 +1392,9 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
|
|
|
|
res = ast_set_read_format(chan, rfmt);
|
|
|
|
res = ast_set_read_format(chan, rfmt);
|
|
|
|
if (res)
|
|
|
|
if (res)
|
|
|
|
ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
|
|
|
|
ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
|
|
|
|
ast_dsp_free(sildet);
|
|
|
|
ast_dsp_free(sildet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return RESULT_SUCCESS;
|
|
|
|
return RESULT_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|