<div dir="ltr">Thank you Henning!.<div><br></div><div>Just as an FYI, I decided to continue using the original .cfg of Kamailio and just do jsdt_run and work with KSR whenever I need to do something in a scripting language. In the end I couldn't find a way to load multiple .js and by looking at the C code I believe it can't be done.<div><br clear="all"><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Regards,</div><div dir="ltr"><br><table width="100%" border="0" cellpadding="0" cellspacing="10" style="border-spacing:10px;background-color:transparent"><tbody><tr><td align="left" valign="top" width="10" style="padding:0px"><p style="margin:0px 0px 10px;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:16px"></p><p style="margin:0px 0px 10px;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:16px"><a href="https://www.facebook.com/bvisonl" style="color:rgb(36,169,57);text-decoration:none;display:inline;background-color:transparent" target="_blank"><img width="24" height="24" src="https://s3.amazonaws.com/htmlsig-assets/polygon/facebook.png" alt="Facebook" style="border:none;vertical-align:middle;display:inline"></a><a href="https://twitter.com/benjaminvison" style="color:rgb(36,169,57);text-decoration:none;display:inline;background-color:transparent" target="_blank"><img width="24" height="24" src="https://s3.amazonaws.com/htmlsig-assets/polygon/twitter.png" alt="Twitter" style="border:none;vertical-align:middle;display:inline"></a><a href="https://instagram.com/bvisonl/" style="color:rgb(36,169,57);text-decoration:none;display:inline;background-color:transparent" target="_blank"><img width="24" height="24" src="https://s3.amazonaws.com/htmlsig-assets/polygon/instagram.png" alt="Instagram" style="border:none;vertical-align:middle;display:inline"></a></p></td><td style="padding:0px;width:6px"></td><td align="left" valign="top" style="padding:0px"><p style="margin:0px 0px 10px;font-size:14px;font-family:Helvetica,Arial,sans-serif;line-height:16px;color:rgb(33,33,33)"><span style="font-weight:bold;display:inline">Benjamín Visón</span> <span style="display:inline">/</span> <span style="display:inline">IT Engineer / Software Developer</span><span style="display:inline"><br></span><a href="mailto:bvisonl@gmail.com" style="color:rgb(36,169,57);text-decoration:none;display:inline;background-color:transparent" target="_blank">bvisonl@gmail.com</a><span style="display:inline"> / (</span><span style="display:inline">829)-664-5163</span></p><div><span style="display:inline"><br></span></div></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 3, 2020 at 1:59 PM Henning Westerholt <<a href="mailto:hw@skalatan.de" target="_blank">hw@skalatan.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="DE">
<div>
<p class="MsoNormal"><span>Hello Hector,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">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">😉</span><span lang="EN-GB">  In most of the cases you will wait for IO (DB, DNS etc..) anyway.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">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" target="_blank">https://www.kamailio.org/wiki/kemi/performance-tests/5.2.x</a>  and also the scripts to do some benchmarking by yourself.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt –
</span><span><a href="https://skalatan.de/blog/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services –
</span><span><a href="https://gilawa.com/" target="_blank"><span lang="EN-GB" style="color:rgb(5,99,193)">https://gilawa.com</span></a></span><span>
<span lang="EN-GB"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Benjamín Visón<br>
<b>Sent:</b> Wednesday, June 3, 2020 6:45 PM<br>
<b>To:</b> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<b>Cc:</b> Hector Ventura Reyes <<a href="mailto:hectorvent@gmail.com" target="_blank">hectorvent@gmail.com</a>><br>
<b>Subject:</b> [SR-Users] Trouble loading multiple javascripts with KEMI<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></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).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></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")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">cfgengine "jsdt"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">In the example above, only functions in file2 are recognized.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></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>.<u></u><u></u></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!)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Saludos,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<table border="0" cellspacing="10" cellpadding="0" width="100%" style="width:100%;margin-left:35.4pt;border-spacing:10px">
<tbody>
<tr>
<td width="25" valign="top" style="width:18.75pt;padding:0cm">
<div>
<p class="MsoNormal"><img border="0" width="25" height="25" style="width: 0.2604in; height: 0.2604in;" id="gmail-m_6040937247107349834gmail-m_5144002134251769739Bild_x0020_1" src="cid:1727bad07f24cff311"><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><img border="0" width="25" height="25" style="width: 0.2604in; height: 0.2604in;" id="gmail-m_6040937247107349834gmail-m_5144002134251769739Bild_x0020_2" src="cid:1727bad07f35b16b22"><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><img border="0" width="25" height="25" style="width: 0.2604in; height: 0.2604in;" id="gmail-m_6040937247107349834gmail-m_5144002134251769739Bild_x0020_3" src="cid:1727bad07f3692e333"><u></u><u></u></p>
</div>
</td>
</tr>
<tr>
<td width="6" style="width:4.5pt;padding:0cm"></td>
<td valign="top" style="padding:0cm">
<p style="margin-right:0cm;margin-bottom:7.5pt;margin-left:0cm;line-height:12pt">
<b><span style="font-size:10.5pt;font-family:Helvetica,sans-serif;color:rgb(33,33,33)">Benjamín Visón</span></b><span style="font-size:10.5pt;font-family:Helvetica,sans-serif;color:rgb(33,33,33)"> / IT Engineer / Software Developer<br>
<a href="mailto:bvisonl@gmail.com" target="_blank"><span style="color:rgb(36,169,57);text-decoration:none">bvisonl@gmail.com</span></a> / (829)-664-5163<u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>