<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">What is in $du if you log it right after handle_ruri_alias()?
<div>Maybe you overwrite it somewhere later?</div>
</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
Regards, Igor</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">On Sep 1, 2018, 7:34 PM +0200, Wilkins, Steve <swwilkins@mitre.org>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div class="WordSection1">
<p class="MsoNormal">Thank you Joel,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">My issue is that, given the Incoming Request: [[BYE <a href="http://sip:2406506175@20.20.20.20:5060" target="_blank">sip:2406506175@20.20.20.20:5060</a>;<b>alias=10.10.10.5~55157</b>~2 SIP/2.0<b>.  I want to route the BYE to the alias 10.10.10.5:55157</b>.  I have tried the combination you spoke of and it always still get routed to <b>20.20.20.20.5060</b>.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I have even tried storing the original Via from the INVITE and using that in the BYE, however, I get a variable to maintain it’s state.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks again,</p>
<p class="MsoNormal">-Steve</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> <b>On Behalf Of</b> Joel Serrano<br />
<b>Sent:</b> Saturday, September 1, 2018 10:43 AM<br />
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br />
<b>Subject:</b> Re: [SR-Users] handle_ruri_alias() question or issue?</p>
<p class="MsoNormal"> </p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">I think you are mixing 2 different approaches of achieving the same:</p>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">1- Use: fix_nated_contact() --> Will *modify* the contact header and *replace* current ip:port with correct ip:port.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">2- Use: set_contact_alias() in conjunction with handle_ruri_alias() --> <span style="font-size:12.0pt;background:white">set_contact_alias w</span>ill *add an alias* with correct ip:port but will not *modify* the current ip:port sent by the UAC.  <span style="font-size:12.0pt;background:white">handle_ruri_alias wi</span>ll search for an alias in the RURI and if found, it will remove it and *set $du accordingly*.You will not see the contact with correct ip:port in RURI but routing will be sent to correct ip:port ($du).</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">This is a high level explanation, but I hope it helps you understand what is going on. If you print $du in the logs after calling <span style="font-size:12.0pt;background:white">handle_ruri_alias() you should see what you expect (if you previously called set_contact_alias)... Or you can call set_contact_alias on not call handle_ruri_alias. Two ways of doing the same.</span></p>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal">On Sat, Sep 1, 2018 at 04:47 Wilkins, Steve <<a href="mailto:swwilkins@mitre.org" target="_blank">swwilkins@mitre.org</a>> wrote:</p>
</div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Good Morning All,</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">The following Incoming request came in =></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">SIP Incoming Request: [[BYE <a href="http://sip:2406506175@20.20.20.20:5060" target="_blank">sip:2406506175@20.20.20.20:5060</a>;<b>alias=10.10.10.5~55157</b>~2 SIP/2.0</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I called <b>handle_ruri_alias(),</b> and expected the destination and port to be set to <b><a href="http://10.10.10.5:55157" target="_blank">10.10.10.5:55157</a></b>, but it was not.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It was left <a href="http://20.20.20.20:5060" target="_blank">20.20.20.20:5060</a>.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is my thinking correct or is there another way to set the destination and port to the alias?</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks All!,</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-Steve</p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br />
Kamailio (SER) - Users Mailing List<br />
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br />
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br />
Kamailio (SER) - Users Mailing List<br />
sr-users@lists.kamailio.org<br />
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users<br /></blockquote>
</div>
</body>
</html>