[Freeswitch-users] CURL from Lua Script
Don Hawkins
hawkins at hawkinsegroup.com
Fri Aug 5 02:21:32 MSD 2016
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 at 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 at 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 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
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at 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 at 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 at 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 at 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 <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/c9ebebb1/attachment-0001.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list