mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 08:49:01 +00:00
strip off our private params
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8856 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d88d2c1b3c
commit
2cae9ae781
@ -517,15 +517,10 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||||||
tportlog = 1;
|
tportlog = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_100rel && use_timer) {
|
supported = switch_core_sprintf(profile->pool, "%s%sprecondition, path",
|
||||||
supported = "100rel, precondition, timer";
|
use_100rel ? "100rel, " : "",
|
||||||
} else if (use_100rel) {
|
use_timer ? "timer, " : ""
|
||||||
supported = "100rel, precondition";
|
);
|
||||||
} else if (use_timer) {
|
|
||||||
supported = "timer, precondition";
|
|
||||||
} else {
|
|
||||||
supported = "precondition";
|
|
||||||
}
|
|
||||||
|
|
||||||
profile->nua = nua_create(profile->s_root, /* Event loop */
|
profile->nua = nua_create(profile->s_root, /* Event loop */
|
||||||
sofia_event_callback, /* Callback for processing events */
|
sofia_event_callback, /* Callback for processing events */
|
||||||
|
@ -669,8 +669,15 @@ char *sofia_overcome_sip_uri_weakness(switch_core_session_t *session, const char
|
|||||||
{
|
{
|
||||||
char *stripped = switch_core_session_strdup(session, uri);
|
char *stripped = switch_core_session_strdup(session, uri);
|
||||||
char *new_uri = NULL;
|
char *new_uri = NULL;
|
||||||
|
char *p;
|
||||||
|
|
||||||
stripped = sofia_glue_get_url_from_contact(stripped, 0);
|
stripped = sofia_glue_get_url_from_contact(stripped, 0);
|
||||||
|
|
||||||
|
/* remove our params so we don't make any whiny moronic device piss it's pants and forget who it is for a half-hour */
|
||||||
|
if ((p = (char *)switch_stristr(";fs_", stripped))) {
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (transport && transport != SOFIA_TRANSPORT_UDP) {
|
if (transport && transport != SOFIA_TRANSPORT_UDP) {
|
||||||
|
|
||||||
if (switch_stristr("port=", stripped)) {
|
if (switch_stristr("port=", stripped)) {
|
||||||
@ -1066,7 +1073,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
|||||||
TAG_END());
|
TAG_END());
|
||||||
|
|
||||||
|
|
||||||
if (strstr(tech_pvt->dest, ";nat") || strstr(tech_pvt->dest, ";received")
|
if (strstr(tech_pvt->dest, ";fs_nat") || strstr(tech_pvt->dest, ";received")
|
||||||
|| ((val = switch_channel_get_variable(channel, "sip_sticky_contact")) && switch_true(val))) {
|
|| ((val = switch_channel_get_variable(channel, "sip_sticky_contact")) && switch_true(val))) {
|
||||||
switch_set_flag(tech_pvt, TFLAG_NAT);
|
switch_set_flag(tech_pvt, TFLAG_NAT);
|
||||||
tech_pvt->record_route = switch_core_session_strdup(tech_pvt->session, url_str);
|
tech_pvt->record_route = switch_core_session_strdup(tech_pvt->session, url_str);
|
||||||
@ -1165,9 +1172,11 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
|||||||
|
|
||||||
call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id");
|
call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id");
|
||||||
|
|
||||||
if ((route = strstr(tech_pvt->dest, ";path="))) {
|
if ((route = strstr(tech_pvt->dest, ";fs_path="))) {
|
||||||
char *p;
|
char *p;
|
||||||
route = switch_core_session_strdup(tech_pvt->session, route + 6);
|
|
||||||
|
route = switch_core_session_strdup(tech_pvt->session, route + 9);
|
||||||
|
|
||||||
for (p = route; p && *p ; p++) {
|
for (p = route; p && *p ; p++) {
|
||||||
if (*p == '>' || *p == ';') {
|
if (*p == '>' || *p == ';') {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
@ -1187,8 +1196,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
|
|||||||
|
|
||||||
route_uri = sofia_overcome_sip_uri_weakness(tech_pvt->session, route_uri, 0, SWITCH_TRUE, NULL);
|
route_uri = sofia_overcome_sip_uri_weakness(tech_pvt->session, route_uri, 0, SWITCH_TRUE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
nua_invite(tech_pvt->nh,
|
nua_invite(tech_pvt->nh,
|
||||||
NUTAG_AUTOANSWER(0),
|
NUTAG_AUTOANSWER(0),
|
||||||
|
@ -462,8 +462,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||||||
path_val = sip_header_as_string(nh->nh_home, (void *) sip->sip_path);
|
path_val = sip_header_as_string(nh->nh_home, (void *) sip->sip_path);
|
||||||
path_encoded_len = (strlen(path_val) * 3) + 1;
|
path_encoded_len = (strlen(path_val) * 3) + 1;
|
||||||
switch_zmalloc(path_encoded, path_encoded_len);
|
switch_zmalloc(path_encoded, path_encoded_len);
|
||||||
switch_copy_string(path_encoded, ";path=", 7);
|
switch_copy_string(path_encoded, ";fs_path=", 10);
|
||||||
switch_url_encode(path_val, path_encoded + 6, path_encoded_len - 6);
|
switch_url_encode(path_val, path_encoded + 9, path_encoded_len - 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (port) {
|
if (port) {
|
||||||
@ -477,10 +477,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||||||
if (contact->m_url->url_params) {
|
if (contact->m_url->url_params) {
|
||||||
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s%s;%s%s%s%s>",
|
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s%s;%s%s%s%s>",
|
||||||
display, contact->m_url->url_user, contact_host, new_port,
|
display, contact->m_url->url_user, contact_host, new_port,
|
||||||
contact->m_url->url_params, received_data, is_nat ? ";nat=yes" : "", path_encoded ? path_encoded : "");
|
contact->m_url->url_params, received_data, is_nat ? ";fs_nat=yes" : "", path_encoded ? path_encoded : "");
|
||||||
} else {
|
} else {
|
||||||
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s%s%s%s%s>", display, contact->m_url->url_user, contact_host, new_port,
|
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s%s%s%s%s>", display, contact->m_url->url_user, contact_host, new_port,
|
||||||
received_data, is_nat ? ";nat=yes" : "", path_encoded ? path_encoded : "");
|
received_data, is_nat ? ";fs_nat=yes" : "", path_encoded ? path_encoded : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_safe_free(path_encoded);
|
switch_safe_free(path_encoded);
|
||||||
@ -532,10 +532,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
|
|||||||
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) {
|
||||||
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d;%s%s;nat=yes>",
|
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d;%s%s;fs_nat=yes>",
|
||||||
display, contact->m_url->url_user, network_ip, network_port, contact->m_url->url_params, received_data);
|
display, contact->m_url->url_user, network_ip, network_port, contact->m_url->url_params, received_data);
|
||||||
} else {
|
} else {
|
||||||
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d%s;nat=yes>", display, contact->m_url->url_user, network_ip,
|
switch_snprintf(contact_str, sizeof(contact_str), "%s <sip:%s@%s:%d%s;fs_nat=yes>", display, contact->m_url->url_user, network_ip,
|
||||||
network_port, received_data);
|
network_port, received_data);
|
||||||
}
|
}
|
||||||
if (strstr(v_contact_str, "tls")) {
|
if (strstr(v_contact_str, "tls")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user