[SR-Users] Forcing Outbound Socket

Olle E. Johansson oej at edvina.net
Thu Nov 11 08:22:17 CET 2021



> 10 nov. 2021 kl. 18:21 skrev Ross McKillop <ross at rsmck.co.uk>:
> 
> Hi,
> 
> Thanks, I was almost certain that is set but it seems it may not be so will double check that, thank you :)
> 
> Now to solve the other issue….
Just a nit-picking note: All these are non-standard fixes. The standard based way is to use the outbound module, it’s the way to allow the sip server to use an inbound TCP connection for outbound requests. This applies to client2server connections.

For server2server connections there is a requirement of mutual TLS auth in order to be able to reuse the connection in both directions.

Cheers,
/O
> 
> Ross
> 
>> On 10 Nov 2021, at 17:14, Federico Cabiddu <federico.cabiddu at gmail.com <mailto:federico.cabiddu at gmail.com>> wrote:
>> 
>> Hi,
>> to force kamailio to use, for outbound connections, a specific tcp port (define in a "listen" directive), you have to set the reuse_tcp_port parameter (https://www.kamailio.org/wiki/cookbooks/5.5.x/core#tcp_reuse_port <https://www.kamailio.org/wiki/cookbooks/5.5.x/core#tcp_reuse_port>).
>> 
>> Cheers,
>> 
>> Federico
>> 
>> On Wed, Nov 10, 2021 at 4:36 PM Ross McKillop <ross at rsmck.co.uk <mailto:ross at rsmck.co.uk>> wrote:
>> 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
>> 
>>         listen=tcp:10.30.0.55:3339 <http://10.30.0.55:3339/>
>> 
>> 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.
>> 
>> Best,
>> Ross
>> 
>> 
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>   * sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>> Edit mailing list options or unsubscribe:
>>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>  * sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>> Important: keep the mailing list in the recipients, do not reply only to the sender!
>> Edit mailing list options or unsubscribe:
>>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
> 
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>  * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the sender!
> Edit mailing list options or unsubscribe:
>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20211111/a6151606/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 686 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20211111/a6151606/attachment.sig>


More information about the sr-users mailing list