From 80c2bd786a6b1f20dd577b6d9d810f7a0cf02d3e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 2 Oct 2012 10:30:51 -0500 Subject: [PATCH] FS-4669 --resolve --- src/mod/endpoints/mod_sofia/sofia.c | 22 ++++++++++++++++++++-- src/switch_rtp.c | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 3b5277647f..2a6dc4cc5f 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5839,13 +5839,31 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status } - if (!switch_channel_test_flag(channel, CF_PROXY_MODE) && - sip->sip_payload && sip->sip_payload->pl_data && switch_stristr("m=image", sip->sip_payload->pl_data)) { + if (sip->sip_payload && sip->sip_payload->pl_data && switch_stristr("m=image", sip->sip_payload->pl_data)) { has_t38 = 1; } if (switch_channel_test_flag(channel, CF_PROXY_MODE)) { sofia_clear_flag(tech_pvt, TFLAG_T38_PASSTHRU); + has_t38 = 0; + } + + if (switch_channel_test_flag(channel, CF_PROXY_MEDIA) && has_t38) { + if (switch_rtp_ready(tech_pvt->rtp_session)) { + switch_rtp_udptl_mode(tech_pvt->rtp_session); + + if ((uuid = switch_channel_get_partner_uuid(channel)) && (other_session = switch_core_session_locate(uuid))) { + if (switch_core_session_compare(session, other_session)) { + private_object_t *other_tech_pvt = switch_core_session_get_private(other_session); + if (switch_rtp_ready(other_tech_pvt->rtp_session)) { + switch_rtp_udptl_mode(other_tech_pvt->rtp_session); + } + } + switch_core_session_rwunlock(other_session); + } + } + + has_t38 = 0; } if (status > 199 && (switch_channel_test_flag(channel, CF_PROXY_MODE) || diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 14fbe1a849..0acae50c19 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -4520,7 +4520,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra send_msg = frame->packet; - if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL)) { + if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL) && !switch_test_flag(frame, SFF_UDPTL_PACKET)) { if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) { send_msg->header.pt = rtp_session->payload; }