<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I know ruby is pretty new to KEMI, so I understand this might not be supported.</div><div class=""><br class=""></div><div class="">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 (<a href="https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemimods/#ksrxexit" class="">https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemimods/#ksrxexit</a>) I can see either a native `exit` or a return from the request_route is recommended.</div><div class=""><br class=""></div><div class="">The latter of these works fine, however the former throws the following error when called either within the request_route function or any others:</div><div class=""><br class=""></div><div class=""><div class="">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</div><div class="">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)</div><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">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.</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Any direction on how to correctly exit in similar ways to native or other KEMI implementations would be appreciated.</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">By the way, thanks Daniel for writing this module! This makes Kamailio significantly more accessible for myself and others like me!<br class=""><br class="">________________________________<br class=""><br class="">Andrew White - Director<br class="">uConnected<br class=""><a href="mailto:andrew@uconnected.com.au" class="">Email: andrew@uconnected.com.au</a><br class="">Web: www.uConnected.com.au<br class=""></div></div></div>
</div>
<br class=""></div></body></html>