From 0c48210a7519283e0523274a64ac592e7e0b218a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 14 Jun 2007 21:03:17 +0000 Subject: [PATCH] set control for vad from vars git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5364 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 14 ++++++++++++++ src/switch_rtp.c | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index fa67b6bb06..5e4afb7c07 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -913,6 +913,20 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt) uint8_t vad_out = switch_test_flag(tech_pvt, TFLAG_VAD_OUT) ? 1 : 0; uint8_t inb = switch_test_flag(tech_pvt, TFLAG_OUTBOUND) ? 0 : 1; + if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_enable_vad_in")) && switch_true(val)) { + vad_in = 1; + } + if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_enable_vad_out")) && switch_true(val)) { + vad_out = 1; + } + + if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_disable_vad_in")) && switch_true(val)) { + vad_in = 0; + } + if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_disable_vad_out")) && switch_true(val)) { + vad_out = 0; + } + tech_pvt->ssrc = switch_rtp_get_ssrc(tech_pvt->rtp_session); switch_set_flag_locked(tech_pvt, TFLAG_RTP); switch_set_flag_locked(tech_pvt, TFLAG_IO); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 4996dc9010..c1204e812e 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1435,6 +1435,10 @@ static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t data rtp_session->last_write_samplecount = rtp_session->timer.samplecount; } switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void *) send_msg, &bytes); + } else if (!fwd) { + /* nevermind save this seq inc for next time */ + rtp_session->seq--; + rtp_session->send_msg.header.seq = htons(rtp_session->seq); } if (rtp_session->ice_user) {