hey, maybe it is something silly like no semicolon (;) at end ?

can you try only like this in .lua script:

local uuid = session:getVariable("uuid");
        freeswitch.consoleLog(ERR, string.format("UUID :: %s", tostring(uuid)));


-mirko

On Fri, Aug 5, 2016 at 6:33 AM, Jai Rangi <jprangi@didforsale.com> wrote:
Good chances that you not using right variable. You can use info app to dump all the variables in console log and see which ones you want to use. 


On Thursday, August 4, 2016, Don Hawkins <hawkins@hawkinsegroup.com> wrote:
Thanks, but still no luck. Anyone know how to access variables in Lua?  Besides this problem everything is working well.

On Thu, Aug 4, 2016 at 7:00 PM, Jai Rangi <jprangi@didforsale.com> wrote:
missing "=" in 3rd line.

Jai Rangi
Cebod Technologies LLC dba DIDforSale/Cebod Telecom






On Thu, Aug 4, 2016 at 4:31 PM, Don Hawkins <hawkins@hawkinsegroup.com> wrote:
So anytime I try to get a variable like UUID I always get  "attempt to call method 'getVariable' (a nil value)". It's calling the test.lua script at the right time but I've been unable to access a single variable so far. The phone is literally ringing at the time the script is called so I'm sure there is a session. 

test.lua looks like this (line 3 is the problem and line 2 has no value).

api = freeswitch.API();
local uuidto = event:getHeader("Unique-ID")
local uuid session:getVariable("uuid")
post_response = api:execute("curl", "http://voiceapi.cloud/API/callflow/test3.php?event=ringing&amp;uuid=.. uuidto ..")


On Thu, Aug 4, 2016 at 5:35 PM, Abaci B <abaci64@gmail.com> wrote:
you can do something like this.
local uuid = session:getVariable("uuid")
post_response = api:execute("curl", "http://myurl.com/test3.php?event=answer&uuid=" .. uuid)

On Thu, Aug 4, 2016 at 6:25 PM, Don Hawkins <hawkins@hawkinsegroup.com> wrote:
Sorry, one more question. How can I pass session/channel variables in the CURL request? ie. ${uuid}

post_response = api:execute("curl", "http://myurl.com/test3.php?event=answer&uuid=${uuid}")


On Thu, Aug 4, 2016 at 5:21 PM, Don Hawkins <hawkins@hawkinsegroup.com> wrote:
mod_curl wasan't running, I overlooked that. Working fine now with the API version.


On Thu, Aug 4, 2016 at 4:35 PM, Abaci B <abaci64@gmail.com> wrote:
you can't run session:execute() if there is no active session. if you run it outside a call you can (for testing) maybe try running local session = freeswitch.Session() before running the curl

On Thu, Aug 4, 2016 at 4:23 PM, Don Hawkins <hawkins@hawkinsegroup.com> wrote:
Tried the other way as well (without the API)

session:execute("curl", "http://myurl.com/test3.php post name=myname")
curl_response_code = session:getVariable("curl_response_code")
curl_response      = session:getVariable("curl_response_data")

Getting this error:

[ERR] mod_lua.cpp:203 /usr/share/freeswitch/scripts/test.lua:1: attempt to index global 'session' (a nil value)
stack traceback:
        /usr/share/freeswitch/scripts/test.lua:1: in main chunk


On Thu, Aug 4, 2016 at 2:51 PM, Don Hawkins <hawkins@hawkinsegroup.com> wrote:
root@debian:/usr/share/freeswitch/scripts# vi test.lua

api = freeswitch.API();
api:execute("curl", "http://myurl.com/test3.php post name1=value1")


Snatched the code straight from the the example shown at the URL below. FS does execute the script but never reaches my URL with the POST request. Did I miss something?






--
Sincerely,
Don Hawkins
CEO
Hawkins Enterprise Group LLC
http://hawkinsegroup.com
Zello PTT: push2don

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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



--
Sincerely,
Don Hawkins
CEO
Hawkins Enterprise Group LLC
http://hawkinsegroup.com
Zello PTT: push2don



--
Sincerely,
Don Hawkins
CEO
Hawkins Enterprise Group LLC
http://hawkinsegroup.com
Zello PTT: push2don

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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



--
Sincerely,
Don Hawkins
CEO
Hawkins Enterprise Group LLC
http://hawkinsegroup.com
Zello PTT: push2don

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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



--
Sincerely,
Don Hawkins
CEO
Hawkins Enterprise Group LLC
http://hawkinsegroup.com
Zello PTT: push2don
P: 469-214-5044


--
Jai Rangi
Cebod Technologies LLC dba DIDforSale/Cebod Telecom







_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
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



--
Regards,
Mirko