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?
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@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/free switch-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 <http://zello.com>: push2don P: 469-214-5044
-- 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@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