Discussion:
[SR-Users] send_reply in app_java or app_mono?
Tom Johnson
2014-09-11 20:03:43 UTC
Permalink
Is there a way to call the send_reply method of the route from either Java or csharp? As I have been having issues with the app_java, I have been looking at app_mono and it seems to have better access to the variables, etc. However, the SR.core.ModF only seems to take methods that do not take parameters.

Or for that matter, is there a way to return something back to the route in the config file which it can use to call send_reply? I have a strange requirement to return 202 rather than 200 from subscription requests and a 603 if it fails.

Tom Johnson<mailto:tjohnson-***@public.gmane.org> | Senior Software Engineer
O: 703-543-2118 | F: 703-543-2099
5870 Trinity Parkway, Suite 600, Centreville, VA 20120
[cid:image001.png-***@public.gmane.org]<http://www.microautomation.com/>
Daniel-Constantin Mierla
2014-09-11 20:32:28 UTC
Permalink
Again, I can't help on using app_java.

As for app_mono, which I developed more as an experiment, not really
using it, sending a reply from a mono script is not possible at this
moment. I exported just a few functions to the mono module, sending
replies are not among them. If someone wants to take the lead and add
new features to app_mono, I would happily assist.

The limitation of executing only config functions without parameter
comes from the design of the config functions which do so called 'fixup'
at startup -- this is a mechanism that pre-compile the parameters in a
binary form, which is then used for executing the functions during
runtime. Thus executing a function with string parameter can lead to a
crash.

But you can return values back to the script via config variables and
use them as parameter to sl send reply functions. See:

- http://www.kamailio.org/wiki/embeddedapi/4.1.x/mono#class_pv

In terms of embedded interpreters, app_lua has the largest set of
Kamailio functions exported to Lua -- see its API in the wiki.

Cheers,
Daniel
Post by Tom Johnson
Is there a way to call the send_reply method of the route from either
Java or csharp? As I have been having issues with the app_java, I
have been looking at app_mono and it seems to have better access to
the variables, etc. However, the SR.core.ModF only seems to take
methods that do not take parameters.
Or for that matter, is there a way to return something back to the
route in the config file which it can use to call send_reply? I have
a strange requirement to return 202 rather than 200 from subscription
requests and a 603 if it fails.
Engineer
O: 703-543-2118 | F: 703-543-2099
5870 Trinity Parkway, Suite 600, Centreville, VA 20120
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
Konstantin M.
2014-09-11 22:45:29 UTC
Permalink
Tom, please take a look to:
git_root/modules/app_java/kamailio_java_folder/java-untested
here you can see a part of code in Kamailio.java:
// retval = KamExec("append_hf", "P-hint: VOICEMAIL\r\n");

so, you can execute kamailio command using KamExec(command, params)
Post by Tom Johnson
Is there a way to call the send_reply method of the route from either
Java or csharp? As I have been having issues with the app_java, I have
been looking at app_mono and it seems to have better access to the
variables, etc. However, the SR.core.ModF only seems to take methods that
do not take parameters.
Or for that matter, is there a way to return something back to the route
in the config file which it can use to call send_reply? I have a strange
requirement to return 202 rather than 200 from subscription requests and a
603 if it fails.
O: 703-543-2118 | F: 703-543-2099
5870 Trinity Parkway, Suite 600, Centreville, VA 20120
<http://www.microautomation.com/>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...