add support for NDLB-force-rport=safe param that does force-rport behavior only on endpoints we know are safe to do so on. This is a dirty hack to try to work with certain endpoints behind sonicwall which does not use the same port when it does nat, when the devices do not support rport, while not breaking devices that acutally use different ports that force-rport will break

This commit is contained in:
Michael Jerris 2010-11-03 11:53:39 -04:00
parent 4706d3946d
commit fc4d290cb7
3 changed files with 11 additions and 5 deletions

View File

@ -1 +1 @@
Tue Nov 2 17:57:25 CDT 2010
Wed Nov 3 11:46:27 EDT 2010

View File

@ -1674,7 +1674,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
progress = 60 * 1000;
agent->sa_progress = progress;
if (server_rport > 2)
if (server_rport > 3)
server_rport = 1;
else if (server_rport < 0)
server_rport = 1;
@ -3084,7 +3084,9 @@ int agent_check_request_via(nta_agent_t *agent,
rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
msg_header_replace_param(msg_home(msg), v->v_common, rport);
}
else if (agent->sa_server_rport == 2) {
else if (agent->sa_server_rport == 2 ||
(agent->sa_server_rport == 3 && sip && sip->sip_user_agent &&
sip->sip_user_agent->g_string && !strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7))) {
rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
msg_header_replace_param(msg_home(msg), v->v_common, rport);
}

View File

@ -2414,7 +2414,9 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
profile->dtmf_type = DTMF_NONE;
}
} else if (!strcasecmp(var, "NDLB-force-rport")) {
if (switch_true(val)) {
if (val && !strcasecmp(val, "safe")) {
profile->rport_level = 3;
} else if (switch_true(val)) {
profile->rport_level = 2;
}
} else if (!strcasecmp(var, "caller-id-type")) {
@ -3083,7 +3085,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
profile->dtmf_type = DTMF_NONE;
}
} else if (!strcasecmp(var, "NDLB-force-rport")) {
if (switch_true(val)) {
if (val && !strcasecmp(val, "safe")) {
profile->rport_level = 3;
} else if (switch_true(val)) {
profile->rport_level = 2;
}
} else if (!strcasecmp(var, "auto-rtp-bugs")) {