[Freeswitch-svn] [commit] r12184 - freeswitch/trunk/libs/esl/python

FreeSWITCH SVN brian at freeswitch.org
Fri Feb 20 10:07:36 PST 2009


Author: brian
Date: Fri Feb 20 12:07:35 2009
New Revision: 12184

Log:
 fix python and commit an python example. 

Added:
   freeswitch/trunk/libs/esl/python/single_command.py
Modified:
   freeswitch/trunk/libs/esl/python/Makefile

Modified: freeswitch/trunk/libs/esl/python/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/python/Makefile	(original)
+++ freeswitch/trunk/libs/esl/python/Makefile	Fri Feb 20 12:07:35 2009
@@ -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.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 *~

Added: freeswitch/trunk/libs/esl/python/single_command.py
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/python/single_command.py	Fri Feb 20 12:07:35 2009
@@ -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"
+



More information about the Freeswitch-svn mailing list