From 9f4356450040874960f030d038c3c302f4315436 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 15 Feb 2010 21:25:49 +0000 Subject: [PATCH] guess nobody has actually tried this before git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16650 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/esl/lua/Makefile | 2 +- libs/esl/lua/single_command.lua | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 libs/esl/lua/single_command.lua diff --git a/libs/esl/lua/Makefile b/libs/esl/lua/Makefile index f77a2b1431..c33853bfa7 100644 --- a/libs/esl/lua/Makefile +++ b/libs/esl/lua/Makefile @@ -1,5 +1,5 @@ LOCAL_CFLAGS= -LOCAL_LDFLAGS=-llua +LOCAL_LDFLAGS=-llua -lpthread WRAP_GCC_WARNING_SILENCE=-Wno-unused-function all: ESL.so diff --git a/libs/esl/lua/single_command.lua b/libs/esl/lua/single_command.lua new file mode 100755 index 0000000000..bff4b324e2 --- /dev/null +++ b/libs/esl/lua/single_command.lua @@ -0,0 +1,10 @@ +#!/usr/local/bin/lua +require("ESL") + +local command = arg[1]; +table.remove(arg, 1); +local args = table.concat(arg, " "); + +local con = ESL.ESLconnection("localhost", "8021", "ClueCon"); +local e = con:api(command, args); +print(e:getBody());