FreeSWITCH LUA在Centos 安装cjson 模板

相关命令

wget http://www.kyne.com.au/~mark/software/download/lua-cjson-2.1.0.tar.gz
yum install -y readline-devel


tar xvzf lua-cjson-2.1.0.tar.gz
cd lua-cjson-2.1.0 && make
cp cjson.so /usr/lib64/lua/5.1/

 

例子

rule_data="[{"s_hour":"","e_hour":"","s_week":"1","e_week":"2","s_day":"1","e_day":"17","s_month":"1","e_month":"11"}]"
value = cjson.decode(rule_data)
for k, v in pairs(value) do
   freeswitch.consoleLog("NOTICE",k..'k')
   for tk, tv in pairs(v) do
   	 	freeswitch.consoleLog("NOTICE",tk..'tk')
		freeswitch.consoleLog("NOTICE",tv..'tv')
   end
   

end

 

你可能感兴趣的:(freeswitch,工具,代码)