[OpenSIPS-Users] b2bua top hiding behind NAT

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Aug 23 09:43:53 UTC 2022


Hi Alex,

Have you tried something like this (for calls from Internet) :

b2b_server_new("server1",$avp(b2b_hdrs), $avp(b2b_hdr_bodies));
force_send_socket("udp:10.130.23:5070"); 
b2b_client_new("Unistar","sip:09876543322 at provider.com 
<mailto:sip%3A09876543322 at provider.com>","sip:provider","test","sip:1234567 at 1.1.1.1 
<mailto:sip%3A1234567 at 1.1.1.1>");
b2b_init_request("top hiding");

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
   https://www.opensips.org/events/Summit-2022Athens/

On 8/19/22 6:12 PM, Alex wrote:
> Hello,
>
> My opensips is behind NAT in cloud
> internet - (1.1.1.1)Cone_NAT - 
> port_5060__10.130.0.23(opensips)__port_5070 - main_registrar_sip_server
>
> So I made 2 sockets
> socket=udp:10.130.0.23:5070 <http://10.130.0.23:5070>   # for LAN
> socket=udp:10.130.0.23:5060 <http://10.130.0.23:5060> as 1.1.1.1:5060 
> <http://1.1.1.1:5060> #for Internet
>
> I try to make call from lan to Tel provider with using b2bua.
>
> Is any way to setup b2bua with more than one socket?
>
> loadmodule "b2b_entities.so"
> loadmodule "b2b_logic.so"
> modparam("b2b_logic", "custom_headers", "P-Asserted-Identity") 
> #"User-Agent;Date")
> #modparam("b2b_logic", "contact_user", 1)
> modparam("b2b_logic", "server_address", "sip:1234567 at 1.1.1.1 
> <mailto:sip%3A1234567 at 1.1.1.1>")
>
>
> #force_send_socket("udp:10.130.23:5060");
> b2b_server_new("server1",$avp(b2b_hdrs), $avp(b2b_hdr_bodies));
> force_send_socket("udp:10.130.23:5060"); 
> b2b_client_new("Unistar","sip:09876543322 at provider.com 
> <mailto:sip%3A09876543322 at provider.com>","sip:provider","test","sip:1234567 at 1.1.1.1 
> <mailto:sip%3A1234567 at 1.1.1.1>");
> #force_send_socket("udp:10.130.23:5070");
> b2b_init_request("top hiding");
> exit;
>
> I use this construction in route[relay]. And I`ve tried to insert in 
> before b2b_server_new. But  it didn`t help
> if ($socket_in == "udp:10.130.0.23:5070 <http://10.130.0.23:5070>") {
>                 $socket_out = "udp:10.130.0.23:5060 
> <http://10.130.0.23:5060>";
>         } else {
>                 $socket_out = "udp:10.130.0.23:5070 
> <http://10.130.0.23:5070>";
>         }
>
> 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
> 2) I can`t change contact in request to provider. Default contact 
> looks like this Contact: <sip:1.1.1.1 >. I whant to change to 
> "sip:1234567 at 1.1.1.1 <mailto:sip%3A1234567 at 1.1.1.1>"
>
> -- 
> С уважением,
> Якимкин Алексей
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220823/1c428b7e/attachment.html>


More information about the Users mailing list