tls -> udp

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

tls -> udp

Johan De Clercq

Hello

Using opensips 2.4.4,

 

Phone -> tls and srtp -> opensips -> udp -> provider

 

I have a socket on 5061 tls and a socket on 5060 udp and mhomed is one,

 

 

 

Call arrives in opensips but is not correctly routed to the provider.

 

Feb 12 21:20:47 ns3012072 /usr/local/opensips/sbin/opensips[7140]: DBG:tm:run_trans_callbacks: trans=0x7ff70a24dc68, callback type 4, id 1 entered

Feb 12 21:20:47 ns3012072 /usr/local/opensips/sbin/opensips[7140]: DBG:dialog:dlg_update_contact: Using the same contact <sip:321234@94.226.231.242:5493;transport=tls> for dialog 0x7ff70a24bdd8 on leg 0

Feb 12 21:20:47 ns3012072 /usr/local/opensips/sbin/opensips[7140]: DBG:core:mk_proxy: doing DNS lookup...

Feb 12 21:20:47 ns3012072 /usr/local/opensips/sbin/opensips[7140]: DBG:core:sip_resolvehost: no port, has proto -> do SRV lookup!

Feb 12 21:20:47 ns3012072 /usr/local/opensips/sbin/opensips[7140]: DBG:core:get_record: lookup(_sips._tcp…

 

That is logic as the provider doesn’t listen on tcp.

 

How can I force opensips to relay from tls on the phone to udp at the provider ?

 

Small homer trace in attachment.

 

 

 

cid:F3100D46-F00D-4610-87ED-3E91DA790A82

Johan De Clercq, Managing Director
Democon bvba - Ooigemstraat 41 - 8780 Oostrozebeke

Tel +3256980990 – GSM +32478720104

 


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

HOMER5-5.135.140.139-003215666666-2_12_2019 21_14_39.pcap (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: tls -> udp

John Quick
Hi Johan,

I've configured Proxy servers to do this a few times.
You should do the following:
1) For Requests going from TLS to UDP, change any occurrence of
"transport=tls" in the R-URI parameters. I use the following to do this:
subst_uri('/transport=tls/transport=udp/I');

2) Make sure OpenSIPS adds correct Record-Route headers.
Default behaviour in this case is to add 2 RR headers when you call
record_route(). Make sure double_rr has not been disabled in the modparam
section.
One header describes the TLS socket and the other header describes the UDP
socket. These are needed for sequential Loose-Routed requests later in the
dialogue.

3) Just before you relay the request over UDP, call the force_send_socket()
function. For example:
force_send_socket(udp:12.34.56.78:5060);

Hope this helps.

John Quick
Smartvox Limited



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: tls -> udp

Bogdan-Andrei Iancu-2
Hi John,

For (2), there is nothing special you need to do - the double_rr is by
default enabled and you just need to do record_route() - opensips is
automatically figure out that there is a protocol changing and do a
double RR headers.

Regarding (1) and (3) - the proto info in RURI/destination is overriding
the info in forced socket - if you have a explicit UDP destination, but
a TLS socket forced, the socket will be discarded and a proper one (UDP)
will be found.

Shortly said, you need only (1).

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 02/13/2019 11:15 AM, John Quick wrote:

> Hi Johan,
>
> I've configured Proxy servers to do this a few times.
> You should do the following:
> 1) For Requests going from TLS to UDP, change any occurrence of
> "transport=tls" in the R-URI parameters. I use the following to do this:
> subst_uri('/transport=tls/transport=udp/I');
>
> 2) Make sure OpenSIPS adds correct Record-Route headers.
> Default behaviour in this case is to add 2 RR headers when you call
> record_route(). Make sure double_rr has not been disabled in the modparam
> section.
> One header describes the TLS socket and the other header describes the UDP
> socket. These are needed for sequential Loose-Routed requests later in the
> dialogue.
>
> 3) Just before you relay the request over UDP, call the force_send_socket()
> function. For example:
> force_send_socket(udp:12.34.56.78:5060);
>
> Hope this helps.
>
> John Quick
> Smartvox Limited
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: tls -> udp

Johan De Clercq
Thanks for the additional clarification Bogdan.

Op do 7 mrt. 2019 om 10:48 schreef Bogdan-Andrei Iancu <[hidden email]>:
Hi John,

For (2), there is nothing special you need to do - the double_rr is by
default enabled and you just need to do record_route() - opensips is
automatically figure out that there is a protocol changing and do a
double RR headers.

Regarding (1) and (3) - the proto info in RURI/destination is overriding
the info in forced socket - if you have a explicit UDP destination, but
a TLS socket forced, the socket will be discarded and a proper one (UDP)
will be found.

Shortly said, you need only (1).

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 02/13/2019 11:15 AM, John Quick wrote:
> Hi Johan,
>
> I've configured Proxy servers to do this a few times.
> You should do the following:
> 1) For Requests going from TLS to UDP, change any occurrence of
> "transport=tls" in the R-URI parameters. I use the following to do this:
> subst_uri('/transport=tls/transport=udp/I');
>
> 2) Make sure OpenSIPS adds correct Record-Route headers.
> Default behaviour in this case is to add 2 RR headers when you call
> record_route(). Make sure double_rr has not been disabled in the modparam
> section.
> One header describes the TLS socket and the other header describes the UDP
> socket. These are needed for sequential Loose-Routed requests later in the
> dialogue.
>
> 3) Just before you relay the request over UDP, call the force_send_socket()
> function. For example:
> force_send_socket(udp:12.34.56.78:5060);
>
> Hope this helps.
>
> John Quick
> Smartvox Limited
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users