]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add experimental NDLB-connectile-dysfunction-2.0
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 29 Apr 2009 22:04:25 +0000 (22:04 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 29 Apr 2009 22:04:25 +0000 (22:04 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13198 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_reg.c

index 97dfb73135216bbb18b2cf69f461bd8582f1cf1b..f74d47d3bbb8eb7dbfb9fc427802d51d40732ab3 100644 (file)
@@ -886,10 +886,19 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
                                if (!strcasecmp(v_contact_str, "NDLB-connectile-dysfunction-2.0")) {
                                        char *path_encoded;
                                        size_t path_encoded_len = (strlen(contact_str) * 3) + 1;
+                                       char my_contact_str[1024];
+
+                                       if (contact->m_url->url_params) {
+                                               switch_snprintf(my_contact_str, sizeof(my_contact_str), "%s <sip:%s@%s:%d;%s%s;fs_nat=yes>",
+                                                                               display, contact->m_url->url_user, url_ip, network_port, contact->m_url->url_params, received_data);
+                                       } else {
+                                               switch_snprintf(my_contact_str, sizeof(my_contact_str), "%s <sip:%s@%s:%d%s;fs_nat=yes>", display, contact->m_url->url_user, url_ip,
+                                                                               network_port, received_data);
+                                       }
 
                                        switch_zmalloc(path_encoded, path_encoded_len);
                                        switch_copy_string(path_encoded, ";fs_nat=yes;fs_path=", 20);
-                                       switch_url_encode(contact_str, path_encoded + 22, path_encoded_len - 20);
+                                       switch_url_encode(my_contact_str, path_encoded + 22, path_encoded_len - 20);
                                        reg_desc = "Registered(AUTO-NAT-2.0)";
                                        exptime = 20;
                                } else {