提交 fc4d290c authored 作者: Michael Jerris's avatar Michael Jerris

add support for NDLB-force-rport=safe param that does force-rport behavior only…

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
上级 4706d394
Tue Nov 2 17:57:25 CDT 2010 Wed Nov 3 11:46:27 EDT 2010
...@@ -1674,7 +1674,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags) ...@@ -1674,7 +1674,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
progress = 60 * 1000; progress = 60 * 1000;
agent->sa_progress = progress; agent->sa_progress = progress;
if (server_rport > 2) if (server_rport > 3)
server_rport = 1; server_rport = 1;
else if (server_rport < 0) else if (server_rport < 0)
server_rport = 1; server_rport = 1;
...@@ -3084,7 +3084,9 @@ int agent_check_request_via(nta_agent_t *agent, ...@@ -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)); rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
msg_header_replace_param(msg_home(msg), v->v_common, rport); 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)); rport = su_sprintf(msg_home(msg), "rport=%u", ntohs(from->su_port));
msg_header_replace_param(msg_home(msg), v->v_common, rport); msg_header_replace_param(msg_home(msg), v->v_common, rport);
} }
......
...@@ -2414,7 +2414,9 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) ...@@ -2414,7 +2414,9 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
profile->dtmf_type = DTMF_NONE; profile->dtmf_type = DTMF_NONE;
} }
} else if (!strcasecmp(var, "NDLB-force-rport")) { } 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; profile->rport_level = 2;
} }
} else if (!strcasecmp(var, "caller-id-type")) { } else if (!strcasecmp(var, "caller-id-type")) {
...@@ -3083,7 +3085,9 @@ switch_status_t config_sofia(int reload, char *profile_name) ...@@ -3083,7 +3085,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
profile->dtmf_type = DTMF_NONE; profile->dtmf_type = DTMF_NONE;
} }
} else if (!strcasecmp(var, "NDLB-force-rport")) { } 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; profile->rport_level = 2;
} }
} else if (!strcasecmp(var, "auto-rtp-bugs")) { } else if (!strcasecmp(var, "auto-rtp-bugs")) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论