<div dir="ltr"><div>I`ve solved this issue. The condition <font size="2">if ($Ru == «<b>udp</b>:10.130.0.23:5070») was wrong.<br></font></div><div><br></div><div>Here is the correct code:</div><div><br></div><div> if ($Ru eq "sip:<a href="http://10.130.0.23:5070">10.130.0.23:5070</a>") {<br> $fs = "udp:<a href="http://10.130.0.23:5060">10.130.0.23:5060</a>";<br> } else {<br> $fs = "udp:<a href="http://10.130.0.23:5070">10.130.0.23:5070</a>";<br> }</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">пт, 1 июл. 2022 г. в 15:17, Алексей Якимкин <<a href="mailto:ayakimkin@gmail.com">ayakimkin@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>Are you ips (LAN_IP and WAN_IP) on sepparate interfaces?<br></div><div><br></div><div>I use add_path for Register requests. It insert header Path: <sip:10.130.0.23:5070;lr></div><div><br></div><div>My pbx calls to User-Agent throught <a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a>. INVITE(from kamailio) go out to internet from <a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a></div><div><br></div><div>This line <font size="2">"$fs = «udp:10.130.0.23:5060»;" <span lang="en"><span><span>don`t work, It produces an error:</span></span></span></font></div><div><font size="2"><font size="2">(pv [pv_branch.c:62]: pv_get_branchx_helper(): error accessing branch [0])</font></font></div><div><font size="2"><br></font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 29 июн. 2022 г. в 18:55, ZZ Wave <<a href="mailto:zzwave@gmail.com" target="_blank">zzwave@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I use this with NATed Kamailio and Asterisk for "transparent" registrations:<div><br></div><div> if (is_method("REGISTER")) {<br> add_path();<br> }<br> if ($Ri=="LAN_IP") {<br> $fs="udp:WAN_IP:5060";<br> } else {<br> $fs="udp:LAN_IP:5060";<br> }</div><div><br></div><div>AFAIK FreeSwitch supports Path as well but Yate doesn't<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 29 июн. 2022 г. в 12:25, Алексей Якимкин <<a href="mailto:ayakimkin@gmail.com" target="_blank">ayakimkin@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I have kamailio in local network behind NAT. Kamailio have one interface eth1 with ip <font size="2">10.130.0.23</font></div><div><font size="2"><br></font></div><div><font size="2">UserAgent - (internet) - (<font size="2">178.0.0.169)</font>router_with_NAT - (LAN) - kamailio+rtpproxy - pbx</font></div><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2">I made two listeners:<br>listen=udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a> #to pbx in lan (I don`t want to put via header with <font size="2">178.0.0.169</font>)<br>listen=udp:<a href="http://10.130.0.23:5060" target="_blank">10.130.0.23:5060</a> advertise <a href="http://178.0.0.169:5060" target="_blank">178.0.0.169:5060</a> #to internet (UserAgent need to get via header with <font size="2">178.0.0.169</font> )</font><br></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2"><br>mhomed = 1 # I think It not useful for my case<br></font></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left">UserAgent send Register and Invite to <font size="2"><a href="http://178.0.0.169:5060" target="_blank">178.0.0.169:5060</a>, Kamailio get it on </font><font size="2">udp:<a href="http://10.130.0.23:5060" target="_blank">10.130.0.23:5060</a></font></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2">Kamailio Relay it to udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a> </font><br></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2">My pbx get requests from udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a> with via header 10.130.0.23</font><br></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left">Responses to UserAgent go from <font size="2"> udp:<a href="http://10.130.0.23:5060" target="_blank">10.130.0.23:5060</a> with via 178.0.0.169</font> <br></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2"></font><br></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2">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>}</font></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2"></font></p><font size="2"></font><p><span>route</span><span>[REGISTRAR]</span><span> {</span><br></p><p><span><span> </span>if ($rd == "<a href="http://mydomain.ru" target="_blank">mydomain.ru</a>" || $rd == "<a href="http://mydomain2.ru" target="_blank">mydomain2.ru</a>") {</span></p><p><span><span> </span>set_send_socket("udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a>")</span><span>;</span></p><p><span> }</span><br></p><p><span>}</span><br></p><p><br><span></span></p><p>It works for requests from UserAgent to PBX. But INVITE from my pbx to UserAgent goes only through <font size="2">udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a> , Kamailio realy it to internet from <font size="2">udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a> </font> </font></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><font size="2">I get error in syslog: (pv [pv_branch.c:62]: pv_get_branchx_helper(): error accessing branch [0])</font></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left">I tried <font size="2">set_send_socket(«udp:10.130.0.23:5070»); and $fs = «udp:10.130.0.23:5070»;</font></p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left">Why I can`t relay outgoing requests to internet through another socket? </p><p style="background-color:rgb(255,255,255);border:medium none;color:rgb(0,0,0);padding:0px;text-align:left"><br></p><div>-- <br><div dir="ltr"><pre style="font-family:courier,"courier new",monospace;font-size:14px;white-space:pre-wrap;margin:0px;color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Best regards,
Alex</pre></div></div></div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
* <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
* <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">С уважением,<br>Якимкин Алексей</div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">С уважением,<br>Якимкин Алексей</div>