mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
fix python and commit an python example.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12184 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
22
libs/esl/python/single_command.py
Normal file
22
libs/esl/python/single_command.py
Normal file
@@ -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"
|
||||
|
Reference in New Issue
Block a user