this can be reporduced by following lua config
kamailio.cfg
```
#!KAMAILIO
####### Defined Values #########
#!substdef "!MY_IP_ADDR!<MY_IP>!g"
#!substdef "!MY_EXTERNAL_IP!<MY_EXTERNAL_IP>!g"
#!substdef "!MY_UDP_PORT!5060!g"
#!substdef "!MY_UDP_ADDR!udp:MY_IP_ADDR:MY_UDP_PORT!g"
# Dispatcher File
#!define DISPATCHER_FILE "/etc/kamailio/dispatcher.list"
# Routing File
#!define ROUTE_LUA "/etc/kamailio/route.lua"
####### Global Parameters #########
## LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
#!ifdef WITH_DEBUG
debug = 4
log_stderror = yes
#!else
debug = 2
log_stderror = no
#!endif
memdbg = 5
memlog = 5
# log setting
log_facility = LOG_LOCAL0
listen = MY_UDP_ADDR advertise MY_EXTERNAL_IP:MY_UDP_PORT
children = 8
async_workers=8
####### Modules Section ########
#!ifdef WITH_SRCPATH
mpath = "modules/"
#!else
mpath = "/usr/local/lib64/kamailio/modules/"
#!endif
# ------------------ module loading ----------------------------------
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "maxfwd.so"
loadmodule "nathelper.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "path.so"
loadmodule "jsonrpcs.so"
loadmodule "app_lua.so"
loadmodule "dispatcher.so"
loadmodule "json.so"
loadmodule "cfg_rpc.so"
loadmodule "ctl.so"
# ----------------- setting module-specific parameters ---------------
# ----- rr params -----
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 0)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 1)
# ----- dispatcher params -----
modparam("dispatcher", "list_file", DISPATCHER_FILE)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "ds_ping_interval", 10)
modparam("dispatcher", "ds_ping_from",
"sip:ping@test.my.com")
# ----- nathelper params ----
modparam("nathelper", "received_avp", "$avp(s:rcv)")
# ----- ctl ------
modparam("ctl", "binrpc", "tcp:MY_IP_ADDR:2046")
# ----- app_lua params ----
modparam("app_lua", "reload", 1)
modparam("app_lua", "load", ROUTE_LUA)
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
modparam("tm", "fr_timer", 5000)
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "restart_fr_on_each_reply", 1)
modparam("tm", "pass_provisional_replies", 1)
modparam("tm", "contacts_avp", "tm_contacts");
modparam("tm", "contact_flows_avp", "tm_contact_flows");
cfgengine "lua"
route.lua
```
function ksr_request_route()
local request_method = headers.get("$rm") or "";
local user_agent = headers.get("$ua") or "";
KSR.info("recieve request " .. request_method);
KSR.exit();
return 1;
end
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1577#issuecomment-404720655