Hi,
On an active/passive kamailio cluster, we use keepalived to move a virtual IP between the nodes and all signaling goes to that VIP.
One of our DID providers requires us to register with every single DID we have from them in order to receive calls for such DID (NOTE: we only want to have the "active" kamailio sending outbound registrations to the carrier).
My idea was to have keepalived enable all the outbound registrations when the current node changes to MASTER and disable them when it changes to BACKUP.
Is there a quick "enable all" or "disable all" for uac module outbound registrations or do I have to "know in advanced" all of them and enable/disable one by one?
In the docs we have:
*8.4. uac.reg_disable* *Disable a remote registration record based on a filter. The command has two parameter: attribute and value. The attribute can be: l_uuid, l_username, r_username or auth_username. The value is what should be matcheg against the value of the attribute in the remote registration record.*
I don't know if there is an "all" or maybe if a wildcard would work, but from the description it doesn't seem to.
Any ideas? Do you guys think this is taking a correct approach?
All suggestions are more than welcome!!
Thanks, Joel.
Am Sonntag, 12. August 2018, 22:20:41 CEST schrieb Joel Serrano:
On an active/passive kamailio cluster, we use keepalived to move a virtual IP between the nodes and all signaling goes to that VIP.
One of our DID providers requires us to register with every single DID we have from them in order to receive calls for such DID (NOTE: we only want to have the "active" kamailio sending outbound registrations to the carrier).
My idea was to have keepalived enable all the outbound registrations when the current node changes to MASTER and disable them when it changes to BACKUP.
Is there a quick "enable all" or "disable all" for uac module outbound registrations or do I have to "know in advanced" all of them and enable/disable one by one?
Hello Joel,
just some ideas, as I did (thankfully) not yet needed to implement something like this:
- setting a low registration timeout and just waiting until the expire - using a small script/tool to just walk over the list of DIDs and send SIP REGISTER requests to un-register them all in a bulk
Of course you can always extend the uac module, or use a python/lua etc.. script in Kamailio to do something like this. If the uac module access the list of registrations internally anyway, it should be probably not to hard to extend it to have some kind of wildcard functionality.
Best regards,
Henning
Hi Henning,
Thanks for your suggestions. For now I'll give a try your approach #1.
Couple extra doubts:
1- do you think an expiry of say 60s is too low? or is it reasonable? (I know it will depend a lot on the number of records in database, but in this case it's very little, like ~50 or so). 2- can I set uac module to initialize without sending any REGISTER requests ("start with all records in database disabled")? If answer is no, then my idea would be to set uacreg colum reg_delay to say 10s or so to give time to kamailio to startup, and than have an external script manually disable them before the delay expires. What do you think?
Thanks again! Joel.
On Sun, Aug 12, 2018 at 1:27 PM, Henning Westerholt hw@kamailio.org wrote:
Am Sonntag, 12. August 2018, 22:20:41 CEST schrieb Joel Serrano:
On an active/passive kamailio cluster, we use keepalived to move a
virtual
IP between the nodes and all signaling goes to that VIP.
One of our DID providers requires us to register with every single DID we have from them in order to receive calls for such DID (NOTE: we only want to have the "active" kamailio sending outbound registrations to the carrier).
My idea was to have keepalived enable all the outbound registrations when the current node changes to MASTER and disable them when it changes to BACKUP.
Is there a quick "enable all" or "disable all" for uac module outbound registrations or do I have to "know in advanced" all of them and enable/disable one by one?
Hello Joel,
just some ideas, as I did (thankfully) not yet needed to implement something like this:
- setting a low registration timeout and just waiting until the expire
- using a small script/tool to just walk over the list of DIDs and send SIP REGISTER requests to un-register them all in a bulk
Of course you can always extend the uac module, or use a python/lua etc.. script in Kamailio to do something like this. If the uac module access the list of registrations internally anyway, it should be probably not to hard to extend it to have some kind of wildcard functionality.
Best regards,
Henning
-- Henning Westerholt https://skalatan.de/blog/
Am Montag, 13. August 2018, 07:23:10 CEST schrieb Joel Serrano:
Thanks for your suggestions. For now I'll give a try your approach #1.
Couple extra doubts:
1- do you think an expiry of say 60s is too low? or is it reasonable? (I know it will depend a lot on the number of records in database, but in this case it's very little, like ~50 or so). 2- can I set uac module to initialize without sending any REGISTER requests ("start with all records in database disabled")? If answer is no, then my idea would be to set uacreg colum reg_delay to say 10s or so to give time to kamailio to startup, and than have an external script manually disable them before the delay expires. What do you think? [..]
Hello Joel,
60s is indeed low. I saw some reports of people use something like this in NAT settings, but I'd suggest for something between 2-3 minutes. This gives you a bit more room for eventual errors during a restart or something like this.
About the second question - I just did a quick check in the code. It seems that the uac module is reading during child_init the DB records, and there is currently no setting to disable this. But I did not fully understand the rationale behind this question, is this for your high-availability setup or something like this?
Best regards,
Henning
Hi Henning,
Yes, it would be for the HA setup.
So for example, say we have (I'm making it up):
modparam("uac", "reg_start_disabled", 1) ## This tells uac module to start with all records in `uacreg` table disabled.
1- Start kamailio on both nodes (no registrations are sent by any node).
2- Start keepalived on both nodes, some tests are done, the VIP is enabled on one of the nodes (MASTER). Keepalived would then run a script that would effectively enable all registrations (looping through all the records in the uacreg table doing a `kamctl rpc uac.reg_enable ...` or a future possible `kamctl rpc uac.reg_enable_all` :P).
That way, only the active node would be proactively sending the outbound registrations.
I don't see any of this a problem, as right now both are sending registrations using the same "Contact:", so any incoming requests will be directed to the active kamailio. This is just to keep things tidy and not have 2 servers sending outbound registrations when it isn't strictly necessary.
What do you think?
Thanks, Joel.
On Mon, Aug 13, 2018 at 11:50 AM, Henning Westerholt hw@kamailio.org wrote:
Am Montag, 13. August 2018, 07:23:10 CEST schrieb Joel Serrano:
Thanks for your suggestions. For now I'll give a try your approach #1.
Couple extra doubts:
1- do you think an expiry of say 60s is too low? or is it reasonable? (I know it will depend a lot on the number of records in database, but in
this
case it's very little, like ~50 or so). 2- can I set uac module to initialize without sending any REGISTER
requests
("start with all records in database disabled")? If answer is no, then my idea would be to set uacreg colum reg_delay to say 10s or so to give time to kamailio to startup, and than have an external script manually disable them before the delay expires. What do you think? [..]
Hello Joel,
60s is indeed low. I saw some reports of people use something like this in NAT settings, but I'd suggest for something between 2-3 minutes. This gives you a bit more room for eventual errors during a restart or something like this.
About the second question - I just did a quick check in the code. It seems that the uac module is reading during child_init the DB records, and there is currently no setting to disable this. But I did not fully understand the rationale behind this question, is this for your high-availability setup or something like this?
Best regards,
Henning
-- Henning Westerholt https://skalatan.de/blog/
Am Montag, 13. August 2018, 21:23:04 CEST schrieb Joel Serrano:
Yes, it would be for the HA setup.
So for example, say we have (I'm making it up):
modparam("uac", "reg_start_disabled", 1) ## This tells uac module to start with all records in `uacreg` table disabled.
1- Start kamailio on both nodes (no registrations are sent by any node).
2- Start keepalived on both nodes, some tests are done, the VIP is enabled on one of the nodes (MASTER). Keepalived would then run a script that would effectively enable all registrations (looping through all the records in the uacreg table doing a `kamctl rpc uac.reg_enable ...` or a future possible `kamctl rpc uac.reg_enable_all` :P).
That way, only the active node would be proactively sending the outbound registrations.
I don't see any of this a problem, as right now both are sending registrations using the same "Contact:", so any incoming requests will be directed to the active kamailio. This is just to keep things tidy and not have 2 servers sending outbound registrations when it isn't strictly necessary.
What do you think? [..]
Hello Joel,
for the setup you describe, it sounds feasible.
Best regards,
Henning
Hello,
just pushed a patch to allow enabling/disabling registration feature for all records at ones:
- https://github.com/kamailio/kamailio/commit/49f354276df3cfc2cdb0f85b5a1839f8...
I haven't tested it yet, maybe you get a chance to give it a try and report the results.
Cheers, Daniel
On 13.08.18 21:23, Joel Serrano wrote:
Hi Henning,
Yes, it would be for the HA setup.
So for example, say we have (I'm making it up):
modparam("uac", "reg_start_disabled", 1) ## This tells uac module to start with all records in `uacreg` table disabled.
1- Start kamailio on both nodes (no registrations are sent by any node).
2- Start keepalived on both nodes, some tests are done, the VIP is enabled on one of the nodes (MASTER). Keepalived would then run a script that would effectively enable all registrations (looping through all the records in the uacreg table doing a `kamctl rpc uac.reg_enable ...` or a future possible `kamctl rpc uac.reg_enable_all` :P).
That way, only the active node would be proactively sending the outbound registrations.
I don't see any of this a problem, as right now both are sending registrations using the same "Contact:", so any incoming requests will be directed to the active kamailio. This is just to keep things tidy and not have 2 servers sending outbound registrations when it isn't strictly necessary.
What do you think? Thanks, Joel.
On Mon, Aug 13, 2018 at 11:50 AM, Henning Westerholt <hw@kamailio.org mailto:hw@kamailio.org> wrote:
Am Montag, 13. August 2018, 07:23:10 CEST schrieb Joel Serrano: > Thanks for your suggestions. For now I'll give a try your approach #1. > > Couple extra doubts: > > 1- do you think an expiry of say 60s is too low? or is it reasonable? (I > know it will depend a lot on the number of records in database, but in this > case it's very little, like ~50 or so). > 2- can I set uac module to initialize without sending any REGISTER requests > ("start with all records in database disabled")? If answer is no, then my > idea would be to set uacreg colum reg_delay to say 10s or so to give time > to kamailio to startup, and than have an external script manually disable > them before the delay expires. What do you think? > [..] Hello Joel, 60s is indeed low. I saw some reports of people use something like this in NAT settings, but I'd suggest for something between 2-3 minutes. This gives you a bit more room for eventual errors during a restart or something like this. About the second question - I just did a quick check in the code. It seems that the uac module is reading during child_init the DB records, and there is currently no setting to disable this. But I did not fully understand the rationale behind this question, is this for your high-availability setup or something like this? Best regards, Henning -- Henning Westerholt https://skalatan.de/blog/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Absolutely! I’ll test and report back.
Thanks Daniel!
On Thu, Aug 30, 2018 at 03:12 Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
just pushed a patch to allow enabling/disabling registration feature for all records at ones:
https://github.com/kamailio/kamailio/commit/49f354276df3cfc2cdb0f85b5a1839f8...
I haven't tested it yet, maybe you get a chance to give it a try and report the results.
Cheers, Daniel
On 13.08.18 21:23, Joel Serrano wrote:
Hi Henning,
Yes, it would be for the HA setup.
So for example, say we have (I'm making it up):
modparam("uac", "reg_start_disabled", 1) ## This tells uac module to start with all records in `uacreg` table disabled.
1- Start kamailio on both nodes (no registrations are sent by any node).
2- Start keepalived on both nodes, some tests are done, the VIP is enabled on one of the nodes (MASTER). Keepalived would then run a script that would effectively enable all registrations (looping through all the records in the uacreg table doing a `kamctl rpc uac.reg_enable ...` or a future possible `kamctl rpc uac.reg_enable_all` :P).
That way, only the active node would be proactively sending the outbound registrations.
I don't see any of this a problem, as right now both are sending registrations using the same "Contact:", so any incoming requests will be directed to the active kamailio. This is just to keep things tidy and not have 2 servers sending outbound registrations when it isn't strictly necessary.
What do you think?
Thanks, Joel.
On Mon, Aug 13, 2018 at 11:50 AM, Henning Westerholt hw@kamailio.org wrote:
Am Montag, 13. August 2018, 07:23:10 CEST schrieb Joel Serrano:
Thanks for your suggestions. For now I'll give a try your approach #1.
Couple extra doubts:
1- do you think an expiry of say 60s is too low? or is it reasonable? (I know it will depend a lot on the number of records in database, but in
this
case it's very little, like ~50 or so). 2- can I set uac module to initialize without sending any REGISTER
requests
("start with all records in database disabled")? If answer is no, then
my
idea would be to set uacreg colum reg_delay to say 10s or so to give
time
to kamailio to startup, and than have an external script manually
disable
them before the delay expires. What do you think? [..]
Hello Joel,
60s is indeed low. I saw some reports of people use something like this in NAT settings, but I'd suggest for something between 2-3 minutes. This gives you a bit more room for eventual errors during a restart or something like this.
About the second question - I just did a quick check in the code. It seems that the uac module is reading during child_init the DB records, and there is currently no setting to disable this. But I did not fully understand the rationale behind this question, is this for your high-availability setup or something like this?
Best regards,
Henning
-- Henning Westerholt https://skalatan.de/blog/
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference -- www.kamailioworld.com Kamailio Advanced Training, Nov 12-14, 2018, in Berlin -- www.asipto.com