<p></p>
<p dir="auto">Hello,</p>
<p dir="auto">I have  kamailio in local network behind NAT. Kamailio have one interface eth1 with ip 10.130.0.23</p>
<p dir="auto">UserAgent - (internet) - (178.0.0.169)router_NAT - (LAN) - (10.130.0.23)kamailio+rtpproxy - pbx</p>
<p dir="auto">I made two listeners:<br>
listen=udp:<a href="http://10.130.0.23:5070/" rel="nofollow">10.130.0.23:5070</a> #to pbx in lan (I don`t want to put via header with 178.0.0.169)<br>
listen=udp:<a href="http://10.130.0.23:5060/" rel="nofollow">10.130.0.23:5060</a> advertise <a href="http://178.0.0.169:5060/" rel="nofollow">178.0.0.169:5060</a> #to internet (UserAgent need to get via header with 178.0.0.169  )</p>
<p dir="auto">mhomed = 1 # I think It not useful  for my case</p>
<p dir="auto">UserAgent send Register and Invite to <a href="http://178.0.0.169:5060/" rel="nofollow">178.0.0.169:5060</a>, Kamailio get it on udp:<a href="http://10.130.0.23:5060/" rel="nofollow">10.130.0.23:5060</a></p>
<p dir="auto">Kamailio Relay it to   udp:<a href="http://10.130.0.23:5070/" rel="nofollow">10.130.0.23:5070</a></p>
<p dir="auto">My pbx get requests from  udp:<a href="http://10.130.0.23:5070/" rel="nofollow">10.130.0.23:5070</a> with via header 10.130.0.23</p>
<p dir="auto">Responses to UserAgent go from  udp:<a href="http://10.130.0.23:5060/" rel="nofollow">10.130.0.23:5060</a> with via 178.0.0.169</p>
<p dir="auto">In  RELAY block:<br>
if ($Ru == «udp:10.130.0.23:5070») {<br>
#set_send_socket(«udp:10.130.0.23:5060»);<br>
$fs = «udp:10.130.0.23:5060»;<br>
#force_send_socket(«udp:10.130.0.23:5060»);<br>
} else {<br>
#set_send_socket(«udp:10.130.0.23:5070»);<br>
$fs = «udp:10.130.0.23:5070»;<br>
}<br>
#$fs = «udp:10.130.0.23:5070»;<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
}</p>
<p dir="auto">route[REGISTRAR] {<br>
...<br>
if ($rd == "<a href="http://mydomain.ru/" rel="nofollow">mydomain.ru</a>" || $rd == "<a href="http://mydomain2.ru/" rel="nofollow">mydomain2.ru</a>") {</p>
<pre class="notranslate"><code class="notranslate">      set_send_socket("udp:[10.130.0.23:5070](http://10.130.0.23:5070/)");
      add_path();
      route(DISPATCH);
     }
</code></pre>
<p dir="auto">...<br>
}</p>
<p dir="auto">It works for requests (INVITE and REGISTER) from UserAgent to PBX thought kamailio. But INVITE from my pbx to UserAgent go out only through udp:10.130.0.23:5070,  Kamailio realy it to internet from udp:10.130.0.23:5070</p>
<p dir="auto">I get error in syslog:  (pv [pv_branch.c:62]: pv_get_branchx_helper(): error accessing branch [0])</p>
<p dir="auto">I tried set_send_socket(«udp:10.130.0.23:5070»); and $fs = «udp:10.130.0.23:5070»;</p>
<p dir="auto">Why I can`t relay outgoing requests to internet through another socket?</p>
<p dir="auto">Thank you.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3173">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZP6CLXCPC5QQ4NFKVTVR3KDRANCNFSM52MOI6YA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZK2INZLDFCOH2SI6BLVR3KDRA5CNFSM52MOI6YKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4THXTAEQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3173</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3173",
"url": "https://github.com/kamailio/kamailio/issues/3173",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>