[sr-dev] some missing kemi module functions

David Escartin descartin at sonoc.io
Wed Feb 5 11:41:01 CET 2020

Dear Daniel

i have been rewriting all the native configuration we have for a proxy to
kemi lua and i'm (i think) having it working fine, but i'm still missing
some functions to be migrated, some of those are not even working with
Now i'm using version: kamailio 5.4.0-dev2 (x86_64/linux) f268aa

-be able to select facility on KSR.xlog, equivalent to xlog("LOG_LOCAL7",
"L_NOTICE", "$var(x)");
-sipt module functions
-dialog dlg_set_ruri function (maybe some others), this is now even working
with modf (ERROR: app_lua [app_lua_api.c:1633]: sr_kemi_lua_modf():
function 'dlg_set_ruri' is not available)
-tm t_relay_to_tcp

if you have any update about this function exportation, it would be great

best regards

El jue., 27 jun. 2019 a las 15:28, David Escartin (<descartin at sonoc.io>)

> Hello Daniel
> thanks a lot for the feedback, ok i will try the hdr functions, i missed
> them in the documentation.
> About call_obj, yes, the commits were pushed today
> if i see something else i will let you know
> best regards
> david
> El jue., 27 jun. 2019 a las 14:50, Daniel-Constantin Mierla (<
> miconda at gmail.com>) escribió:
>> And the functions for dialog vars are in latest master branch, -dev5 is a
>> bit older, last one has -dev6. Fetch latest master branch and try again.
>> On Thu, Jun 27, 2019 at 2:46 PM Daniel-Constantin Mierla <
>> miconda at gmail.com> wrote:
>>> Hello,
>>> in short, all functions exported to native kamailio.cfg will be exported
>>> to KEMI if they don't have an (native) alternative in those scripting
>>> languages. If some are missing, that's because nobody did it so far for
>>> specific modules and maybe I missed some functions for modules that already
>>> have some exports to KEMI.
>>> Those from sdpops likely I missed them, I will export them. Then I am
>>> not sure why sipt was skipped, should be exported as well -- if nobody does
>>> it, I will do it sometime soon. For call_obj I already saw commits pushed
>>> to master. Variants of xlog functions could be missing, because was one of
>>> the first modules exported to KEMI, but with the commonly used (at least by
>>> me) functions, needed for testing, then probably I didn't approach again
>>> the module.
>>> Regarding the header operations, the remove, insert and append are
>>> exported via KSR.hdr submodule, not KSR.textops. It was how Lua had it in
>>> the previous version and when I started with KEMI, I worked on old lua
>>> module code. Maybe confusing a bit, anyhow the docs are at:
>>>   *
>>> https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/core/#ksrhdr-submodule
>>> Cheers,
>>> Daniel
>>> On Thu, Jun 27, 2019 at 12:07 PM David Escartin <descartin at sonoc.io>
>>> wrote:
>>>> hello all
>>>> we are trying to rewrite our code to lua kemi, and we have found some
>>>> issues/questions until we would like to share with you.
>>>> -module call_obj not exported, we have tested a patch for the module to
>>>> export the functions to kemi, which seems works fine
>>>> -KSR.xlog.xinfo seems not able to select a facility as we currently can
>>>> like xlog("LOG_LOCAL7", "L_NOTICE", "$var(xxxx)");
>>>> -module sipt not exported yet, must use ksr.x.modf ? will be exported
>>>> for a future version?
>>>> -on 5.3.0-dev5 we don't see the KSR.dialog.var_sets() and
>>>> KSR.dialog.var_get/e/w() functions in the code, so we do use KSR.pv
>>>> functions to set and retrieve those dialog vars. However i see them on
>>>> master branch. Which kamailio release would have them?
>>>> -sdpops function sdp_with_codecs_by_name seems to not me exported, is
>>>> it on a todo list?
>>>> -textops module, missing remove_hf and append_hf functions exported. We
>>>> already did a patch for the remove_hf, despite we could work with textopsx
>>>> remove_hf_value function to get the almost the same functionality.
>>>> However, with append_hf i'm having some more issues.
>>>> We cannot use modf to exec those funtions, we get something like
>>>> For ---> KSR.x.modf("append_hf", "User-Agent: test", "To");
>>>> I get something like ----> Jun 27 07:19:16 proxy-1
>>>> /usr/local/kamailio/sbin/kamailio[5525]: ERROR: app_lua [app_lua_sr.c:188]:
>>>> lua_sr_modf(): function 'append_hf' has fixup - cannot be used
>>>> I could append a new header and not only at the end of the message by
>>>> replacing a header called the same way, by doing something like
>>>> KSR.textopsx.insert_hf_value("header", "value");
>>>> KSR.textopsx.remove_hf_value("header[-1]");
>>>> but i'm not able to insert a header after another different one like we
>>>> can do with append_hf("header:value", "To") for instance.
>>>> Is it expected to have it on a next commit those append_hf and
>>>> remove_hf exported.
>>>> Would we do a pull request with the ki_remove_hf we already have and
>>>> the call_obj functions too? We can check to export append_hf too if it's
>>>> not planned to be done
>>>> thanks a lot and regards
>>>> david
>>>> _______________________________________________
>>>> Kamailio (SER) - Development Mailing List
>>>> sr-dev at lists.kamailio.org
>>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
>>> --
>>> Daniel-Constantin Mierla - http://www.asipto.com
>>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> --
>> Daniel-Constantin Mierla - http://www.asipto.com
>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> _______________________________________________
>> Kamailio (SER) - Development Mailing List
>> sr-dev at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200205/cf7bfa38/attachment.html>

More information about the sr-dev mailing list