]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6418 FS-6427 add profile param NDLB-proxy-never-patch-reinvites to solve both...
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 20 May 2014 22:31:45 +0000 (03:31 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 20 May 2014 22:31:50 +0000 (03:31 +0500)
src/include/switch_core_media.h
src/mod/endpoints/mod_sofia/sofia.c
src/switch_core_media.c

index 722b1e9aa4299b4dfec31dd5bc0407ce5e85cc73..043bbbce44605e4d763a46fa91add128593cafc5 100644 (file)
@@ -50,7 +50,8 @@ typedef enum {
        SM_NDLB_ALLOW_NONDUP_SDP = (1 << 1),
        SM_NDLB_ALLOW_CRYPTO_IN_AVP = (1 << 2),
        SM_NDLB_DISABLE_SRTP_AUTH = (1 << 3),
-       SM_NDLB_SENDRECV_IN_SESSION = (1 << 4)
+       SM_NDLB_SENDRECV_IN_SESSION = (1 << 4),
+       SM_NDLB_NEVER_PATCH_REINVITE = (1 << 5)
 } switch_core_media_NDLB_t;
 
 typedef enum {
index dbb2bf8c22270e31882a80017442062096676980..ea4ed5544e34ea21de229a7df2174b292b58f527 100644 (file)
@@ -4091,6 +4091,12 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
                                                }
+                                       } else if (!strcasecmp(var, "NDLB-proxy-never-patch-reinvites")) {
+                                               if (switch_true(val)) {
+                                                       profile->mndlb |= SM_NDLB_NEVER_PATCH_REINVITE;
+                                               } else {
+                                                       profile->mndlb &= ~SM_NDLB_NEVER_PATCH_REINVITE;
+                                               }
                                        } else if (!strcasecmp(var, "registration-thread-frequency")) {
                                                profile->ireg_seconds = atoi(val);
                                                if (profile->ireg_seconds < 0) {
@@ -6722,7 +6728,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                                                        }
                                                }
 
-                                               if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
+                                               if (switch_channel_test_flag(channel, CF_PROXY_MEDIA) && !(tech_pvt->profile->mndlb & SM_NDLB_NEVER_PATCH_REINVITE)) {
                                                        if (switch_core_media_proxy_remote_addr(session, r_sdp) == SWITCH_STATUS_SUCCESS && !is_t38) {
                                                                nua_respond(tech_pvt->nh, SIP_200_OK, TAG_END());
                                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Audio params changed, NOT proxying re-invite.\n");
index be6caf52475a3e1b8b3e547604255705561dee69..115a9dbda07cbd7f0a583ec484d6775e345ffd52 100644 (file)
@@ -7148,10 +7148,12 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
 
        len = strlen(smh->mparams->local_sdp_str) * 2;
 
-       if (switch_channel_test_flag(session->channel, CF_ANSWERED) &&
-               (switch_stristr("sendonly", smh->mparams->local_sdp_str) || switch_stristr("0.0.0.0", smh->mparams->local_sdp_str))) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n");
-               return;
+       if (!(smh->mparams->ndlb & SM_NDLB_NEVER_PATCH_REINVITE)) {
+               if (switch_channel_test_flag(session->channel, CF_ANSWERED) &&
+                       (switch_stristr("sendonly", smh->mparams->local_sdp_str) || switch_stristr("0.0.0.0", smh->mparams->local_sdp_str))) {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n");
+                       return;
+               }
        }
 
        if (zstr(a_engine->local_sdp_ip) || !a_engine->local_sdp_port) {// || switch_channel_test_flag(session->channel, CF_PROXY_MEDIA)) {