]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6954 Detect when we have T.38 in nomedia or proxy media mode and apply same fixups...
authorMatteo Brancaleoni <mbrancaleoni@voismart.it>
Tue, 24 Feb 2015 15:43:24 +0000 (16:43 +0100)
committerMatteo Brancaleoni <mbrancaleoni@voismart.it>
Thu, 26 Mar 2015 14:33:30 +0000 (15:33 +0100)
src/mod/endpoints/mod_sofia/sofia_glue.c

index 74d4395113801d4ee92dee3c9241de18c28c9db4..ece392334cc03e60092d6da000fd3c8a80ac9e77 100644 (file)
@@ -696,6 +696,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
        char *record_route = NULL;
        const char *recover_via = NULL;
        int require_timer = 1;
+       uint8_t is_t38 = 0;
 
        if (switch_channel_test_flag(tech_pvt->channel, CF_RECOVERING)) {
                const char *recover_contact = switch_channel_get_variable(tech_pvt->channel, "sip_recover_contact");
@@ -1235,9 +1236,12 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
 
 
 
-       if (switch_channel_get_private(tech_pvt->channel, "t38_options")) {
+       if ((switch_channel_get_private(tech_pvt->channel, "t38_options")) ||  
+               ((sofia_test_flag(tech_pvt, TFLAG_INB_NOMEDIA) || sofia_test_flag(tech_pvt, TFLAG_PROXY_MEDIA)) 
+                       && switch_stristr("m=image", tech_pvt->mparams.local_sdp_str))) {
                sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
-       }
+               is_t38 = 1;
+    }
 
        if (sofia_use_soa(tech_pvt)) {
                nua_invite(tech_pvt->nh,
@@ -1272,7 +1276,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                                   TAG_IF(!zstr(tech_pvt->mparams.local_sdp_str), SOATAG_ADDRESS(tech_pvt->mparams.adv_sdp_audio_ip)),
                                   TAG_IF(!zstr(tech_pvt->mparams.local_sdp_str), SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str)),
                                   TAG_IF(!zstr(tech_pvt->mparams.local_sdp_str), SOATAG_REUSE_REJECTED(1)),
-                                  TAG_IF(switch_channel_get_private(tech_pvt->channel, "t38_options"), SOATAG_ORDERED_USER(1)),
+                                  TAG_IF(is_t38, SOATAG_ORDERED_USER(1)),
                                   TAG_IF(!zstr(tech_pvt->mparams.local_sdp_str), SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE)),
                                   TAG_IF(!zstr(tech_pvt->mparams.local_sdp_str), SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL)),
                                   TAG_IF(rep, SIPTAG_REPLACES_STR(rep)),