Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Error in lua script with session:getVariable


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
larclap at yahoo.com
Guest





PostPosted: Thu Jul 16, 2009 4:43 pm    Post subject: [Freeswitch-users] Error in lua script with session:getVaria Reply with quote

I am getting an error in a lua script which I don’t understand. Why is it returning nil in the script yet something in the cli?

lua snippet:
user_data = session:getVariable('user_data 1000@192.168.10.29 var callgroup');
freeswitch.console_log("INFO", " UserData group " .. user_data .. "\n")

log:
2009-07-16 14:30:49.237343 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/helloworld.lua:14: attempt to concatenate global 'user_data' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/helloworld.lua:14: in main chunk


cli:
freeswitch@internal> user_data 1000@192.168.10.29 var callgroup
techsupport

Thanks, Lars
Back to top
mrene_lists at avgs.ca
Guest





PostPosted: Thu Jul 16, 2009 4:47 pm    Post subject: [Freeswitch-users] Error in lua script with session:getVaria Reply with quote

You need to make an API call, not get a variable.
Mathieu Rene
Avant-Garde Solutions Inc
Office: + 1 (514) 664-1044 x100
Cell: +1 (514) 664-1044 x200
mrene@avgs.ca (mrene@avgs.ca)








Am 16-Jul-09 um 5:36 PM schrieb Lars Zeb:
Quote:
I am getting an error in a lua script which I don’t understand. Why is it returning nil in the script yet something in the cli?

lua snippet:
user_data = session:getVariable('user_data 1000@192.168.10.29 (1000@192.168.10.29) var callgroup');
freeswitch.console_log("INFO", " UserData group " .. user_data .. "\n")

log:
2009-07-16 14:30:49.237343 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/helloworld.lua:14: attempt to concatenate global 'user_data' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/helloworld.lua:14: in main chunk


cli:
freeswitch@internal> user_data 1000@192.168.10.29 (1000@192.168.10.29) var callgroup
techsupport

Thanks, Lars

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
larclap at yahoo.com
Guest





PostPosted: Thu Jul 16, 2009 7:12 pm    Post subject: [Freeswitch-users] Error in lua script with session:getVaria Reply with quote

Mathieu,

Thanks for the reply. I’m very new with FreeSWITCH and not familiar with api calls. I tried:

user_data = apiExecute("user_data", "1000@192.168.10.29 var callgroup");

But got a similar error:

2009-07-16 17:01:47.212904 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/helloworld.lua:13: attempt to call global 'apiExecute' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/helloworld.lua:13: in main chunk

I would appreciate an example or a link to the pertinent documentation.

Thanks, Lars

From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Mathieu Rene
Sent: Thursday, July 16, 2009 2:42 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Error in lua script with session:getVariable



You need to make an API call, not get a variable.

Mathieu Rene

Avant-Garde Solutions Inc

Office: + 1 (514) 664-1044 x100

Cell: +1 (514) 664-1044 x200

mrene@avgs.ca (mrene@avgs.ca)










Am 16-Jul-09 um 5:36 PM schrieb Lars Zeb:




I am getting an error in a lua script which I don’t understand. Why is it returning nil in the script yet something in the cli?



lua snippet:

user_data = session:getVariable('user_data 1000@192.168.10.29 (1000@192.168.10.29) var callgroup');

freeswitch.console_log("INFO", " UserData group " .. user_data .. "\n")



log:

2009-07-16 14:30:49.237343 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/helloworld.lua:14: attempt to concatenate global 'user_data' (a nil value)

stack traceback:

/usr/local/freeswitch/scripts/helloworld.lua:14: in main chunk





cli:

freeswitch@internal> user_data 1000@192.168.10.29 (1000@192.168.10.29) var callgroup

techsupport



Thanks, Lars


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Thu Jul 16, 2009 7:16 pm    Post subject: [Freeswitch-users] Error in lua script with session:getVaria Reply with quote

http://wiki.freeswitch.org/wiki/Mod_lua#For_making_API_calls

Please READ that page. These details are there!


/b

On Jul 16, 2009, at 7:07 PM, Lars Zeb wrote:
Quote:
Mathieu,

Thanks for the reply. I’m very new with FreeSWITCH and not familiar with api calls. I tried:

user_data = apiExecute("user_data", "1000@192.168.10.29 (1000@192.168.10.29) var callgroup");

But got a similar error:

2009-07-16 17:01:47.212904 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/helloworld.lua:13: attempt to call global 'apiExecute' (a nil value)
stack traceback:
/usr/local/freeswitch/scripts/helloworld.lua:13: in main chunk

I would appreciate an example or a link to the pertinent documentation.

Thanks, Lars

From: freeswitch-users-bounces@lists.freeswitch.org (freeswitch-users-bounces@lists.freeswitch.org) [mailto:freeswitch-users-bounces@lists.freeswitch.org (freeswitch-users-bounces@lists.freeswitch.org)] On Behalf Of Mathieu Rene
Sent: Thursday, July 16, 2009 2:42 PM
To: freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)
Subject: Re: [Freeswitch-users] Error in lua script with session:getVariable



You need to make an API call, not get a variable.

Mathieu Rene

Avant-Garde Solutions Inc

Office: + 1 (514) 664-1044 x100

Cell: +1 (514) 664-1044 x200

mrene@avgs.ca (mrene@avgs.ca)










Am 16-Jul-09 um 5:36 PM schrieb Lars Zeb:




I am getting an error in a lua script which I don’t understand. Why is it returning nil in the script yet something in the cli?



lua snippet:

user_data = session:getVariable('user_data 1000@192.168.10.29 (1000@192.168.10.29) var callgroup');

freeswitch.console_log("INFO", " UserData group " .. user_data .. "\n")



log:

2009-07-16 14:30:49.237343 [ERR] mod_lua.cpp:182 /usr/local/freeswitch/scripts/helloworld.lua:14: attempt to concatenate global 'user_data' (a nil value)

stack traceback:

/usr/local/freeswitch/scripts/helloworld.lua:14: in main chunk





cli:

freeswitch@internal> user_data 1000@192.168.10.29 (1000@192.168.10.29) var callgroup

techsupport



Thanks, Lars


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org






_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services