<div dir="ltr"><div>Hello,</div><div><br></div><div>Not only do I need force messages from internet to lan through udp:10.130.23:5070 but also I need send messages from lan (udp:10.130.23:5070) to internet (udp:10.130.23:5060). So I make rule with if and $socket_in .</div><div>But Messages (Updates, reInvites) and replies go directly between LAN and 10.130.23:5060 thought. <br></div><div>All messages (input, output, replies) must go between two sockets 10.130.23:5070 <-> 10.130.23:5060 .</div><div> b2b_server_new("server1",$avp(b2b_hdrs), $avp(b2b_hdr_bodies));<br> if ($socket_in == "udp:<a href="http://10.130.0.23:5070">10.130.0.23:5070</a>") {<br> force_send_socket("udp:10.130.23:5060");<br> } else {<br> force_send_socket("udp:10.130.23:5070"); <br> }<br> b2b_client_new("Unistar","<a href="mailto:sip%3A09876543322@provider.com" target="_blank">sip:09876543322@provider.com</a>","sip:provider","test","<a href="mailto:sip%3A1234567@1.1.1.1" target="_blank">sip:1234567@1.1.1.1</a>");<br> #force_send_socket("udp:10.130.23:5070");<br> b2b_init_request("top hiding");<br> exit;<br></div><div><br></div><div>But Updates go from 5060 directly to lan. I made a screenshot you can see by the url <a href="https://drive.google.com/file/d/1bpwmXCB6qRxbDk8KZ6GuCg3-hwfABvwk/view?usp=sharing">https://drive.google.com/file/d/1bpwmXCB6qRxbDk8KZ6GuCg3-hwfABvwk/view?usp=sharing</a></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 23 авг. 2022 г. в 12:44, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</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>
<font face="monospace">Hi Alex,<br>
<br>
Have you tried something like this (for calls from Internet) :<br>
</font><br>
<div>b2b_server_new("server1",$avp(b2b_hdrs), $avp(b2b_hdr_bodies));</div>
<div>force_send_socket("udp:10.130.23:5070");
b2b_client_new("Unistar","<a href="mailto:sip%3A09876543322@provider.com" target="_blank">sip:09876543322@provider.com</a>",<a>"sip:provider"</a>,"test","<a href="mailto:sip%3A1234567@1.1.1.1" target="_blank">sip:1234567@1.1.1.1</a>");<br>
</div>
b2b_init_request("top hiding");<font face="monospace"><br>
<br>
Regards,<br>
</font>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="https://www.opensips-solutions.com" target="_blank">https://www.opensips-solutions.com</a>
OpenSIPS Summit 27-30 Sept 2022, Athens
<a href="https://www.opensips.org/events/Summit-2022Athens/" target="_blank">https://www.opensips.org/events/Summit-2022Athens/</a></pre>
<div>On 8/19/22 6:12 PM, Alex wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hello,</div>
<div><br>
</div>
<div>My opensips is behind NAT in cloud <br>
</div>
<div>internet - (1.1.1.1)Cone_NAT -
port_5060__10.130.0.23(opensips)__port_5070 -
main_registrar_sip_server</div>
<div><br>
</div>
<div>So I made 2 sockets</div>
<div>socket=udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a> # for LAN<br>
socket=udp:<a href="http://10.130.0.23:5060" target="_blank">10.130.0.23:5060</a> as <a href="http://1.1.1.1:5060" target="_blank">1.1.1.1:5060</a>
#for Internet</div>
<div><br>
</div>
<div>I try to make call from lan to Tel provider with using
b2bua.</div>
<div><br>
</div>
<div>Is any way to setup b2bua with more than one socket?<br>
</div>
<div>
<div><br>
</div>
<div>loadmodule "b2b_entities.so"<br>
loadmodule "b2b_logic.so"<br>
modparam("b2b_logic", "custom_headers",
"P-Asserted-Identity") #"User-Agent;Date")<br>
#modparam("b2b_logic", "contact_user", 1)<br>
modparam("b2b_logic", "server_address", "<a href="mailto:sip%3A1234567@1.1.1.1" target="_blank">sip:1234567@1.1.1.1</a>")</div>
<div><br>
</div>
<div><br>
</div>
<div>#force_send_socket("udp:10.130.23:5060"); <br>
</div>
<div>b2b_server_new("server1",$avp(b2b_hdrs),
$avp(b2b_hdr_bodies));</div>
<div>force_send_socket("udp:10.130.23:5060");
b2b_client_new("Unistar","<a href="mailto:sip%3A09876543322@provider.com" target="_blank">sip:09876543322@provider.com</a>",<a>"sip:provider"</a>,"test","<a href="mailto:sip%3A1234567@1.1.1.1" target="_blank">sip:1234567@1.1.1.1</a>");<br>
</div>
#force_send_socket("udp:10.130.23:5070");<br>
b2b_init_request("top hiding");<br>
exit;</div>
<div><br>
</div>
<div>I use this construction in route[relay]. And I`ve tried to
insert in before b2b_server_new. But it didn`t help<br>
</div>
<div>if ($socket_in == "udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a>") {<br>
$socket_out = "udp:<a href="http://10.130.0.23:5060" target="_blank">10.130.0.23:5060</a>";<br>
} else {<br>
$socket_out = "udp:<a href="http://10.130.0.23:5070" target="_blank">10.130.0.23:5070</a>";<br>
}<br>
</div>
<div><br clear="all">
</div>
<div>1) with force_send_socket I made to send requests from
:5070 to :5060 . But my provider`s Udpates and re-Invites go
to my LAN directly from socket :5060 . They don`t go through
:5070</div>
<div>2) I can`t change contact in request to provider. Default
contact looks like this Contact: <a><sip:1.1.1.1 ></a>. I whant
to change to "<a href="mailto:sip%3A1234567@1.1.1.1" target="_blank">sip:1234567@1.1.1.1</a>"</div>
<div><br>
-- <br>
<div dir="ltr">С уважением,<br>
Якимкин Алексей</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">С уважением,<br>Якимкин Алексей</div>