MT#58584 Do not add outbound_proxy in Route if exist

When outbound PRACK is challanged, SEMS is regenerating
the PRACK to proxy duplicating the proxy socket in the
Route header, with the result of:

Route: <sip:127.0.0.1:5062;lr>,
<sip:127.0.0.1:5062;lr=on;ftag=xyz;leg_b=1;did=f85.d281>,
<sip:127.0.0.1;r2=on;lr=on;ftag=xyz;ngcplb=yes>,
<sip:192.168.178.104;r2=on;lr=on;ftag=xyz;ngcplb=yes>

the duplicate "127.0.0.1:5062" is causing routing
issue on proxy, cause loose_route() function removes
only the first element. Then proxy sends PRACK to
itself.

To avoid that, we make sure is SEMS to do not add
the 'outbound_socket' value in the Route header
if that value already exist in the first position.

Change-Id: Id310144d8e77a99111e199358462496c9dd0495c
mr12.1.1
Daniel Grotti 3 years ago
parent 83634a216e
commit f56366737c

@ -129,8 +129,17 @@ string AmBasicSipDialog::getContactUri()
string AmBasicSipDialog::getRoute()
{
string res;
string route_first_element;
if(!outbound_proxy.empty() && (force_outbound_proxy || remote_tag.empty())){
if (!route.empty()) {
route_first_element = route.substr(0, route.find(','));
}
// Do no add outbound_proxy if it's already the top most Route
if(!outbound_proxy.empty() &&
(force_outbound_proxy || remote_tag.empty()) &&
route_first_element.find(outbound_proxy) == std::string::npos)
{
res += "<" + outbound_proxy + ";lr>";
if(!route.empty()) {

Loading…
Cancel
Save