<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#339999" bgcolor="#FFFFFF">
<font face="Verdana">Hi,<br>
<br>
Thank you very much for confirmation.<br>
<br>
This morning I made again the tests with<br>
<br>
<action application="lua" data="TestArg.lua 3000"/><br>
<br>
and then also with<br>
<br>
<action application="lua" data="TestArg.lua
${destination_number}"/><br>
<br>
and using the same script like yesterday it works fine now.
Probably I had the FS in some inconsistent state, destroyed by
non-sense modifications in DIALPLAN xml configuration.<br>
<br>
So using now in lua script the code<br>
<br>
freeswitch.consoleLog("INFO", "INCOMING START CALL * to
FreeSWITCH, arguments from DIALPLAN " ..argv[1].." "..#argv)<br>
<br>
it works fine. Btw. I have found also another way how to get the
destination number in Lua script which is<br>
<br>
local CgNumb = tonumber(session:getVariable("destination_number"))<br>
<br>
which is probably the equivalent of the same variable delivered
from DIALPLAN.<br>
<br>
So thank you very much again.<br>
<br>
Regards<br>
Petr B.<br>
</font><br>
<div class="moz-cite-prefix">Dne 22.05.2018 v 18:37 Mario napsal(a):<br>
</div>
<blockquote type="cite"
cite="mid:22E8CB9E-8495-409C-BD12-BD5D56C8D807@mgtech.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I agree it should work, I call Lua in incoming and outgoing dial
plans using the literal CALLIN and others and it works fine.
<div class=""> <action application="lua" data="TxCall.lua
CALLIN”/></div>
<div class="">But I do not use a numeric literal. You should test
with an alpha, if that works then there is an issue with numbers
that should be reported in JIRA, then I would assign 3000 to a
variable and pass that since I know that also works.</div>
<div class="">Mario G<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On May 22, 2018, at 8:53 AM, Alexandr Popov
<<a href="mailto:alexandr.popov@iqoption.com" class=""
moz-do-not-send="true">alexandr.popov@iqoption.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">it must work</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">2018-05-22 18:00 GMT+03:00 Petr
Both <span dir="ltr" class=""><<a
href="mailto:both@antek.it" target="_blank"
class="" moz-do-not-send="true">both@antek.it</a>></span>:<br
class="">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#339999" bgcolor="#FFFFFF" class=""> Hi
all,<br class="">
<br class="">
I'm trying to call Lua script from the dialplan
using the following section in
etc/freeswitch/diaplan/<wbr class="">default.xml<br
class="">
<br class="">
<extension name="New_Extension"><br
class="">
<condition field="destination_number"
expression="^(3[0-9][0-9][0-9]<wbr class="">)$"><br
class="">
<action application="lua"
data="TxCall.lua 3000"/><br class="">
</condition><br class="">
</extension><br class="">
<br class="">
I.e. the TxCall.lua is called with argument 3000
and should be available in lua script intself in
argv[1] member of the argv field. However trying
to use argv[1] the lua reports nil in this member
of this field. argv[0] contains correctly name of
the script but argv[1] seems to be empty. Seems
like arguments are not delivered to lua script
from dialplan.<br class="">
<br class="">
I have also found the description if FS manual
where such usage of dialplan is described but as I
described above it doesn't work for me.<br
class="">
<br class="">
Location in manual is <br class="">
<a
class="m_-2570833517083594231moz-txt-link-freetext"
href="https://freeswitch.org/confluence/display/FREESWITCH/mod_lua"
target="_blank" moz-do-not-send="true">https://freeswitch.org/<wbr
class="">confluence/display/FREESWITCH/<wbr
class="">mod_lua</a><br class="">
chapter "Sample Dialplan"<br class="">
<br class="">
Is there any special trick to deliver arguments
into the script from Dialplan?<br class="">
<br class="">
Regards<br class="">
Petr B.<br class="">
<br class="">
<br class="">
</div>
<br class="">
______________________________<wbr class="">______________________________<wbr
class="">_____________<br class="">
Professional FreeSWITCH Consulting Services:<br
class="">
<a href="mailto:consulting@freeswitch.org" class=""
moz-do-not-send="true">consulting@freeswitch.org</a><br
class="">
<a href="http://www.freeswitchsolutions.com/"
rel="noreferrer" target="_blank" class=""
moz-do-not-send="true">http://www.<wbr class="">freeswitchsolutions.com</a><br
class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a href="http://www.freeswitch.org/"
rel="noreferrer" target="_blank" class=""
moz-do-not-send="true">http://www.freeswitch.org</a><br
class="">
<a href="http://confluence.freeswitch.org/"
rel="noreferrer" target="_blank" class=""
moz-do-not-send="true">http://confluence.freeswitch.<wbr
class="">org</a><br class="">
<a href="http://www.cluecon.com/" rel="noreferrer"
target="_blank" class="" moz-do-not-send="true">http://www.cluecon.com</a><br
class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a
href="mailto:FreeSWITCH-users@lists.freeswitch.org"
class="" moz-do-not-send="true">FreeSWITCH-users@lists.<wbr
class="">freeswitch.org</a><br class="">
<a
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
rel="noreferrer" target="_blank" class=""
moz-do-not-send="true">http://lists.freeswitch.org/<wbr
class="">mailman/listinfo/freeswitch-<wbr
class="">users</a><br class="">
UNSUBSCRIBE:<a
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
rel="noreferrer" target="_blank" class=""
moz-do-not-send="true">http://lists.<wbr class="">freeswitch.org/mailman/<wbr
class="">options/freeswitch-users</a><br
class="">
<a href="http://www.freeswitch.org/"
rel="noreferrer" target="_blank" class=""
moz-do-not-send="true">http://www.freeswitch.org</a><br
class="">
</blockquote>
</div>
<br class="">
</div>
_________________________________________________________________________<br
class="">
Professional FreeSWITCH Consulting Services:<br class="">
<a href="mailto:consulting@freeswitch.org" class=""
moz-do-not-send="true">consulting@freeswitch.org</a><br
class="">
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a><br class="">
<br class="">
Official FreeSWITCH Sites<br class="">
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br class="">
<a class="moz-txt-link-freetext" href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a><br class="">
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a><br class="">
<br class="">
FreeSWITCH-users mailing list<br class="">
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br class="">
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br
class="">
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br
class="">
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a></div>
</blockquote>
</div>
<br class="">
</div>
<!--'"--><br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>
Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://confluence.freeswitch.org">http://confluence.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>
FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a></pre>
</blockquote>
<br>
</body>
</html>