< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] Decorator reporting wrong source port


Hello Diego,

I don’t undertand why you want to set actual port in Contact header, so I’ll try to explain my point of view of the matter.

If you are writing a TLS client using reSIProcate or any other SIP library, receiving TLS server should send status message for INVITE through established TLS connection (in this case actual port is not relevant).

For any other server-initiated transaction in dialog, for example BYE/200, TLS server should reuse the SAME connection toward TLS client otherwise server couldn’t know if it is able to contact client.

This is true even if you write the right/actual port in Contact header of INVITE message because you don’t have to create another TLS connection from server to client on that port. Actually TLS client could be just only a TLS client, that cannot act as server and receive connections on TLS port, even 5061, because it doesn’t have server certificate with private key, for example.

As far as I know you should reuse the same connection in a similar way that you act using RFC 5626 “Managing Client-Initiated Connections in the Session Initiation Protocol (SIP)”.

Try to have a look at method ResponseContext::getInboundFlowToken() in repro.

Hope that the things I wrote are right (Scott could be more precise), I hope that this could help you.

Best regards,

Dario

 

From: resiprocate-devel [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxx] On Behalf Of Diego Carvalho Domingos
Sent: Monday, 19 February, 2018 21:30
To: resiprocate-devel@xxxxxxxxxxxxxxx
Subject: [reSIProcate] Decorator reporting wrong source port

 

Hi all,
I want to populate the contact header of an INVITE message with the actual port used by the stack to establish a TLS connection instead of the default 5061. The decorator example does exactly that for the SDP so I tried to use that code but source.getPort() returns 5061. I investigated the code and found that initially the method determineSourceInterface is used but the port is set to 0 because via.sentPort() is 0. Then, because of that, the port is set to transport->port(), which I think is the same transport that is setup on resiprocate initialization (which of course had the port set to 5061). How do I get the actual port used by the stack to initiate the TLS connection? Is this a bug in reciprocate? I appreciate any help. Thanks

 

Diego Carvalho Domingos