[OpenSIPS-Users] b2bua top hiding behind NAT

Alex ayakimkin at gmail.com
Wed Sep 21 14:07:58 UTC 2022


Hello,

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 .
But Messages (Updates, reInvites) and replies go directly between LAN and
10.130.23:5060 thought.
All messages (input, output, replies) must go between two sockets
10.130.23:5070 <-> 10.130.23:5060 .
                b2b_server_new("server1",$avp(b2b_hdrs),
$avp(b2b_hdr_bodies));
                if ($socket_in == "udp:10.130.0.23:5070") {
                        force_send_socket("udp:10.130.23:5060");
                } else {
                        force_send_socket("udp:10.130.23:5070");
                }
                b2b_client_new("Unistar","sip:09876543322 at provider.com
","sip:provider","test","sip:1234567 at 1.1.1.1");
                #force_send_socket("udp:10.130.23:5070");
                b2b_init_request("top hiding");
                exit;

But Updates go from 5060 directly to lan. I made a screenshot you can see
by the url
https://drive.google.com/file/d/1bpwmXCB6qRxbDk8KZ6GuCg3-hwfABvwk/view?usp=sharing





вт, 23 авг. 2022 г. в 12:44, Bogdan-Andrei Iancu <bogdan at opensips.org>:

> 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","sip:provider","test","sip:1234567 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   # for LAN
> socket=udp:10.130.0.23:5060 as 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")
>
>
> #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","sip:provider","test","sip:1234567 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") {
>                 $socket_out = "udp:10.130.0.23:5060";
>         } else {
>                 $socket_out = "udp: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"
>
> --
> С уважением,
> Якимкин Алексей
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>

-- 
С уважением,
Якимкин Алексей
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220921/1aec5688/attachment.html>


More information about the Users mailing list