[Freeswitch-users] lua error in session:transfer

Thomas Hoellriegel admin at blindi.net
Tue Dec 6 06:36:05 MSK 2011


Hi all,
i have a luascript. I hear the prompt, but the transfer fails.
My script is:

session:answer();
freeswitch.console_log("info", "Announce\n");
announce='/usr/local/freeswitch/sounds/callscreen/callscrrenopts.wav';
number = session:read(1, 1, announce, 5000, "#");
freeswitch.consoleLog("info", "Got number: ".. number .. "\n");
if number == argv[1] then
    target_number=argv[2];
elseif number == argv[3] then
    target_number=argv[4];
elseif number == argv[5] then
    target_number=argv[6];
elseif number == argv[7] then
    target_number=argv[8];
else
end
freeswitch.consoleLog("info", "Transfer to target number: ".. target_number .. " XML default\n");
session:transfer("target_number", "XML", "default");

in my dialplan reads:
<action application="set" data="group_confirm_file=lua thomas.lua 1 7676 2   4000"/>

Then i press 1 for example, i become on the cli:
[ERR] mod_lua.cpp:196 /usr/local/freeswitch/scripts/thomas.lua:16:
attempt to concatenate global 'target_number' (a nil value)M

What is wrong please?
Thanks for your help.

---------------
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