<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.E-MailFormatvorlage19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hello Hector,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">just answering about the performance part of the question – the performance impact is for the large majority of deployments outside not noticeable (for Lua, Python). Lua is comparable
 to native script, python is a bit slower. But you should not need to worry about it until you are going into the +100.000s subscriber range.
</span><span lang="EN-GB" style="font-family:"Segoe UI Emoji",sans-serif;mso-fareast-language:EN-US">😉</span><span lang="EN-GB" style="mso-fareast-language:EN-US">  In most of the cases you will wait for IO (DB, DNS etc..) anyway.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">There has been some presentation from Daniel on past Kamailio World editions about it, you find the details e.g. at
<a href="https://www.kamailio.org/wiki/kemi/performance-tests/5.2.x">https://www.kamailio.org/wiki/kemi/performance-tests/5.2.x</a>  and also the scripts to do some benchmarking by yourself.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">-- <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Henning Westerholt –
</span><span style="mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Kamailio services –
</span><span style="mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span style="mso-fareast-language:EN-US">
<span lang="EN-GB"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org>
<b>On Behalf Of </b>Benjamín Visón<br>
<b>Sent:</b> Wednesday, June 3, 2020 6:45 PM<br>
<b>To:</b> sr-users@lists.kamailio.org<br>
<b>Cc:</b> Hector Ventura Reyes <hectorvent@gmail.com><br>
<b>Subject:</b> [SR-Users] Trouble loading multiple javascripts with KEMI<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">I am using the module <b>app_jsdt
</b>with <b>KEMI </b>and I am having trouble loading multiple javascript files. The interpreter only notices the last file that's loaded.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">What I am trying to do is separate my logic so that everything is not inside the kamailio.conf.js (or the main file the contains the necessary functions if you will).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">modparam("app_jsdt", "load", "/etc/kamailio/file1.js")<br>
modparam("app_jsdt", "load", "/etc/kamailio/file2.js")<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">cfgengine "jsdt"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">In the example above, only functions in file2 are recognized.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">I am aware that I can use jsdt_run or jsdt_load but from KEMI I don't see a clear way to link this with things like events and timers or replies that don't necessarily go through the
<b>request_route</b>.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><br>
(As a plus, I am wondering on performance on Javascript vs Python/Lua and if it's viable on high load, if anyone can throw 2 cents on that it would be helpful!)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Saludos,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="10" cellpadding="0" width="100%" style="width:100.0%;margin-left:35.4pt;border-spacing:10px">
<tbody>
<tr>
<td width="25" valign="top" style="width:18.75pt;padding:0cm 0cm 0cm 0cm">
<div>
<p class="MsoNormal"><img border="0" width="25" height="25" style="width:.2604in;height:.2604in" id="Bild_x0020_1" src="cid:image001.png@01D639E1.502316B0"><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><img border="0" width="25" height="25" style="width:.2604in;height:.2604in" id="Bild_x0020_2" src="cid:image002.png@01D639E1.502316B0"><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><img border="0" width="25" height="25" style="width:.2604in;height:.2604in" id="Bild_x0020_3" src="cid:image003.png@01D639E1.502316B0"><o:p></o:p></p>
</div>
</td>
</tr>
<tr>
<td width="6" style="width:4.5pt;padding:0cm 0cm 0cm 0cm"></td>
<td valign="top" style="padding:0cm 0cm 0cm 0cm">
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:7.5pt;margin-left:0cm;line-height:12.0pt">
<b><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#212121">Benjamín Visón</span></b><span style="font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#212121"> / IT Engineer / Software Developer<br>
<a href="mailto:bvisonl@gmail.com" target="_blank"><span style="color:#24A939;text-decoration:none">bvisonl@gmail.com</span></a> / (829)-664-5163<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>