mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
Merged revisions 110629 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r110629 | file | 2008-03-25 11:39:45 -0300 (Tue, 25 Mar 2008) | 12 lines Merged revisions 110628 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases. (closes issue #10058) Reported by: tracinet ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@110630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -244,6 +244,7 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
|
||||
{
|
||||
const char *ptr;
|
||||
int res = 0;
|
||||
struct ast_silence_generator *silgen = NULL;
|
||||
|
||||
if (!between)
|
||||
between = 100;
|
||||
@@ -258,6 +259,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
if (ast_opt_transmit_silence) {
|
||||
silgen = ast_channel_start_silence_generator(chan);
|
||||
}
|
||||
|
||||
for (ptr = digits; *ptr; ptr++) {
|
||||
if (*ptr == 'w') {
|
||||
/* 'w' -- wait half a second */
|
||||
@@ -284,6 +289,10 @@ int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, const ch
|
||||
res = -1;
|
||||
}
|
||||
|
||||
if (silgen) {
|
||||
ast_channel_stop_silence_generator(chan, silgen);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user