]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4669 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 2 Oct 2012 15:30:51 +0000 (10:30 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 2 Oct 2012 15:31:32 +0000 (10:31 -0500)
src/mod/endpoints/mod_sofia/sofia.c
src/switch_rtp.c

index 3b5277647fd44c5e5db83feb903d5144488d6a34..2a6dc4cc5fe1895ecae1b2e1919b054c10ccdf0c 100644 (file)
@@ -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) || 
index 14fbe1a849d5f6498f6348e842a7a20f95b8d221..0acae50c1905dcf14754d2d26a63e5b0cd4e5bdf 100644 (file)
@@ -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;
                        }