<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>To add a bit more ...</p>
<p>The list of the methods exported to KSR module in python (or any
other KEMI scripting language) are listed at:</p>
<p> -
<a class="moz-txt-link-freetext" href="http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/">http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/</a></p>
<p>There is a python script contributed that scans the C code in
kamailio and extracts the KEMI exports, maybe you can adjust it to
generate code completion rules:</p>
<p> -
<a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio-docs/blob/master/kamailio-kemi-framework/tools/generate_module_docs.py">https://github.com/kamailio/kamailio-docs/blob/master/kamailio-kemi-framework/tools/generate_module_docs.py</a><br>
</p>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 15.02.18 01:16, Anthony Alba wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CADkWibcgGLsGsn-w2_ADy_K8wM-=b68aR617Cn__qddmMUn96g@mail.gmail.com">
<div dir="auto">They are created in C code and not visible as .py
files.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Feb 15, 2018 12:03 AM, "Grant
Bagdasarian" <<a href="mailto:gb@cm.nl"
moz-do-not-send="true">gb@cm.nl</a>> wrote:<br
type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Where would one get the files which are imported when
creating a Kamailio file using python?<br>
import Router.Logger as Logger<br>
import KSR as KSR<br>
<br>
Would be awesome if we could reference these and get code
completion when using for instance Visual Studio code.<br>
So, basically, I'm looking for the KSR.py and Router.py
files, but I cannot find them.<br>
<br>
Regards,<br>
Grant<br>
<br>
-----Original Message-----<br>
From: sr-users [mailto:<a
href="mailto:sr-users-bounces@lists.kamailio.org"
moz-do-not-send="true">sr-users-bounces@<wbr>lists.kamailio.org</a>]
On Behalf Of Daniel-Constantin Mierla<br>
Sent: woensdag 7 februari 2018 16:02<br>
To: Aleksandar Sosic <<a
href="mailto:alex.sosic@timenet.it" moz-do-not-send="true">alex.sosic@timenet.it</a>><br>
Cc: Kamailio (SER) - Users Mailing List <<a
href="mailto:sr-users@lists.kamailio.org"
moz-do-not-send="true">sr-users@lists.kamailio.org</a>><br>
Subject: Re: [SR-Users] KEMI<br>
<br>
I am more into Lua when it comes on doing something the
native kamailio.cfg cannot do, that's because Lua has a
decent range of extensions (external Lua libraries).<br>
<br>
JavaScript was added for those that do not need a lot of
external extensions, but want to have script reload.<br>
<br>
Same for Squirrel, but that language is not so popular as
JavaScript, however, there could be people liking it, being
very minimal, thus expecting to need very low resources.<br>
<br>
Anyhow, once implemented, a kemi interpreter module should
not need much maintenance. New kemi functions will be
exported directly from the other modules.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<br>
On 07.02.18 14:12, Aleksandar Sosic wrote:<br>
> Thanks Dan for the extensive answer!<br>
><br>
> My last question then is what kemi language do you use
personally? :D<br>
><br>
> Kind regards,<br>
> --<br>
> Aleksandar Sosic<br>
> mail: <a href="mailto:alex.sosic@timenet.it"
moz-do-not-send="true">alex.sosic@timenet.it</a><br>
> skype: alex.sosic<br>
> cell: <a href="tel:%2B385%2091%202505%20146"
value="+385912505146" moz-do-not-send="true">+385 91 2505
146</a><br>
><br>
><br>
> On Tue, Feb 6, 2018 at 8:44 PM, Daniel-Constantin
Mierla<br>
> <<a href="mailto:miconda@gmail.com"
moz-do-not-send="true">miconda@gmail.com</a>> wrote:<br>
>> The C code is the same for 99% of the KSR functions
available either<br>
>> in python or javascript (or the other kemi
languages). Only KSR.pv<br>
>> and KSR.x functions are implemented in the
app_python or app_jsdt modules.<br>
>> So if such a KSR function is broken, it is the same
everywhere<br>
>><br>
>> Probably KSR.pv can be moved in a common place, but
KSR.x are<br>
>> specific extensions for each interpreter, so it
will stay in app_*.<br>
>><br>
>> Then of course, it is a matter of the script
interpreter, python vs<br>
>> js ducktape, which are external project, we just
bind to them. Also,<br>
>> it is about the maintenance of app_python and
app_jsdt. I am not the<br>
>> developer of app_python and I cannot assert its
state, I just added<br>
>> the kemi enhancement. app_jsdt was developed by me,
but I haven't<br>
>> used it extensively so far.<br>
>><br>
>> Probably you can do some basic configs and test
yourself and see what<br>
>> fits your needs better, you can start from the
examples at:<br>
>><br>
>> -<br>
>> <a
href="https://github.com/kamailio/kamailio/tree/master/misc/examples/kemi"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://github.com/kamailio/<wbr>kamailio/tree/master/misc/<wbr>examples/kemi</a><br>
>><br>
>> In long term, you have to look at the extensions
you may need, what<br>
>> python offers vs ducktape js interpreter in terms
of their own<br>
>> extensions and libraries.<br>
>><br>
>> Cheers,<br>
>> Daniel<br>
<br>
--<br>
Daniel-Constantin Mierla<br>
<a href="http://www.twitter.com/miconda" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a>
-- <a href="http://www.linkedin.com/in/miconda"
rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 5-7, 2018, Berlin - <a
href="http://www.asipto.com" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a
href="http://www.kamailioworld.com" rel="noreferrer"
target="_blank" moz-do-not-send="true">www.kamailioworld.com</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org"
moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org"
moz-do-not-send="true">sr-users@lists.kamailio.org</a><br>
<a
href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</blockquote>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 5-7, 2018, Berlin - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>