<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
        {mso-style-name:x_msonormal;
        margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Johan,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think you must have left some pieces out of your initial description then. You stated that node A is sending directly to your OpenSIPS node, so the source IP and Via would both point to node A.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">As I mentioned, changes to Contact and Record-Route headers will only affect the routing of sequential requests for the dialog. They will not impact the routing of responses. I don’t think that OpenSIPS provides any mechanism to change
 the destination of responses it proxies, since as you said this is outside of the RFC.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:black">Ben Newlin</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.opensips.org> on behalf of Johan De Clercq <johan@democon.be><br>
<b>Date: </b>Saturday, October 7, 2023 at 1:40 AM<br>
<b>To: </b>OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Subject: </b>Re: [OpenSIPS-Users] on routing invite's in a trunk context.<o:p></o:p></span></p>
</div>
<div>
<div>
<table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none">
<tbody>
<tr>
<td style="border:solid #B60000 1.0pt;background:white;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:#B60000"> EXTERNAL EMAIL - Please use caution with links and attachments <o:p></o:p></span></b></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Helvetica;color:black"><o:p> </o:p></span></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="0" width="100%" align="center">
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">It’s a very non rfc scenario. Source ip and via are the ip of a loadbalancer that I need to skip …. ;-(. The contact does have the correct ip. Anyway, you gave me a good hint. I will add the contact ip as record route and see what that
 gives.<o:p></o:p></p>
</div>
</div>
<div id="ms-outlook-mobile-signature">
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Verzonden vanuit <a href="https://aka.ms/o0ukef">
Outlook voor iOS</a><o:p></o:p></p>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">Van:</span></b><span style="color:black"> Users <users-bounces@lists.opensips.org> namens Ben Newlin <Ben.Newlin@genesys.com><br>
<b>Verzonden:</b> Friday, October 6, 2023 5:35:40 PM<br>
<b>Aan:</b> OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Onderwerp:</b> Re: [OpenSIPS-Users] on routing invite's in a trunk context.</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xmsonormal"><span style="font-size:11.0pt">Johan,</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt">This is actually a pretty standard SIP flow that we use all the time. I recommend this article [1] for an overview of how routing works in SIP.
</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt">In short, the Contact and Record-Route headers are only used for routing of requests not responses, and mostly only sequential requests which are requests within a dialog. The topology_hiding_match and loose_route
 functions both operate on requests only, so they can both only be called from a request_route [1] [2].</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt">The 200 OK is a response within the initial INVITE transaction. Responses within a SIP transaction are routed based on the source IP of request and/or the Via headers. OpenSIPS should just handle that for
 you, unless you have some strange routing.</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt">[1] <a href="https://kb.smartvox.co.uk/opensips/contact-and-record-route-headers-explained/">
https://kb.smartvox.co.uk/opensips/contact-and-record-route-headers-explained/</a></span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt">[2] <a href="https://opensips.org/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match">
https://opensips.org/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match</a></span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt">[3] <a href="https://opensips.org/docs/modules/3.2.x/rr.html#func_loose_route">
https://opensips.org/docs/modules/3.2.x/rr.html#func_loose_route</a></span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div>
<p class="xmsonormal"><span style="font-size:11.0pt;color:black">Ben Newlin</span><o:p></o:p></p>
</div>
<p class="xmsonormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div id="x_mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="xmsonormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.opensips.org> on behalf of johan <johan@democon.be><br>
<b>Date: </b>Friday, October 6, 2023 at 10:30 AM<br>
<b>To: </b>OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Subject: </b>[OpenSIPS-Users] on routing invite's in a trunk context.</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt"> EXTERNAL EMAIL - Please use caution with links and attachments <br>
<br>
This is a general question on routing (to be honest: it is a really <br>
strange case).<br>
<br>
<br>
A has a sip trunk to B (opensips), B has a sip trunk to C<br>
<br>
<br>
<br>
A sends an invite to B with contact header A'   and record-route header <br>
to A''<br>
<br>
B string the record_route header , calls topology hiding and droutes the <br>
call to C<br>
<br>
C sends 200 OK back but it needs to be routed on the content of the <br>
contact header.<br>
<br>
<br>
Now how does this route to A ?   Is this the default <br>
topology_hiding_match() case ? Or do I need to do something special ?<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
Users@lists.opensips.org<br>
</span><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"><span style="font-size:11.0pt">https://protect-us.mimecast.com/s/8fzVCG6Q9Ni160o8YuKJzbj?domain=lists.opensips.org</span></a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>