add experimental NDLB-connectile-dysfunction-2.0

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13197 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-04-29 22:00:34 +00:00
parent c078e1e43e
commit fd4d83b7c2

View File

@ -883,11 +883,21 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
} }
if ((v_contact_str = switch_event_get_header(*v_event, "sip-force-contact"))) { if ((v_contact_str = switch_event_get_header(*v_event, "sip-force-contact"))) {
if (!strcasecmp(v_contact_str, "NDLB-connectile-dysfunction-2.0")) {
char *path_encoded;
size_t path_encoded_len = (strlen(contact_str) * 3) + 1;
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);
reg_desc = "Registered(AUTO-NAT-2.0)";
exptime = 20;
} else {
if (*received_data && sofia_test_pflag(profile, PFLAG_RECIEVED_IN_NAT_REG_CONTACT)) { if (*received_data && sofia_test_pflag(profile, PFLAG_RECIEVED_IN_NAT_REG_CONTACT)) {
switch_snprintf(received_data, sizeof(received_data), ";received=%s:%d", url_ip, network_port); switch_snprintf(received_data, sizeof(received_data), ";received=%s:%d", url_ip, network_port);
} }
if (!strcasecmp(v_contact_str, "nat-connectile-dysfunction") || if (!strcasecmp(v_contact_str, "nat-connectile-dysfunction") ||
!strcasecmp(v_contact_str, "NDLB-connectile-dysfunction") || !strcasecmp(v_contact_str, "NDLB-tls-connectile-dysfunction")) { !strcasecmp(v_contact_str, "NDLB-connectile-dysfunction") || !strcasecmp(v_contact_str, "NDLB-tls-connectile-dysfunction")) {
if (contact->m_url->url_params) { if (contact->m_url->url_params) {
@ -914,6 +924,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
} }
} }
} }
}
if ((exp_var = switch_event_get_header(*v_event, "sip-force-expires"))) { if ((exp_var = switch_event_get_header(*v_event, "sip-force-expires"))) {
int tmp = atoi(exp_var); int tmp = atoi(exp_var);