diff --git a/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c b/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c index 654f574728..9cd946fc43 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c @@ -312,7 +312,7 @@ static iks *prompt_component_handle_input_error(struct rayo_actor *prompt, struc iks_insert_attrib(iq, "from", RAYO_JID(RAYO_COMPONENT(prompt)->parent)); iks_insert_attrib(iq, "to", RAYO_COMPONENT(prompt)->client_jid); iks_insert_node(iq, iks_copy_within(error, iks_stack(iq))); - PROMPT_COMPONENT(prompt)->complete = iq; + PROMPT_COMPONENT(prompt)->complete = iks_copy(iq); rayo_component_send_stop(prompt, PROMPT_COMPONENT(prompt)->output_jid); break; diff --git a/src/mod/formats/mod_tone_stream/mod_tone_stream.c b/src/mod/formats/mod_tone_stream/mod_tone_stream.c index 2aafff129f..3495d0578f 100644 --- a/src/mod/formats/mod_tone_stream/mod_tone_stream.c +++ b/src/mod/formats/mod_tone_stream/mod_tone_stream.c @@ -93,11 +93,8 @@ static switch_status_t silence_stream_file_read(switch_file_handle_t *handle, vo sh->samples -= *len; } - if (sh->silence) { - switch_generate_sln_silence((int16_t *) data, *len, sh->silence); - } else { - memset(data, 0, *len * 2); - } + switch_generate_sln_silence((int16_t *) data, *len, + sh->silence ? sh->silence : (uint32_t)-1); return SWITCH_STATUS_SUCCESS; } diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 3090942df5..987796941b 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -166,9 +166,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, switch_goto_status(SWITCH_STATUS_SUCCESS, end); } - var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE); - if (var) { - sval = atoi(var); + if ((var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) + && (sval = atoi(var))) { SWITCH_IVR_VERIFY_SILENCE_DIVISOR(sval); } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index b6c52c4ae3..acc99466eb 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1773,6 +1773,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session"); switch_channel_t *channel = switch_core_session_get_channel(session); switch_event_t *fsevent = NULL; + const char *var; if (direction >= SWITCH_RTP_CRYPTO_MAX || keylen > SWITCH_RTP_MAX_CRYPTO_LEN) { return SWITCH_STATUS_FALSE; @@ -1794,7 +1795,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess memset(policy, 0, sizeof(*policy)); - switch_channel_set_variable(channel, "send_silence_when_idle", "-1"); + /* many devices can't handle gaps in SRTP streams */ + if (!((var = switch_channel_get_variable(channel, "srtp_allow_idle_gaps")) + && switch_true(var)) + && (!(var = switch_channel_get_variable(channel, "send_silence_when_idle")) + || !(atoi(var)))) { + switch_channel_set_variable(channel, "send_silence_when_idle", "-1"); + } switch (crypto_key->type) { case AES_CM_128_HMAC_SHA1_80: