[Freeswitch-users] CURL from Lua Script

Don Hawkins hawkins at hawkinsegroup.com
Fri Aug 5 00:23:36 MSD 2016


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 at hawkinsegroup.com>
wrote:

> root at 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?
>
> https://freeswitch.org/confluence/display/FREESWITCH/mod_curl
>
>
>


-- 
Sincerely,
Don Hawkins
CEO
Hawkins Enterprise Group LLC
http://hawkinsegroup.com
Zello PTT <http://zello.com>: push2don
P: 469-214-5044
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160804/04d18de4/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list