I tried the tcp_reuse_port but it doesn’t seem to change the source port. It’s always random indeed as you say.

See also screenshot from sngrep: https://i.imgur.com/gp7WQ1C.png

 

The problem is that, further down the call, the other party sends the BYE to the port that is specified in the Contact header, so e.g. in the screenshot I would like to put 48952 in the Contact header – or have it always be 5060 indeed.

 

 

Van: Henning Westerholt <hw@gilawa.com>
Verzonden: woensdag 3 augustus 2022 13:28
Aan: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
CC: Maarten Ureel <maarten@youreal.eu>
Onderwerp: RE: set source port of TCP socket in Contact header

 

Hello,

 

Not sure if I completely understand the issue.

Kamailio will either use a random source port, or the port 5060 if you specify the tcp_reuse_port core configuration.

 

Cheers,

 

Henning

 

--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com

 

From: sr-users <sr-users-bounces@lists.kamailio.org> On Behalf Of Maarten Ureel
Sent: Tuesday, August 2, 2022 4:53 PM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] set source port of TCP socket in Contact header

 

Hello

 

I want to set the correct source port in an outgoing message over TCP. Is it possible? I can’t find a pseudo-variable for this.

Currently we have no port number in the contact header, and the other party is sending their BYE to port 5060 instead of to the source port from which the outgoing TCP connection was made.

 

 

 

Regards

Maarten