[SR-Users] KEMI basic logging
Daniel-Constantin Mierla
miconda at gmail.com
Fri Mar 30 17:42:45 CEST 2018
Hello,
indeed, the function required KSR.log() two parameters and only one was
provided in the first example. I added a commit with some extra checks
to detect such case.
Cheers,
Daniel
On 30.03.18 08:39, Eugene Prokopiev wrote:
> I need to call KSR.log("err", "...") or just KSR.err("...") or even
> KSR.info("...") with debug=2 in kamailio.cfg
>
> 2018-03-29 22:23 GMT+03:00 Eugene Prokopiev <enp at itx.ru>:
>> Hi,
>>
>> Tried just to reject any request with some log message:
>>
>> $ cat kamailio/Dockerfile
>>
>> FROM centos:centos7
>> RUN yum update -y
>> RUN yum install -y wget
>> RUN wget -O /etc/yum.repos.d/kamailio.repo
>> http://download.opensuse.org/repositories/home:/kamailio:/v5.1.x-rpms/CentOS_7/home:kamailio:v5.1.x-rpms.repo
>> RUN yum install -y kamailio kamailio-lua
>> VOLUME /etc/kamailio
>> ENTRYPOINT ["kamailio", "-DD", "-E"]
>>
>> $ cat kamailio/config/kamailio.cfg
>>
>> listen=udp:0.0.0.0:5060
>> loadmodule "tm.so"
>> loadmodule "sl.so"
>> loadmodule "xlog.so"
>> loadmodule "app_lua.so"
>> modparam("app_lua", "load", "/etc/kamailio/kamailio.lua")
>> cfgengine "lua"
>>
>> $ cat kamailio/config/kamailio.lua
>> function ksr_request_route()
>> KSR.log("===== request - from kamailio lua script\n")
>> KSR.sl.send_reply(503, "Server not configured")
>> end
>>
>> Result is:
>>
>> kamailio_1 | 12(18) CRITICAL: <core> [core/pass_fd.c:277]:
>> receive_fd(): EOF on 5
>> kamailio_1 | 0(1) ALERT: <core> [main.c:746]: handle_sigs(): child
>> process 7 exited by a signal 11
>> kamailio_1 | 0(1) ALERT: <core> [main.c:749]: handle_sigs(): core
>> was generated
>> vms_kamailio_1 exited with code 1
>>
>> But valid response '503 Server not configured' with commented KSR.log.
>> So, how to log propertly?
>> --
>> WBR,
>> Eugene Prokopiev
>
>
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - April 16-18, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
More information about the sr-users
mailing list