Hello,
version 5.0 doesn't have a lot of the functions from kamailio modules exported to kemi (KSR module). Not even v5.1 will have all of them, but I expect to be over 80% in v5.1.
There is a generic kemi function that can be used to execute any (most of) functions from modules KSR.x.modf(...):
-
http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemimods/#ksrxmodf
Hello Daniel,hello List,
after reading the fresh released kemi documentation (Thanks for that!) on github i start to configure an kemi lua configuration. It seems to be that there is not an dispatcher export to kemi in my installation. Or i missconfigured something? How to use dispatcher with kemi?
1.) First try to solve this - use param "register" "modulename" to app_lua - doesnt work2.) grep around in the auto kemi in/export messages in debug startup - nothing to see.3.) grep around in the kamcmd api.list command for lua - no dispatcher
here the intressting parts of the configs and lua-script:
kamailio.cfg...loadmodule "dispatcher.so"loadmodule "permissions.so"loadmodule "avpops.so"#!ifdef WITH_CFGLUAloadmodule "app_lua.so"modparam("app_lua", "reload", 1)modparam("app_lua", "register", "dispatcher")#!endif
#!ifdef WITH_CFGLUAmodparam("app_lua", "load", "/etc/kamailio/lua/kamailio-kemi-lua.lua")cfgengine "lua"#!elseimport_file "request-route.cfg"#!endif...
kamailio-kemi-lua.luafunction ksr_request_route()...-- dispatch destinationsif KSR.permissions.allow_source_address(FLT_EDGE) thenKSR.info("new $fU -> $rU in permissions");direction = "inbound";routing_target = FLT_FSNODE;ksr_route_dispatch(direction, routing_target);KSR.x.exit();end
KSR.info("NOT-OKAY - $rU dropped");-- End of Route()KSR.sl.sl_send_reply(407, "Proxy Authentication Required. See IP GUI");return 1;...end
--- dispatcher routefunction ksr_route_dispatch(direction, routing_target)
KSR.xlog.xinfo("new $fU -> $rU in routing_target ksr_route_dispatch");KSR.info(routing_target);if (routing_target == nil) thenKSR.xlog.xinfo("routing_target nil");KSR.sl.sl_send_reply(604, "Does Not Exist Anywhere");KSR.x.exit();end
if KSR.dispatcher.ds_select_dst(routing_target, 4) thensend_reply(404, "No destination");KSR.x.exit();endksr_route_myheader();ksr_route_relay();KSR.x.exit();end
/usr/sbin/kamailio[26763]: ERROR: app_lua [app_lua_api.c:713]: app_lua_run_ex(): error from Lua: /etc/kamailio/lua/kamailio-kemi-lua.lua:131: attempt to index field 'dispatcher' (a nil value)
kamailio -vversion: kamailio 5.0.4 (x86_64/linux)flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RESADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MBpoll method support: poll, epoll_lt, epoll_et, sigio_rt, select.id: unknowncompiled on 20:20:24 Nov 16 2017 with gcc 4.8.5
rpm -aq | grep kamkamailio-mysql-5.0.4-26.el7.centos.x86_64kamailio-5.0.4-26.el7.centos.x86_64kamailio-lua-5.0.4-26.el7.centos.x86_64kamailio-ims-5.0.4-26.el7.centos.x86_64
rpm -ql kamailio-5.0.4 | grep disp/usr/lib64/kamailio/modules/dispatcher.so/usr/share/doc/kamailio/modules/README.dispatcher/usr/share/kamailio/dbtext/kamailio/dispatcher
--
Kind Regards
*Karsten Horsmann*
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - www.asipto.com Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com