Hey Alex,
Thanks…that what I was thinking, but the customer has the logic in a C function already and he would like to reuse it.
On Dec 4, 2015, at 12:22 PM, Alex Balashov abalashov@evaristesys.com wrote:
Mack,
The language modules take advantage of the fact that those other languages (e.g. Lua, Python) are higher-level, _interpreted_ languages, and that their interpreters provide an API for embedding them into C programs. One cannot easily embed an on-the-fly C compiler into a C program.
Writing a Kamailio module is certainly the easiest way to call a custom C function from route script, and it's not terribly hard to get started. If your needs are very simple, you don't have to make extensive study of the module API. Just follow/modify this example module:
https://github.com/kamailio/kamailio/tree/master/modules/print
'print' is a stub that doesn't do anything, but provides a skeleton from which you can build your own module.
I suppose you could also embed your C function into a library that can be called from an interpreted language supported by Kamailio (Lua, Python, Perl, etc.), but that seems like it would be vastly more complicated than writing a Kamailio module.
Finally, are you one hundred percent sure that the functionality you need cannot be achieved any other way?
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC 303 Perimeter Center North, Suite 300 Atlanta, GA 30346 United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users