Hello,
at this moment i try to figure out the best way to add an "switch" for debug/log output. I use many xlog, like everyone that starts with kamailio too.
Then i go further and add #!ifdef cases around to switch this via #!define.
Is there any other way to turn on/off my "debug"-logging on the fly, while kamailio is still running?
#!define TESTBED_MODE
request_route{ ... #!ifdef TESTBED_MODE route(DEBUG); #!endif
... #!ifdef TESTBED_MODE xlog("L_INFO","---FIX_SIPS-after: ru:($ru)"); #!endif ... }
Hi,
I think you are looking for cfg_rpc: http://www.kamailio.net/docs/modules/5.0.x/modules/cfg_rpc.html
HTH Sebastian
On Thu, Aug 31, 2017 at 12:53 PM, Karsten Horsmann khorsmann@gmail.com wrote:
Hello,
at this moment i try to figure out the best way to add an "switch" for debug/log output. I use many xlog, like everyone that starts with kamailio too.
Then i go further and add #!ifdef cases around to switch this via #!define.
Is there any other way to turn on/off my "debug"-logging on the fly, while kamailio is still running?
#!define TESTBED_MODE
request_route{ ... #!ifdef TESTBED_MODE route(DEBUG); #!endif
... #!ifdef TESTBED_MODE xlog("L_INFO","---FIX_SIPS-after: ru:($ru)"); #!endif ... }
-- Kind Regards *Karsten Horsmann*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello Sebastian, hi List,
the cfg_rpc module seems to be the right thing.
But i am confused how to set an key.value in my kamailio.cfg.
For example - this breaks my kamailio.cfg - it won't start: mylog.switch = "0" desc "logging"
mylog.foo = "0" desc "logging" is allowed and kamailio starts. kamcmd> cfg.get mylog foo 0
Are there hidden, unallowed "keywords" that i didnt can use? I tried "mylog.enable", "mylog.on" and "mylog.switch" - all of them breaks the startup of kamailio:
Not starting : invalid configuration file! CRITICAL: <core> [core/cfg.y:3411]: yyerror_at(): parse error in config file //etc/kamailio/kamailio.cfg, line 182, column 7-12: syntax error CRITICAL: <core> [core/cfg.y:3411]: yyerror_at(): parse error in config file //etc/kamailio/kamailio.cfg, line 182, column 7-12: ERROR: bad config file (2 errors)
2017-08-31 15:59 GMT+02:00 Sebastian Damm damm@sipgate.de:
Hi,
I think you are looking for cfg_rpc: http://www.kamailio.net/docs/modules/5.0.x/modules/cfg_rpc.html
HTH Sebastian
Hello,
the keywords that have already a special meaning for config language cannot be used in this kind of var names. You have to avoid using them, see:
- https://www.kamailio.org/wiki/cookbooks/devel/core#custom_global_parameters
Cheers, Daniel
On 01.09.17 13:25, Karsten Horsmann wrote:
Hello Sebastian, hi List,
the cfg_rpc module seems to be the right thing.
But i am confused how to set an key.value in my kamailio.cfg.
For example - this breaks my kamailio.cfg - it won't start: mylog.switch = "0" desc "logging"
mylog.foo = "0" desc "logging" is allowed and kamailio starts. kamcmd> cfg.get mylog foo 0
Are there hidden, unallowed "keywords" that i didnt can use? I tried "mylog.enable", "mylog.on" and "mylog.switch" - all of them breaks the startup of kamailio:
Not starting : invalid configuration file! CRITICAL: <core> [core/cfg.y:3411]: yyerror_at(): parse error in config file //etc/kamailio/kamailio.cfg, line 182, column 7-12: syntax error CRITICAL: <core> [core/cfg.y:3411]: yyerror_at(): parse error in config file //etc/kamailio/kamailio.cfg, line 182, column 7-12: ERROR: bad config file (2 errors)
2017-08-31 15:59 GMT+02:00 Sebastian Damm <damm@sipgate.de mailto:damm@sipgate.de>:
Hi, I think you are looking for cfg_rpc: http://www.kamailio.net/docs/modules/5.0.x/modules/cfg_rpc.html <http://www.kamailio.net/docs/modules/5.0.x/modules/cfg_rpc.html> HTH Sebastian
-- Kind Regards *Karsten Horsmann*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users