=== Description ===
use $sel() in event_route from evapi module will cause segfault and kamailio crash.

=== How to re-produce ===

--- Step 1. kamailio.cfg: ---

--- evapi params ---

loadmodule "evapi.so"
modparam("evapi", "bind_addr", "127.0.0.1:8448")
modparam("evapi", "netstring_format", 1)
modparam("evapi", "workers", 4)

--- set a custom options outside any route block

self.MYIP = "1.2.3.4"

--- set event_route for evapi and invoke $sel; both route will segfault and crash

event_route[evapi:connection-new] {
xlog("L_NOTICE", "[ROUTEDEBUG][evapi:connection-new] new connection from $evapi(srcaddr):$evapi(srcport)");
xlog("L_NOTICE", "[ROUTEDEBUG][evapi:connection-new] TEST sel: $sel(cfg_get.self.MYIP)");
}
event_route[evapi:message-received] {
xlog("L_NOTICE", "[ROUTEDEBUG][evapi:message-received] test sel: $sel(cfg_get.self.MYIP)");
}

--- 2. try connect to evapi ---

You can use any client to try to connect or send message.
in bash, you can just use the following command to connect to and send a message:

exec 3<>/dev/tcp/127.0.0.1/5014; printf "5:Hello," >&3;

=== Debug level 3 error log at event_route[evapi:connection-new] ===

Aug 12 16:35:07 SIP /home/pkg/kamailio/sbin/kamailio[47034]: NOTICE:


Reply to this email directly or view it on GitHub.