I believe you need to run this command "inline":<br><br><font size="1"><span style="font-family:courier new,monospace"><action application="set" data="msgtime=msg_${strftime(%Y_%m_%d_%H_%M_%S)}_${mailbox}.alaw"/></span></font><br>
<br>Change it to this and try again:<br><br><span style="font-family:courier new,monospace"><font size="1"><action application="set" data="msgtime=msg_${strftime(%Y_%m_%d_%H_%M_%S)}_${mailbox}.alaw" inline="true"/></font></span><br>
<br>Let us know if it works or not. Also, your homework assignment will be to read this:<br><a href="http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions">http://wiki.freeswitch.org/wiki/Dialplan_XML#Inline_Actions</a><br>
And learn about hunting (or "parsing" phase) vs. execution phase of dialplan processing. :)<br><br>-MC<br><br><div class="gmail_quote">On Tue, Jul 31, 2012 at 2:12 AM, Thomas Hoellriegel <span dir="ltr"><<a href="mailto:admin@blindi.net" target="_blank">admin@blindi.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi guy,<br>
I have simply written a voicemailrecording in lua.<br>
My dialplan extension is:<br>
<extension name="dorf_mailboxes" ><br>
<condition field="destination_number"<br>
expression="^44[0-9][0-9][0-9]<u></u>[0-9]\d*$"><br>
<action application="set" data="msgtime=msg_${strftime(%<u></u>Y_%m_%d_%H_%M_%S)}_${mailbox}.<u></u>alaw"/><br>
<action application="lua" data="recordmsg.lua<br>
$${dorf_mailbox_prefix}/${<u></u>mailbox_to}/greeting.alaw ${mailbox}<br>
${msgtime}"/><br>
</condition><br>
</extension><br>
<br>
The luascript:<br>
<br>
-- simply mailbox recording<br>
-- parameters:<br>
-- mailbox, sender, message<br>
mailbox = argv[1];<br>
from_box = argv[2];<br>
msg_file = argv[3];<br>
snd = "/usr/local/freeswitch/sounds/<u></u>dorf";<br>
file, errMsg = io.open( mailbox, "r" );<br>
if not file then<br>
session:streamFile("/usr/<u></u>local/freeswitch/sounds/dorf/<u></u>mailbox_not.alaw")<br>
session:execute("transfer","<u></u>dorf_now XML dorf_now");<br>
else<br>
freeswitch.consoleLog("info", "msg_file is: " .. msg_file .. "\n");<br>
session:execute("playback",<u></u>mailbox);<br>
session:streamFile("/usr/<u></u>local/freeswitch/sounds/ivr/<u></u>beep.alaw")<br>
session:execute("record","/<u></u>tmp/" .. msg_file .. " 180 200 3 ");<br>
session:execute("transfer","<u></u>dorf_send XML dorf_send");<br>
end<br>
<br>
I become the error:<br>
[ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/<u></u>recordmsg.lua:13<br>
: attempt to concatenate global 'msg_file' (a nil value)M<br>
<br>
<br>
I have 3 arguments, only 2 arguments will be works.<br>
Can your help please?<br>
thanks.<br>
<br></blockquote></div><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>