Commit e341adcc authored by Michael Jerris's avatar Michael Jerris Committed by Pekka Pessi

nta: add NTATAG_SERVER_RPORT(3)

Add NTATAG_SERVER_RPORT() value 3 that only forces rport behavior on
UA's we know it will work on (currently, Polycom).
parent 0c15f269
......@@ -1673,7 +1673,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;
......@@ -3085,7 +3085,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 &&
su_casenmatch(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);
}
......
......@@ -1343,6 +1343,8 @@ tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport);
* or false (zero or NULL pointer)
*
* @par Values
* - 3 - add "rport" parameter even if was not present in request
* @b and if client User-Agent is "Polycom"
* - 2 - add "rport" parameter even if was not present in request
* - 1 - use "rport" parameter (default)
* - 0 - do not use "rport" parameter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment