diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 74d4395113..ece392334c 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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)),