Hi list,

I noted that my old lua script which I used a lot of years from FS 1.2 works very strange with FS 1.6

The script is quite simple. I am using it for getting the list of variables from mysql and set as channel variables. Please look below.

local dbh = freeswitch.Dbh("name", "root", "passwd")

function get_global_vars()
local row = {}
local i = 1
local mycount = 1

my_query = "select var_name, var_value from directory_global_vars where domain_id='1'"

assert(dbh:query(my_query, function(qrow)

for key, val in pairs(qrow) do
  if mycount == 1 then
  abc = val
  mycount = 2
  elseif mycount == 2 then
  row[i] = abc.."="..val
  mycount =1
  i = i+1
  end
end

end))

return row

end


local row = get_global_vars()
for k in pairs(row) do
session:execute("set", "".. row[k] .."")
freeswitch.consoleLog("NOTICE","row[k]   is '" .. row[k] .. "'\n")
end


The result in fs_cli should looks like
 switch_cpp.cpp:1356  simplescript start 
 switch_cpp.cpp:1356 row[k]   is 'user_context=default'
 switch_cpp.cpp:1356 row[k]   is 'numbering_plan=USCAN'

BUT sometimes it looks like backwards!
 switch_cpp.cpp:1356  simplescript start 
 switch_cpp.cpp:1356 row[k]   is 'default=user_context'
 switch_cpp.cpp:1356 row[k]   is 'USCAN=numbering_plan'

Please keep in mind that I do exactly same call without any changes but I have different results (its ~ 50%/50%)

I am not sure but it looks like bug.

Please advice.
Thanks.