[SR-Users] KEMI Ruby - exit from within function

Andrew White andrew at uconnected.com.au
Fri Mar 22 04:48:49 CET 2019

Hi all,

I know ruby is pretty new to KEMI, so I understand this might not be supported.

I’ve been able to build a functional basic configuration using KEMI based app_ruby. However the function KSR::x.exit is not exposed to the interpreter. Reading up on the function (https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemimods/#ksrxexit <https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemimods/#ksrxexit>) I can see either a native `exit` or a return from the request_route is recommended.

The latter of these works fine, however the former throws the following error when called either within the request_route function or any others:

Mar 22 03:40:46 guest /usr/sbin/kamailio[17474]: ERROR: {1 19731 BYE 8u6We4ReU01GuU-zoa7VuqC.qWwwg29S} app_ruby [app_ruby_api.c:105]: app_ruby_print_last_exception(): exception: exit
Mar 22 03:40:46 guest /usr/sbin/kamailio[17474]: ERROR: {1 19731 BYE 8u6We4ReU01GuU-zoa7VuqC.qWwwg29S} app_ruby [app_ruby_api.c:1078]: app_ruby_run_ex(): ruby exception (6) on callback for: ksr_request_route (res type: 17)

It appears the app_ruby wrapper is seeing an exit as an exception and throwing an error. I’m unsure if this is affecting my actual flow (still building the config), but the error in the logs is certainly annoying. Returning from the request_route function works fine, however this is obviously harder to do from within a sub function.

Any direction on how to correctly exit in similar ways to native or other KEMI implementations would be appreciated.

By the way, thanks Daniel for writing this module! This makes Kamailio significantly more accessible for myself and others like me!


Andrew White - Director
Email: andrew at uconnected.com.au
Web: www.uConnected.com.au

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190322/c398d854/attachment.html>

More information about the sr-users mailing list