<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)"><style><!--
/* Font Definitions */
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>I added a comment to the PR. I’m not entirely confident with my answers but I did some basic testing to try and verify.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p>  * one can load another JS file in the Kamailio KEMI JS file, but this another JS file has its content following the node.js module specs, right? It cannot be just any JS code<o:p></o:p></p><p>I think yes.<o:p></o:p></p><p> <o:p></o:p></p><p> * does it allow loading any node.js modules available out there that do not require the node.js core modules (which are embedded (compiled) in node.js binary)?<o:p></o:p></p><p>I think no as currently implemented.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Cheers,<o:p></o:p></p><p class=MsoNormal>Ian<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Daniel-Constantin Mierla <miconda@gmail.com> <br><b>Sent:</b> Thursday, February 24, 2022 11:42 PM<br><b>To:</b> Ian Carlson <ian@xantek.net>; 'Kamailio (SER) - Users Mailing List' <sr-users@lists.kamailio.org><br><b>Subject:</b> Re: [SR-Users] KEMI jsdt CommonJS-based module<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p>Hello,<o:p></o:p></p><p>I just merged the pull request, thanks!<o:p></o:p></p><p>I had some remarks/questions in a comment made on PR, let me post them here for discussing further:<br><br>  * one can load another JS file in the Kamailio KEMI JS file, but this another JS file has its content following the node.js module specs, right? It cannot be just any JS code<o:p></o:p></p><p>  * does it allow loading any node.js modules available out there that do not require the node.js core modules (which are embedded (compiled) in node.js binary)?<o:p></o:p></p><p>Cheers,<br>Daniel<o:p></o:p></p><div><p class=MsoNormal>On 23.02.22 13:55, Ian Carlson wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Greetings,<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Thanks for the feedback. Since this was something I requested, I thought I'd have a go. I was able to log messages from nested require() via JSDT loaded file. I'm barely literate in C, so hopefully, I'm doing something helpful and not wasting everyone's time. If I happen to be on a good track, I'll try to keep going with a bit of guidance. <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><a href="https://github.com/kamailio/kamailio/issues/3037">https://github.com/kamailio/kamailio/issues/3037</a><o:p></o:p></p><p class=MsoNormal><a href="https://github.com/kamailio/kamailio/pull/3038">https://github.com/kamailio/kamailio/pull/3038</a><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Cheers,<o:p></o:p></p><p class=MsoNormal>Ian<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> Daniel-Constantin Mierla <a href="mailto:miconda@gmail.com"><miconda@gmail.com></a> <br><b>Sent:</b> Monday, February 21, 2022 4:44 AM<br><b>To:</b> Kamailio (SER) - Users Mailing List <a href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a>; Ian Carlson <a href="mailto:ian@xantek.net"><ian@xantek.net></a><br><b>Subject:</b> Re: [SR-Users] KEMI jsdt CommonJS-based module<o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p>Hello,<o:p></o:p></p><p>I didn't notice that require() was not in the duktape 2.x, I will try to add support for module-duktape when I get a chance. If someone wants to do it, pull requests are welcome -- it does not seem to be complex:<o:p></o:p></p><p>  * <a href="https://github.com/svaarala/duktape/tree/master/extras/module-duktape">https://github.com/svaarala/duktape/tree/master/extras/module-duktape</a><o:p></o:p></p><p>The module-node sounds interesting, but not being familiar with node.js, looks it need more work to enable it:<o:p></o:p></p><p>  * <a href="https://github.com/svaarala/duktape/tree/master/extras/module-node">https://github.com/svaarala/duktape/tree/master/extras/module-node</a><o:p></o:p></p><p>Cheers,<br>Daniel<o:p></o:p></p><div><p class=MsoNormal>On 20.02.22 00:50, Ian Carlson wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Greetings,<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>I’m new to Kamailio and working to add Kamailio to an existing Asterisk solution.  I’m attracted to the idea of routing via KEMI jsdt since our Asterisk ARI is using nodejs.  Playing with KEMI jsdt I was trying to use require() to break up the monolithic routing script.  It seems that Kamailio uses Ducktape 2 without module-node or module-ducktape, requiring all routing in a single file?  I’d appreciate any suggested practices for managing Kamailio configurations.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>Cheers,<o:p></o:p></p><p class=MsoNormal>Ian<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><br><br><br><o:p></o:p></p><pre>__________________________________________________________<o:p></o:p></pre><pre>Kamailio - Users Mailing List - Non Commercial Discussions<o:p></o:p></pre><pre>  * <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><o:p></o:p></pre><pre>Important: keep the mailing list in the recipients, do not reply only to the sender!<o:p></o:p></pre><pre>Edit mailing list options or unsubscribe:<o:p></o:p></pre><pre>  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre></blockquote><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com">www.asipto.com</a><o:p></o:p></pre><pre><a href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a><o:p></o:p></pre><pre>Kamailio Advanced Training - Online<o:p></o:p></pre><pre>  Feb 21-24, 2022 (America Timezone)<o:p></o:p></pre><pre>  * <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a><o:p></o:p></pre></blockquote><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla -- <a href="http://www.asipto.com">www.asipto.com</a><o:p></o:p></pre><pre><a href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a><o:p></o:p></pre><pre>Kamailio Advanced Training - Online<o:p></o:p></pre><pre>  March 28-31, 2022 (Europe Timezone)<o:p></o:p></pre><pre>  * <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a><o:p></o:p></pre></div></body></html>