]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add proxy-follow-redirect flag (experimental)
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 20 May 2009 21:01:51 +0000 (21:01 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 20 May 2009 21:01:51 +0000 (21:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13403 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 035261c6448b45c6443e01fc5eb287ef1b97ce3c..359d7236f1b4bc2250f3c2865e63c5fd4c5623c1 100644 (file)
@@ -1565,6 +1565,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE);
                                                }
+                                       } else if (!strcasecmp(var, "proxy-follow-redirect")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT);
+                                               }
                                        } else if (!strcasecmp(var, "outbound-use-uuid-as-callid")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_UUID_AS_CALLID);
@@ -2075,6 +2081,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE);
                                                }
+                                       } else if (!strcasecmp(var, "proxy-follow-redirect")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT);
+                                               }
                                        } else if (!strcasecmp(var, "inbound-proxy-media") && switch_true(val)) {
                                                sofia_set_flag(profile, TFLAG_PROXY_MEDIA);
                                        } else if (!strcasecmp(var, "force-subscription-expires")) {
@@ -2898,12 +2910,11 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                        int i = 0;
                        char var_name[80];      
                        
-                       if (tech_pvt->route_uri && p_contact && p_contact->m_url) {
+                       if (sofia_test_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT) && tech_pvt->route_uri && p_contact && p_contact->m_url) {
                                tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, (const char *) p_contact->m_url);
-                               nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri));
+                               nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri), TAG_END());
                        }
 
-
                        while (p_contact) {
                                if (p_contact->m_url) {
                                        if (p_contact->m_url->url_user) {