<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=utf-8">
<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:"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:0cm;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:12.0pt;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-AU" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">Hi Everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">I am trying to add DMQ for redundancy of registrations and USRLOC, and I’m trying to send calls to the correct SBC that is the original registrar for a handset. I’ve been using the thread here
 where Charles gave some guidance on how to use path to store and use the original SBC:
<a href="https://lists.kamailio.org/pipermail/sr-users/2018-February/100246.html">
https://lists.kamailio.org/pipermail/sr-users/2018-February/100246.html</a> and  <a href="https://lists.kamailio.org/pipermail/sr-users/2013-September/079736.html">https://lists.kamailio.org/pipermail/sr-users/2013-September/079736.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">I am struggling with when to decide to modify the destination URI. My testing shows this is required otherwise some handsets will ignore the invite, but right now I am doing it in a blanket form,
 right before SIPOUT (which is where the origin SBC handles the invite instead of LOCATION). I am sure this is being too heavy-handed though and there are some cases where I won’t want to set this, but I am not sure which?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        # record routing for dialog forming requests (in case they are routed)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        # - remove preloaded route headers<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        remove_hf("Route");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        if (is_method("INVITE|SUBSCRIBE")) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">                record_route();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        xlog("Setting du according to path. Current du is $du\n");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        xlog("Current route header: $(hdr(Route))\n");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        xlog("Current route: $(hdr(Route){uri.host})\n");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">>>>        $du = $(hdr(Route){param.value,received});<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        #xlog("New du destination uri is: $du\n");
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        # dispatch requests to foreign domains<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt">        route(SIPOUT);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB">In the linked threads, Charles mentioned that only the last-hop registrar should make this change, but what’s the best way to determine if I am on the last-hop registrar?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB">As per the snippet above, I tried using the {uri.host} transformation to extract the origin SBC’s IP from the route header. My plan is to then compare this against “myself”
 but I am struggling to extract the right info from the route header. And I am not even sure if this is the right general approach?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB">The route header looks like this:
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black;background:white;mso-fareast-language:EN-GB"><sip:ORIGIN_SBC_IP:5060;received=sip:UAC_WAN_IP:2048;lr></span><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB">Any guidance or examples would be appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black;mso-fareast-language:EN-GB">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-GB" style="font-size:11.0pt;color:black"><br>
<b>Rhys Hanrahan</b> | Chief Information Officer<br>
<b>e:</b> <a href="mailto:rhys@nexusone.com.au"><span style="color:#0563C1">rhys@nexusone.com.au</span></a>  <br>
<br>
</span><span lang="EN-GB"><a href="http://www.nexusone.com.au/"><span style="font-size:11.0pt;color:black;text-decoration:none"><img border="0" width="229" height="57" style="width:2.3854in;height:.5937in" id="Picture_x0020_2" src="cid:image001.png@01D7E55E.E6C70C50" alt="www.nexusone.com.au"></span></a></span><span lang="EN-GB" style="font-size:11.0pt;color:black">   </span><span lang="EN-GB"><a href="http://www.fusiontech.com.au/"><span style="font-size:11.0pt;color:black;text-decoration:none"><img border="0" width="197" height="59" style="width:2.052in;height:.6145in" id="Picture_x0020_1" src="cid:image002.png@01D7E55E.E6C70C50" alt="signature_555064778"></span></a></span><span lang="EN-GB" style="color:black"><br>
</span><b><span lang="EN-GB" style="color:#0070C0"><br>
</span></b><b><span lang="EN-GB" style="color:#1F4E79">NEXUS ONE</span></b><b><span lang="EN-GB" style="color:#0070C0"> </span></b><b><span lang="EN-GB" style="color:black">|</span></b><b><span lang="EN-GB" style="color:#0070C0"> FUSION TECHNOLOGY SOLUTIONS</span></b><b><span lang="EN-GB" style="font-size:11.0pt;color:#0070C0"><br>
</span></b><b><span lang="EN-GB" style="font-size:11.0pt;color:black">p:</span></b><span lang="EN-GB" style="font-size:11.0pt;color:black"> 1800 NEXUS1 (1800 639 871) or 1800 565 845 <b>|</b> <b>a:</b> Suite 12.03 Level 12, 227 Elizabeth Street, Sydney NSW
 2000<br>
<a href="http://www.nexusone.com.au/"><span style="color:#0563C1">www.nexusone.com.au</span></a> <b>|</b> <a href="http://www.fusiontech.com.au/"><span style="color:#0563C1">www.fusiontech.com.au</span></a><br>
<br>
</span><i><span lang="EN-GB" style="font-size:9.0pt;color:#767171">The information in this email and any accompanying attachments may contain; a. Confidential information of Fusion Technology Solutions Pty Ltd, Nexus One Pty Ltd or third parties; b. Legally
 privileged information of Fusion Technology Solutions Pty Ltd, Nexus One Pty Ltd or third parties; and or c. Copyright material Fusion Technology Solutions Pty Ltd, Nexus One Pty Ltd or third parties. If you have received this email in error, please notify
 the sender immediately and delete this message. Fusion Technology Solutions Pty Ltd, Nexus One Pty Ltd does not accept any responsibility for loss or damage arising from the use or distribution of this email.</span></i><span lang="EN-GB" style="font-size:10.0pt;color:black"><br>
<br>
</span><i><span lang="EN-GB" style="font-size:8.0pt;color:#1F4E79;mso-fareast-language:EN-GB">Please consider the environment before printing this email.</span></i><span style="color:black;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
</div>
</body>
</html>