<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">Hi,</span></div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)"><action application="lua" data="recordmsg.lua </span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">$${dorf_mailbox_prefix}/${</span><u style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)"></u><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">mail</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">box_to}/greeting.alaw ${mailbox} </span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">${msgtime}"/></span> <br>
<br>1st Argument:
<span style="font-size:13.333333969116211px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">$${dorf_mailbox_prefix}/${</span><u style="font-size:13.333333969116211px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)"></u><span style="font-size:13.333333969116211px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">mail</span><span style="font-size:13.333333969116211px;color:rgb(34,34,34);font-family:arial,sans-serif;background-color:rgb(255,255,255)">box_to}/greeting.alaw</span> <br>
2nd
Argument:
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">${mailbox}</span><div>3rd Argument: <span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px">${msgtime}</span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div>Can you verify that the ${msgtime} is properly calculated and is not NULL at the taime of execution of application=lua ?</div>
<div><br></div><div>Regards,</div><div>Sammy<br><div class="gmail_quote">On Tue, Jul 31, 2012 at 2:12 PM, 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>
<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>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<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>