[Freeswitch-users] Lua problem there are only two arguments evaluated

Thomas Hoellriegel admin at blindi.net
Tue Jul 31 13:12:28 MSD 2012


hi guy,
I have simply written a voicemailrecording in lua.
My dialplan extension is:
<extension name="dorf_mailboxes" >
<condition field="destination_number"
expression="^44[0-9][0-9][0-9][0-9]\d*$">
<action application="set" 
data="msgtime=msg_${strftime(%Y_%m_%d_%H_%M_%S)}_${mailbox}.alaw"/>
<action application="lua" data="recordmsg.lua
$${dorf_mailbox_prefix}/${mailbox_to}/greeting.alaw ${mailbox}
${msgtime}"/>
</condition>
</extension>

The luascript:

-- simply mailbox recording
-- parameters:
-- mailbox,  sender, message
mailbox  = argv[1];
from_box  = argv[2];
msg_file  = argv[3];
snd = "/usr/local/freeswitch/sounds/dorf";
file, errMsg = io.open( mailbox, "r" );
  if not file then
  session:streamFile("/usr/local/freeswitch/sounds/dorf/mailbox_not.alaw")
session:execute("transfer","dorf_now    XML dorf_now");
  else
   freeswitch.consoleLog("info", "msg_file is: " .. msg_file .. "\n");
session:execute("playback",mailbox);
  session:streamFile("/usr/local/freeswitch/sounds/ivr/beep.alaw")
  session:execute("record","/tmp/" .. msg_file .. " 180 200 3 ");
session:execute("transfer","dorf_send    XML dorf_send");
  end

I become the error:
  [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/recordmsg.lua:13
: attempt to concatenate global 'msg_file' (a nil value)M


I have 3 arguments, only 2 arguments will be works.
Can your help please?
thanks.





---------------
Du kannst mich jederzeit kostenlos per Festnetz erreichen unter:
http://www.blindi.net/callback
homepage: http://www.blindi.net
blinde-misc mailingliste für blinde. anmeldung unter:
http://www.blindi.net/mailman/listinfo/blinde-misc


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list