Hello,

 

for authentication you should not use round-robin, for the observed reasons.

 

You could e.g., hash over the from URI, then all requests should end up on the same freeswitch for the authentication to work.

 

Here is an (old) discussion with some more content:

https://lists.kamailio.org/pipermail/devel/2008-September/016234.html

 

 

Cheers,

 

Henning

 

--

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

Kamailio services – https://gilawa.com

 

From: Shah Hussain Khattak <shahhusayn@msn.com>
Sent: Montag, 3. Juli 2023 08:08
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: [SR-Users] Using Kamailio in front of Freeswitch for load balancing REG and Calls

 

Hello Awesome people, 

 

I have configured Kamailio in front of two Freeswitch servers. I am using the dispatcher module to load and balance the traffic between the two FS boxes. My dispatcher is configured in a round-robin fashion. 

 

If I send a register to my FS servers, the re-register post-challenge (401) message is routed to the second FS server and the registration fails. I want to check with you guys how are you handling this in your setups. I am sure a lot of companies are using Kamailio to load balance traffic toward the FS and Asterisk servers. 

 

UAC --- > Kamailio --- > FS1 

REG ---- > REG ---- > REG 

401 <---- 401 < ---- 401

 

re-register with authorization data:

UAC --- > Kamailio --- > FS2 

REG --- > REG  ---- > REG 

401 <---- 401 < ---- 401

 

it just create this loop and register fails. 

 

Ideally, I want Kamailio to send the re-register (with auth data) to the same FS server that challenged it. 

 

Any ideas or pointers to fix this issue would be highly appreciated, maybe I am missing some very basic configuration. Or maybe there is another simpler way instead of using a dispatcher module. 

 

 

Thank you! 

 

Regards, 

Shah Hussain