Hi,
My name is Stefan and I am a new member of the 1&1 VoIP team.
I have noticed that parsing support is not implemented for the dns_cache_rec_pref core parameter although this parameter is documented in doc/cfg_list/docbook/cfg_core.xml. Thus, one can not set the parameter's value in kamailio config file.
I had noticed the problem due to an an increase in the real_used_size memory when "kamctl stats shmem" was issued, after DNS SRV queries were made (when SRV are not added manually using kamctl). The SRV (0 ttl) and resulting A (3600 ttl) records are added in kamailio's memory even if the same entries already exist; the existing entries are _not_ overwritten even if they are the same and are kept in memory until the ttl expires. This is because dns_cache_rec_pref is 0 by default which means that it won't check for duplicates. This can be also seen using "kamcmd dns.view" and "kamcmd dns.mem_info".
In my opinion, this core parameter should be supported. We have a little patch for this.
I want to ask you if there is an explicit reason for not being implemented yet?
Regards, Stefan
Hello Stefan,
On 17/04/15 10:38, smititelu wrote:
Hi,
My name is Stefan and I am a new member of the 1&1 VoIP team.
glad to see you on the list, completing the team from 1&1!
I have noticed that parsing support is not implemented for the dns_cache_rec_pref core parameter although this parameter is documented in doc/cfg_list/docbook/cfg_core.xml. Thus, one can not set the parameter's value in kamailio config file.
I haven't implemented the dns cache, typically most of the attributes to configure it are exposed as global parameters. But maybe some of them can be changed only via RPC. There is a module cfg_db which was supposed to allow loading values from database as well, but somehow the developer (which was in the SER project) left and is rather undocumented.
The parameters available in so called cfg reload framework can be set via kamcmd, like:
kamcmd cfg.set_now_int core cache_rec_pref 1
On the other hand, can you try adding in config file:
core.cache_rec_pref=1
at the beginning, in the part with global parameters?
I had noticed the problem due to an an increase in the real_used_size memory when "kamctl stats shmem" was issued, after DNS SRV queries were made (when SRV are not added manually using kamctl). The SRV (0 ttl) and resulting A (3600 ttl) records are added in kamailio's memory even if the same entries already exist; the existing entries are _not_ overwritten even if they are the same and are kept in memory until the ttl expires. This is because dns_cache_rec_pref is 0 by default which means that it won't check for duplicates. This can be also seen using "kamcmd dns.view" and "kamcmd dns.mem_info".
In my opinion, this core parameter should be supported. We have a little patch for this.
I want to ask you if there is an explicit reason for not being implemented yet?
If you have a patch, send it here or make a pull request on github. It will be accepted.
Cheers, Daniel
I haven't implemented the dns cache, typically most of the attributes to configure it are exposed as global parameters. But maybe some of them can be changed only via RPC. There is a module cfg_db which was supposed to allow loading values from database as well, but somehow the developer (which was in the SER project) left and is rather undocumented.
The parameters available in so called cfg reload framework can be set via kamcmd, like:
kamcmd cfg.set_now_int core cache_rec_pref 1
I've tried "kamcmd cfg.set_now_int core dns_cache_rec_pref 1". The cmd works and the value is changed accordingly. I also tried with other params like dns_cache_max_ttl and it works.
On the other hand, can you try adding in config file:
core.cache_rec_pref=1
at the beginning, in the part with global parameters?
I get a config error when setting the core.(dns_)cache_rec_pref=1 in config file:
"Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:162]: cfg_declare(): ERROR: register_cfg_def(): configuration group has been already declared: core Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:188]: cfg_declare(): ERROR: register_cfg_def(): Failed to register the config group: core Apr 20 06:48:03 test-reg1-bs kamailio_3: : <core> [main.c:2407]: main(): could not declare the core configuration"
If I try "cfg.cache_rec_pref=1" I get no errors but no effect.
If you have a patch, send it here or make a pull request on github. It will be accepted.
I have attached to this mail, the proposed patch which allows dns_cache_rec_pref to be set in config file. (i.e. dns_cache_rec_pref=1)
Kind Regards, Stefan
Hello,
how did you generate the patch? 'git am' returns error:
Patch format detection failed.
Can you use git format patch?
http://git-scm.com/docs/git-format-patch
Or even better, if you have an account on github, create a pull request. Merging will be easier.
Cheers, Daniel
On 20/04/15 15:17, smititelu wrote:
I haven't implemented the dns cache, typically most of the attributes to configure it are exposed as global parameters. But maybe some of them can be changed only via RPC. There is a module cfg_db which was supposed to allow loading values from database as well, but somehow the developer (which was in the SER project) left and is rather undocumented.
The parameters available in so called cfg reload framework can be set via kamcmd, like:
kamcmd cfg.set_now_int core cache_rec_pref 1
I've tried "kamcmd cfg.set_now_int core dns_cache_rec_pref 1". The cmd works and the value is changed accordingly. I also tried with other params like dns_cache_max_ttl and it works.
On the other hand, can you try adding in config file:
core.cache_rec_pref=1
at the beginning, in the part with global parameters?
I get a config error when setting the core.(dns_)cache_rec_pref=1 in config file:
"Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:162]: cfg_declare(): ERROR: register_cfg_def(): configuration group has been already declared: core Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:188]: cfg_declare(): ERROR: register_cfg_def(): Failed to register the config group: core Apr 20 06:48:03 test-reg1-bs kamailio_3: : <core> [main.c:2407]: main(): could not declare the core configuration"
If I try "cfg.cache_rec_pref=1" I get no errors but no effect.
If you have a patch, send it here or make a pull request on github. It will be accepted.
I have attached to this mail, the proposed patch which allows dns_cache_rec_pref to be set in config file. (i.e. dns_cache_rec_pref=1)
Kind Regards, Stefan
Hello,
I just apply your patch manually and pushed to master branch -- I had to add another global parameter and wanted to avoid commit conflicts.
The suggestions for the patch formatting can be used in the future.
Cheers, Daniel
On 21/04/15 16:48, Daniel-Constantin Mierla wrote:
Hello,
how did you generate the patch? 'git am' returns error:
Patch format detection failed.
Can you use git format patch?
http://git-scm.com/docs/git-format-patch
Or even better, if you have an account on github, create a pull request. Merging will be easier.
Cheers, Daniel
On 20/04/15 15:17, smititelu wrote:
I haven't implemented the dns cache, typically most of the attributes to configure it are exposed as global parameters. But maybe some of them can be changed only via RPC. There is a module cfg_db which was supposed to allow loading values from database as well, but somehow the developer (which was in the SER project) left and is rather undocumented.
The parameters available in so called cfg reload framework can be set via kamcmd, like:
kamcmd cfg.set_now_int core cache_rec_pref 1
I've tried "kamcmd cfg.set_now_int core dns_cache_rec_pref 1". The cmd works and the value is changed accordingly. I also tried with other params like dns_cache_max_ttl and it works.
On the other hand, can you try adding in config file:
core.cache_rec_pref=1
at the beginning, in the part with global parameters?
I get a config error when setting the core.(dns_)cache_rec_pref=1 in config file:
"Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:162]: cfg_declare(): ERROR: register_cfg_def(): configuration group has been already declared: core Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:188]: cfg_declare(): ERROR: register_cfg_def(): Failed to register the config group: core Apr 20 06:48:03 test-reg1-bs kamailio_3: : <core> [main.c:2407]: main(): could not declare the core configuration"
If I try "cfg.cache_rec_pref=1" I get no errors but no effect.
If you have a patch, send it here or make a pull request on github. It will be accepted.
I have attached to this mail, the proposed patch which allows dns_cache_rec_pref to be set in config file. (i.e. dns_cache_rec_pref=1)
Kind Regards, Stefan
Hello,
Thank you for your help.
Stefan
On 21.04.2015 22:27, Daniel-Constantin Mierla wrote:
Hello,
I just apply your patch manually and pushed to master branch -- I had to add another global parameter and wanted to avoid commit conflicts.
The suggestions for the patch formatting can be used in the future.
Cheers, Daniel
On 21/04/15 16:48, Daniel-Constantin Mierla wrote:
Hello,
how did you generate the patch? 'git am' returns error:
Patch format detection failed.
Can you use git format patch?
http://git-scm.com/docs/git-format-patch
Or even better, if you have an account on github, create a pull request. Merging will be easier.
Cheers, Daniel
On 20/04/15 15:17, smititelu wrote:
I haven't implemented the dns cache, typically most of the attributes to configure it are exposed as global parameters. But maybe some of them can be changed only via RPC. There is a module cfg_db which was supposed to allow loading values from database as well, but somehow the developer (which was in the SER project) left and is rather undocumented.
The parameters available in so called cfg reload framework can be set via kamcmd, like:
kamcmd cfg.set_now_int core cache_rec_pref 1
I've tried "kamcmd cfg.set_now_int core dns_cache_rec_pref 1". The cmd works and the value is changed accordingly. I also tried with other params like dns_cache_max_ttl and it works.
On the other hand, can you try adding in config file:
core.cache_rec_pref=1
at the beginning, in the part with global parameters?
I get a config error when setting the core.(dns_)cache_rec_pref=1 in config file:
"Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:162]: cfg_declare(): ERROR: register_cfg_def(): configuration group has been already declared: core Apr 20 06:48:03 test-reg1-bs kamailio_3: ERROR: <core> [cfg/cfg.c:188]: cfg_declare(): ERROR: register_cfg_def(): Failed to register the config group: core Apr 20 06:48:03 test-reg1-bs kamailio_3: : <core> [main.c:2407]: main(): could not declare the core configuration"
If I try "cfg.cache_rec_pref=1" I get no errors but no effect.
If you have a patch, send it here or make a pull request on github. It will be accepted.
I have attached to this mail, the proposed patch which allows dns_cache_rec_pref to be set in config file. (i.e. dns_cache_rec_pref=1)
Kind Regards, Stefan