Thanks so much for your quick response and fix Daniel!
This works perfectly! I’ve come across another minor bug around KEMI/Ruby, but I’ll post
it to GitHub issues.
See you at Kamailio World in a few weeks, looks like I owe you a beer!
Cheers,
________________________________
Andrew White - Director
uConnected
Email: andrew(a)uconnected.com.au
Web:
On 23 Mar 2019, at 12:05 am, Daniel-Constantin Mierla
<miconda(a)gmail.com> wrote:
Hello,
can you try with latest master or pick the next commit in your local clone?
*
https://github.com/kamailio/kamailio/commit/97189d7508a3946c2b3de49c1786143…
<https://github.com/kamailio/kamailio/commit/97189d7508a3946c2b3de49c178614356d816508>
I just pushed it trying to catch the exception triggered by 'exit' and don't
log error messages in that case.
Cheers,
Daniel
On 22.03.19 04:48, Andrew White wrote:
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/…
<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
uConnected
Email: andrew(a)uconnected.com.au <mailto:andrew@uconnected.com.au>
Web:
www.uConnected.com.au <http://www.uconnected.com.au/>
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users(a)lists.kamailio.org <mailto:sr-users@lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
<https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
--
Daniel-Constantin Mierla --
www.asipto.com <http://www.asipto.com/>
www.twitter.com/miconda <http://www.twitter.com/miconda> --
www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
Kamailio World Conference - May 6-8, 2019 --
www.kamailioworld.com
<http://www.kamailioworld.com/>
Kamailio Advanced Training - Mar 25-27, 2019, in Washington, DC, USA --
www.asipto.com
<http://www.asipto.com/>