<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 29, 2008, at 12:38 PM, Евгений Золотов wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div bgcolor="#ffffff"><div><font face="Arial" size="2"><div><font face="Arial" size="2">We try to write some script extensions for application LUA & JS & Perl.<br>There are some questions :</font></div><div> </div><div><font face="Arial" size="2">1. Seems, that for use LUA there is no necessity to install lua-5.1.3.tar.gz from<br><a href="http://www.lua.org/ftp/">http://www.lua.org/ftp/</a>, also that LUA environment is built in a kernel of FreeSWITCH. Is it correct?</font></div></font></div></div></span></blockquote><div><br></div>Yes</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div bgcolor="#ffffff"><div><font face="Arial" size="2"><div> </div><div><font face="Arial" size="2">2. In the catalogue scripts it is placed test files:</font></div><div><font face="Arial" size="2"></font> </div><div><font face="Arial" size="2">- 2004.pl<br>#!/usr/bin/perl<br>freeswitch::console_log('info', "******Perl*********\n");<br>my $res = `uname -a`;<br>freeswitch::console_log('notice', "OS Info: $res\n");<br>1;</font></div><div> </div><div><font face="Arial" size="2">- 2005.lua<br>freeswitch.consoleLog( "info", "*************LUA************\n" );</font></div><div> </div><div><font face="Arial" size="2">- 2006.js<br>console_log( "*************JavaScript************\n" );<br>session.answer();<br>exit();</font></div><div> </div><div><font face="Arial" size="2">also we make in addition:<br>$ luac 2005.lua -o 2005.luac</font></div><div> </div><div><font face="Arial" size="2">and add extensions into dialplan:<br> <br><extension name="2004"><br> <condition field="destination_number" expression="^2004$" ><br> <action application="perl" data="2004.pl" /><br> <action application="answer" /><br> <action application="sleep" data="1000" /><br> </condition><br></extension><br> <span class="Apple-converted-space"> </span><br><extension name="2005"><br> <condition field="destination_number" expression="^2005$" ><br> <action application="lua" data="2005.lua" /><br> <action application="answer" /><br> <action application="sleep" data="1000" /><br> </condition><br></extension><br> <span class="Apple-converted-space"> </span><br><extension name="20051"><br> <condition field="destination_number" expression="^20051$" ><br> <action application="lua" data="2005.luac" /><br> <action application="answer" /><br> <action application="sleep" data="1000" /><br> </condition><br></extension><br> <span class="Apple-converted-space"> </span><br>extension name="2006"><br> <condition field="destination_number" expression="^2006$" ><br> <action application="jsrun" data="2006.js" /><br> <action application="sleep" data="1000" /><br> </condition><br></extension><br> <span class="Apple-converted-space"> </span><br>We fulfil inquiries SIPp to the corresponding extension:<br>$ ./sipp -sn uac -s 2004 -m 1 opos8:5070<br>And we takes on FreeSWITCH's console:</font></div><div> </div><font face="Arial" size="2"><div><br>2008-08-29 12:28:07 [NOTICE] switch_channel.c:538 switch_channel_set_name() New Channel<span class="Apple-converted-space"> </span><a href="mailto:sofia/nat/sipp@192.168.2.108:5061">sofia/nat/sipp@192.168.2.108:5061</a><span class="Apple-converted-space"> </span>[7ac768e8-2673-465b-98a4-bba7f1f42f80]<br>2008-08-29 12:28:07 [INFO] mod_dialplan_xml.c:228 dialplan_hunt() Processing sipp->2004 in context public<br>2008-08-29 12:28:07 [INFO] switch_cpp.cpp:1050 console_log() ******Perl*********<br>2008-08-29 12:28:07 [NOTICE] switch_cpp.cpp:1050 console_log() OS Info: Linux opos8.altron.lan 2.6.18-53.1.19.el5 #1 SMP Wed May 7 08:20:19 EDT 2008 i686 i686 i386 GNU/Linux<br> <br>2008-08-29 12:35:32 [NOTICE] switch_channel.c:538 switch_channel_set_name() New Channel<span class="Apple-converted-space"> </span><a href="mailto:sofia/nat/sipp@192.168.2.108:5061">sofia/nat/sipp@192.168.2.108:5061</a><span class="Apple-converted-space"> </span>[bc778692-309e-43a7-be3d-e4fa8465fc14]<br>2008-08-29 12:35:32 [INFO] mod_dialplan_xml.c:228 dialplan_hunt() Processing sipp->2005 in context public<br>2008-08-29 12:35:32 [INFO] switch_cpp.cpp:1050 console_log()</div><div>*************LUA************</div><div> </div><div>2008-08-29 12:40:10 [NOTICE] switch_channel.c:538 switch_channel_set_name() New Channel<span class="Apple-converted-space"> </span><a href="mailto:sofia/nat/sipp@192.168.2.108:5061">sofia/nat/sipp@192.168.2.108:5061</a><span class="Apple-converted-space"> </span>[335f6192-fb5a-43ed-91ce-c8c40f3973b7]<br>2008-08-29 12:40:10 [INFO] mod_dialplan_xml.c:228 dialplan_hunt() Processing sipp->20051 in context public<br>2008-08-29 12:40:10 [INFO] switch_cpp.cpp:1050 console_log()</div><div>*************LUA************</div><div> </div><div>LUA script is fulfilled both in initial and in compiled sort...</div><div> </div><div>2008-08-29 12:41:38 [NOTICE] switch_channel.c:538 switch_channel_set_name() New Channel<span class="Apple-converted-space"> </span><a href="mailto:sofia/nat/sipp@192.168.2.108:5061">sofia/nat/sipp@192.168.2.108:5061</a><span class="Apple-converted-space"> </span>[2feb67bb-d54b-49ba-a9f2-0d10c0fd5044]<br>2008-08-29 12:41:38 [INFO] mod_dialplan_xml.c:228 dialplan_hunt() Processing sipp->2006 in context public<br>2008-08-29 12:41:38 [ERR] switch_core_session.c:1034 switch_core_session_execute_application() Invalid Application jsrun<br> <span class="Apple-converted-space"> </span><br>- and that is a strange error, при чём, if to change in extension<br><action application="jsrun" data="2006.js" /><br>for:<br><action application="javascript" data="2006.js" /><br>that:</div><div> </div><div>2008-08-29 12:48:16 [NOTICE] switch_channel.c:538 switch_channel_set_name() New Channel<span class="Apple-converted-space"> </span><a href="mailto:sofia/nat/sipp@192.168.2.108:5061">sofia/nat/sipp@192.168.2.108:5061</a><span class="Apple-converted-space"> </span>[1cc1f4d6-2986-4733-a2bf-84806ff0b681]<br>2008-08-29 12:48:16 [INFO] mod_dialplan_xml.c:228 dialplan_hunt() Processing sipp->2006 in context public<br>2008-08-29 12:48:16 [NOTICE] mod_spidermonkey.c:2034 session_answer() Channel [<a href="mailto:sofia/nat/sipp@192.168.2.108">sofia/nat/sipp@192.168.2.108</a>:5061] has been answered</div><div> </div><div>- then error do not arise:</div><div> </div><div>2008-08-29 12:50:12 [DEBUG] switch_core_state_machine.c:140 switch_core_standard_on_execute()<span class="Apple-converted-space"> </span><a href="mailto:sofia/nat/sipp@192.168.2.108:5061">sofia/nat/sipp@192.168.2.108:5061</a><span class="Apple-converted-space"> </span>Execute javascript(2006.js)<br>2008-08-29 12:50:12 [DEBUG] 2006.js:1 console_log()</div><div>*************JavaScript***********</div><div> </div></font><div><font face="Arial" size="2">But FreeSWITCH tells:<br>> help<br>....<br>jsrun,jsrun <script> [additional_vars [...]],run a script</font></div></font></div>_______________________________________________<br>Freeswitch-dev mailing list<br><a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br><a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></span></blockquote><br></div><div>jsrun is for console, not for dialplan. The syntax of the console is not the same as the syntax for the dialplan</div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>Michal Bielicki, COSO, Member of the Board<br>HaloKwadrat | ul. Polna 46/14, 00-644 Warszawa<br>t. +48228753290 x 203 | f. +48228753291 </div><div><a href="mailto:michal.bielicki@halokwadrat.pl">michal.bielicki@halokwadrat.pl</a> | w. <a href="http://www.halokwadrat.pl">www.halokwadrat.pl</a></div><div> </div><div>Knowledge & Low Prices. Guaranteed!</div><div><br></div><div>Halo Kwadrat Sp. z o.o.<br>z siedzibą w Warszawie przy ulicy Polnej 46/14,00-644 Warszawa<br>wpisana została do rejestru przedsiębiorców prowadzonego przez<br>Sąd Rejonowy dla M.ST.Warszawy w Warszawie, XII Wydział Krajowego Rejestru Sądowego pod numerem<br>KRS 0000153539. NIP 525-22-59-473<br>Wysokość kapitału zakładowego: 50000,00 PLN<br>----------------------------------------------------------------------------<br>Wiadomość ta jest przeznaczona jedynie dla osoby lub podmiotu będącego jej adresatem<br>i może zawierać poufne lub uprzywilejowane informacje. Zabronione jest przeglądanie,<br>przesyłanie, rozpowszechnianie lub inne wykorzystywanie tych informacji, jak również<br>podejmowanie działań na ich podstawie, przez osoby lub podmioty inne niż zamierzony adresat.<br>Jeżeli otrzymali Państwo tę wiadomość przez pomyłkę, prosimy o poinformowanie o tym nadawcy<br>i usunięcie jej z komputera.</div></div></div></span> </div><br></body></html>