]> 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:01 +0000 (03:31 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 20 May 2014 22:31:01 +0000 (03:31 +0500)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index a1c220427ef905802869be666196f01d23123c1e..96bba279dc1beda0a4233d36ab23f6a2e8e772ae 100644 (file)
@@ -299,7 +299,8 @@ typedef enum {
        PFLAG_NDLB_ALLOW_BAD_IANANAME = (1 << 3),
        PFLAG_NDLB_ALLOW_NONDUP_SDP = (1 << 4),
        PFLAG_NDLB_ALLOW_CRYPTO_IN_AVP = (1 << 5),
-       PFLAG_NDLB_EXPIRES_IN_REGISTER_RESPONSE = (1 << 6)
+       PFLAG_NDLB_EXPIRES_IN_REGISTER_RESPONSE = (1 << 6),
+       PFLAG_NDLB_NEVER_PATCH_REINVITE = (1 << 7)
 } sofia_NDLB_t;
 
 typedef enum {
index 8208e03eea127fd6d4c53af4c5bf69f0ab7c2812..fb862b90d69738590604bf37b50734e1a98e353d 100644 (file)
@@ -3780,6 +3780,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->ndlb |= PFLAG_NDLB_NEVER_PATCH_REINVITE;
+                                               } else {
+                                                       profile->ndlb &= ~PFLAG_NDLB_NEVER_PATCH_REINVITE;
+                                               }
                                        } else if (!strcasecmp(var, "registration-thread-frequency")) {
                                                profile->ireg_seconds = atoi(val);
                                                if (profile->ireg_seconds < 0) {
@@ -6322,7 +6328,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->ndlb & PFLAG_NDLB_NEVER_PATCH_REINVITE)) {
                                                        if (sofia_glue_tech_proxy_remote_addr(tech_pvt, 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 087c3a281189452a40cb11135fa6b635f89dd664..55f948ce74d54eb7d670c6f2c7acdc6033fff165 100644 (file)
@@ -1751,10 +1751,12 @@ void sofia_glue_tech_patch_sdp(private_object_t *tech_pvt)
 
        len = strlen(tech_pvt->local_sdp_str) * 2;
 
-       if (switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) &&
-               (switch_stristr("sendonly", tech_pvt->local_sdp_str) || switch_stristr("0.0.0.0", tech_pvt->local_sdp_str))) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n");
-               return;
+       if (!(tech_pvt->profile->ndlb & PFLAG_NDLB_NEVER_PATCH_REINVITE)) {
+               if (switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED) &&
+                       (switch_stristr("sendonly", tech_pvt->local_sdp_str) || switch_stristr("0.0.0.0", tech_pvt->local_sdp_str))) {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Skip patch on hold SDP\n");
+                       return;
+               }
        }
 
        if (zstr(tech_pvt->adv_sdp_audio_ip) || !tech_pvt->adv_sdp_audio_port) {