<div dir="ltr"><span style="font-size:12.8px">msg_apply_changes()  worked nicely, thanks guys</span><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 11, 2017 at 10:45 AM, Charles Chance <span dir="ltr"><<a href="mailto:charles.chance@sipcentric.com" target="_blank">charles.chance@sipcentric.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Hello,<div><div class="h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On 11 Oct 2017 10:16 a.m., "Daniel Tryba" <<a href="mailto:d.tryba@pocos.nl" target="_blank">d.tryba@pocos.nl</a>> wrote:<br type="attribution"><blockquote class="m_-5400722937345849988quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-5400722937345849988quoted-text">On Tue, Oct 10, 2017 at 11:36:56PM +0100, Marrold wrote:<br>
> I've included add_path_received() in my REGISTRAR routing block, however I<br>
> see 'Path: [not set]' in the USRLOC table.<br>
><br>
> Is it possible to force the insertion of the local proxy into the path<br>
> field?<br>
<br>
</div>Like Daniel already mentioned, add the header and msg_apply_changes()<br>
For example:<br>
<a href="https://lists.kamailio.org//pipermail/sr-users/2015-April/087872.html" rel="noreferrer" target="_blank">https://lists.kamailio.org//pi<wbr>permail/sr-users/2015-April/08<wbr>7872.html</a><br>
<div class="m_-5400722937345849988quoted-text"><br>
> One additional question, in the case of NAT keepalives, is it possible to<br>
> only send these from the proxy the received the register request?<br>
<br>
</div>I decided to not use kamailio itself for sending these OPTIONS but to<br>
use a simple script that queries the database and simply opens a<br>
connection to the local kamailio. Mainly because I needed to monitor<br>
some UAC and alert when it wasn't reachable (even though it is present<br>
in location). In your case select the approriate UACs on Path.<br>
<br>
  while($location=mysql_fetch_as<wbr>soc($res))<br>
  {<br>
    usleep(1000);<br>
    $branch=uniqid();<br>
    $send[$location['id']]=0;<br>
    $dst=preg_replace('/.*@([^;]+)<wbr>;.*/',"$1",$location['path']);<br>
    $dst=explode(':',$dst);<br>
    if(count($dst)<2)<br>
    {<br>
      $dst[1]=5060;<br>
    }<br>
    $str=<<<EOS<br>
OPTIONS {$location['contact']} SIP/2.0\r<br>
Via: SIP/2.0/UDP 127.0.1.1:$listenport;branch=$<wbr>branch;rport;alias\r<br>
Route: {$location['path']}\r<br>
From: sip:pinger@localhost;tag={$loc<wbr>ation['ruid']}\r<br>
To: {$location['contact']}\r<br>
Call-ID: {$location['id']}-$listenport-<wbr>$uid@localhost\r<br>
CSeq: 1 OPTIONS\r<br>
Content-Length: 0\r<br>
\r<br>
<br>
EOS;<br>
    socket_sendto($sock,$str,strle<wbr>n($str),MSG_EOR,$dst[0],$dst[<wbr>1]);<br>
<div class="m_-5400722937345849988elided-text"></div></blockquote></div></div></div></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Just to add, another option is to use the nat_traversal module: <a href="https://kamailio.org/docs/modules/stable/modules/nat_traversal.html" target="_blank">https://kamailio.org/<wbr>docs/modules/stable/modules/<wbr>nat_traversal.html</a>. We use it for this very reason.</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto"><br></div><div dir="auto">Charles</div><div dir="auto"><br></div></div>

<br>
<div><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font><span style="font-size:10pt;font-family:Helvetica,Arial,sans-serif"> </span><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></div><br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>