]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix python and commit an python example.
authorBrian West <brian@freeswitch.org>
Fri, 20 Feb 2009 18:07:35 +0000 (18:07 +0000)
committerBrian West <brian@freeswitch.org>
Fri, 20 Feb 2009 18:07:35 +0000 (18:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12184 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/python/Makefile
libs/esl/python/single_command.py [new file with mode: 0644]

index fd354d97f1a32f42f7f385bfbacb679c217ba168..a231b1e74fa2d971920abeb489de8f8095d54731 100644 (file)
@@ -1,7 +1,7 @@
 LOCAL_CFLAGS=-I/usr/include/python2.4
 LOCAL_LDFLAGS=-lpython2.4
 
-all: ESL.so
+all: _ESL.so
 
 esl_wrap.cpp:
        swig -module ESL -classic -python -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
@@ -9,8 +9,8 @@ esl_wrap.cpp:
 esl_wrap.o: esl_wrap.cpp
        $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
 
-ESL.so: esl_wrap.o
-       $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+_ESL.so: esl_wrap.o
+       $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o _ESL.so -L. $(LIBS)
 
 clean:
        rm -f *.o *.so *~
diff --git a/libs/esl/python/single_command.py b/libs/esl/python/single_command.py
new file mode 100644 (file)
index 0000000..977ec96
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+import string
+import sys
+from ESL import *
+
+con = ESLconnection("localhost","8021","ClueCon")
+#are we connected?
+
+if con.connected:
+
+       #get argument passed to script
+       command = string.join(sys.argv[1:])
+
+       #run command
+       e=con.sendRecv("api "+  command)
+       print e.getBody()
+
+else:
+
+       print "Not Connected"
+