[SR-Users] Forcing Outbound Socket

Ross McKillop ross at rsmck.co.uk
Wed Nov 10 16:34:49 CET 2021

Hi All,

Try as I may I cannot force an outbound TCP request to use a non-ephemeral source port.

Looking at the documentation it seems that as long as I have a line like 


I should be able to force an outbound connection to originate from that host and port, i.e. to establish a persistent connection from a specific socket to a remote host, but having tried to set it via $fs and set_send_socket() it always uses an ephemeral port.

Ideally I would like kamailio to use a specific source port for contacting a specific remote host and keep the TCP socket established, and it seems like it should be simple enough to do but it's not working as expected. 


More information about the sr-users mailing list