[Freeswitch-users] Get HTTP response to LUA variable

Sanath Prasanna ahe.sanath at gmail.com
Thu Feb 23 15:31:37 MSK 2012


Hi all,
I use url to get charging status as follow in lua app module.

local http = require("socket.http")
body,c,l,h = http.request{ url = "
http://localhost/charging.php?mobile=868992222"};
logInfo("charging http_url body:" .. body .. " ");
logInfo("charging http_url c:" .. c .. " ");
logInfo("charging http_url l:" .. encode(l) .. " ");
logInfo("charging http_url h:" .. h .. " ");

URL will be return 1 or 0 as response. How to get that value in lua
program. I print body,c,l,h values. But return value is not there.
Pls help.
Br,
Sanath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120223/4d8cd6ec/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list