mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
ditto
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11082 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -64,8 +64,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
|
||||
|
||||
media_ready = (switch_channel_media_ready(channel) && !switch_channel_test_flag(channel, CF_SERVICE));
|
||||
|
||||
|
||||
if (media_ready && (var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var)) && sval >= 100) {
|
||||
if (ms > 100 && media_ready && (var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) {
|
||||
switch_core_session_get_read_impl(session, &imp);
|
||||
|
||||
if (switch_core_codec_init(&codec,
|
||||
@@ -94,6 +93,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
|
||||
|
||||
}
|
||||
|
||||
if (!write_frame.datalen) {
|
||||
sval = 0;
|
||||
}
|
||||
|
||||
cng_frame.data = data;
|
||||
cng_frame.datalen = 2;
|
||||
cng_frame.buflen = 2;
|
||||
@@ -177,7 +180,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
|
||||
break;
|
||||
}
|
||||
|
||||
if (sval) {
|
||||
if (sval && write_frame.datalen) {
|
||||
switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, sval);
|
||||
switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user