Hello everyone!
Is there a way to define a listen port range for TCP/TLS? Or any macro I can use to create the LISTEN commands? And finally is there a performance penalty for having multiple (2k) listening ports at the same time?
I am in a strange situation where I need to register multiple credentials on a single SIP trunk, for each registration I need to use a different local port otherwise the trunk will simply overwrite the previous registrations. Furthermore, when I place a call on that trunk I have to be consistent with the port I used for registration for that specific credential. So I am looking into explicitly defining the port to be used per credential, UACREG allows me to use the contact_addr/socket for the registration part and for placing of outbound calls I can use $fsn to force the correct socket.
Best regards, Joao
Hello,
you can have multiple listen statements of course. Ranges are not supported. If you don’t want to create them by copy/paste, investigate something like ansible or similar tools.
For UDP Kamailio would start n children each per listening socket, so 2k sockets would not work without some adaptions in the cfg. For TCP/TLS the server uses a different approach, but this is still something that probably was rarely tested. So, give it a try, but there might be some issues you encounter. Report back on the list if it doesn’t work, and of course also when it works.
Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.comhttps://gilawa.com/
From: João Silva via sr-users sr-users@lists.kamailio.org Sent: Sonntag, 21. Juli 2024 11:31 To: sr-users@lists.kamailio.org Cc: João Silva silvajp9+kamailio@gmail.com Subject: [SR-Users] Listening on multiple TLS ports
Hello everyone!
Is there a way to define a listen port range for TCP/TLS? Or any macro I can use to create the LISTEN commands? And finally is there a performance penalty for having multiple (2k) listening ports at the same time?
I am in a strange situation where I need to register multiple credentials on a single SIP trunk, for each registration I need to use a different local port otherwise the trunk will simply overwrite the previous registrations. Furthermore, when I place a call on that trunk I have to be consistent with the port I used for registration for that specific credential. So I am looking into explicitly defining the port to be used per credential, UACREG allows me to use the contact_addr/socket for the registration part and for placing of outbound calls I can use $fsn to force the correct socket.
Best regards, Joao
Henning,
On Jul 21, 2024, at 6:57 AM, Henning Westerholt via sr-users sr-users@lists.kamailio.org wrote:
For TCP/TLS the server uses a different approach, but this is still something that probably was rarely tested. So, give it a try, but there might be some issues you encounter.
What is the different approach? My understanding is that, by default, Kamailio creates the full complement of child processes per listener, regardless of transport.
children=4
listen=udp:10.165.41.241:5060 advertise 54.85.142.125:5060 listen=tcp:10.165.41.241:5060 advertise 54.85.142.125:5060
# kamcmd -s /tmp/kamailio_ctl ps | fgrep receiver 962193 udp receiver child=0 sock=10.165.41.241:5060 (54.85.142.125:5060) 962194 udp receiver child=1 sock=10.165.41.241:5060 (54.85.142.125:5060) 962196 udp receiver child=2 sock=10.165.41.241:5060 (54.85.142.125:5060) 962197 udp receiver child=3 sock=10.165.41.241:5060 (54.85.142.125:5060) 962247 tcp receiver (generic) child=0 962248 tcp receiver (generic) child=1 962251 tcp receiver (generic) child=2 962252 tcp receiver (generic) child=3
-- Alex
Hello Alex,
you will have N children per UDP socket worker for individual IPs, ports and IP version, but only N total children for TCP workers for all IPs, ports or IP version.
root@kam01.tst$ grep listen kamailio-local.cfg listen=127.0.0.1:5060 listen=[2a01:4f8:c2c:XXXXXX]:5060 listen=UNICAST_IP:5060 listen=UNICAST_IP:8933 listen=ANYCAST_IP:5060 listen=ANYCAST_IP:8933
root@kam01.tst$ kamcmd ps |grep "udp receiver" | wc -l 48
root@kam01.tst$ kamcmd ps |grep "tcp receiver" | wc -l 8
Cheers,
Henning
Hey Henning Westerholt,
Thank you very much! Yes I will test and report back.
On Sun, Jul 21, 2024 at 11:57 AM Henning Westerholt hw@gilawa.com wrote:
Hello,
you can have multiple listen statements of course. Ranges are not supported. If you don’t want to create them by copy/paste, investigate something like ansible or similar tools.
For UDP Kamailio would start n children each per listening socket, so 2k sockets would not work without some adaptions in the cfg.
For TCP/TLS the server uses a different approach, but this is still something that probably was rarely tested. So, give it a try, but there might be some issues you encounter.
Report back on the list if it doesn’t work, and of course also when it works.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com
*From:* João Silva via sr-users sr-users@lists.kamailio.org *Sent:* Sonntag, 21. Juli 2024 11:31 *To:* sr-users@lists.kamailio.org *Cc:* João Silva silvajp9+kamailio@gmail.com *Subject:* [SR-Users] Listening on multiple TLS ports
Hello everyone!
Is there a way to define a listen port range for TCP/TLS? Or any macro I can use to create the LISTEN commands? And finally is there a performance penalty for having multiple (2k) listening ports at the same time?
I am in a strange situation where I need to register multiple credentials on a single SIP trunk, for each registration I need to use a different local port otherwise the trunk will simply overwrite the previous registrations. Furthermore, when I place a call on that trunk I have to be consistent with the port I used for registration for that specific credential. So I am looking into explicitly defining the port to be used per credential, UACREG allows me to use the contact_addr/socket for the registration part and for placing of outbound calls I can use $fsn to force the correct socket.
Best regards,
Joao