<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">Hey,</span></div><div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); ">What I understand you are trying to do is get a variable name from FS and check from LUA if the file exists ! file_name_ok is just a flag to return true or false depending upon existence of caal_screen_filename..if this is the case then</span></div>
<div><span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgba(255, 255, 255, 0.917969); "><br></span></div><div>datei = session:getVariable(&quot;file_<u></u>name_ok&quot;);  --You are getting the variable containing filename here.</div>
shouldn&#39;t it be ?<div><span class="Apple-style-span" style="font-size: 13px; color: rgb(34, 34, 34); font-family: arial, sans-serif; background-color: rgba(255, 255, 255, 0.917969); ">datei = session:getVariable(&quot;</span>call_screen_filename<span class="Apple-style-span" style="font-size: 13px; color: rgb(34, 34, 34); font-family: arial, sans-serif; background-color: rgba(255, 255, 255, 0.917969); ">&quot;);</span><br>
<div class="gmail_quote"><br></div><div class="gmail_quote">also,</div><div class="gmail_quote"><br></div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
if (file_exists(datei..extension.<u></u>.&quot;.wav&quot;)) then<br>session:setVariable(&quot;file_<u></u>name_ok&quot;, &quot;true&quot;);<br>else<br>session:setVariable(&quot;file_<u></u>name_ok&quot;, &quot;true&quot;);<br>
end</blockquote><div class="gmail_quote">returns true in any case file exists or not.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Please see if this is right !</div><div class="gmail_quote"><br></div>
<div class="gmail_quote">--</div><div class="gmail_quote">Regards,</div><div class="gmail_quote">Sammy</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Sun, Nov 6, 2011 at 4:55 PM, Thomas Hoellriegel <span dir="ltr">&lt;<a href="mailto:admin@blindi.net">admin@blindi.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<br>
I like to export a vatiable to my dialplan.<br>
 The variable file_name_ok should give back the value true if the file exists<br>
My fialplan:<br>
&lt;action application=&quot;lua&quot; data=&quot;file.lua ${call_screen_filename}&quot;/&gt;<br>
 &lt;action application=&quot;log&quot; data=&quot;the value: ${file_name_ok}&quot;/&gt;<br>
<br>
My problem: i can.t export the variable from the luascript<br>
<br>
my scipt:<br>
-- function used to check for the existence of a file<br>
function file_exists(fname)<br>
local f = io.open(fname, &quot;r&quot;)<br>
if (f and f:read()) then return true end<br>
end<br>
if ( session:ready() ) then<br>
session:answer( );<br>
<br>
datei = session:getVariable(&quot;file_<u></u>name_ok&quot;);<br>
if (file_exists(datei..extension.<u></u>.&quot;.wav&quot;)) then<br>
session:setVariable(&quot;file_<u></u>name_ok&quot;, &quot;true&quot;);<br>
else<br>
session:setVariable(&quot;file_<u></u>name_ok&quot;, &quot;true&quot;);<br>
end<br>
end<br>
<br>
can your help me please?<br>
<br>
<br>
<br>
---------------<br>
Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:<br>
<a href="http://www.blindi.net/callback" target="_blank">http://www.blindi.net/callback</a><br>
homepage: <a href="http://www.blindi.net" target="_blank">http://www.blindi.net</a><br>
blinde-misc mailingliste für blinde. anmeldung unter:<br>
<a href="http://www.blindi.net/mailman/listinfo/blinde-misc" target="_blank">http://www.blindi.net/mailman/<u></u>listinfo/blinde-misc</a><br>
<br><br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>