forked from Mirrors/freeswitch
broadcast wav functionality
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6019 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
603463d126
commit
27268166d7
|
@ -1,4 +1,22 @@
|
|||
|
||||
DEPENDENCIES
|
||||
============
|
||||
|
||||
The State Machine Compiler is needed for the freepy connection library to function.
|
||||
|
||||
* wget http://ufpr.dl.sourceforge.net/sourceforge/smc/smc_5_0_0.tgz
|
||||
* tar xvfz smc_5_0_0.tgz
|
||||
* cd smc_5_0_0
|
||||
* cd lib
|
||||
* python setup.py install
|
||||
|
||||
PYTHONPATH
|
||||
==========
|
||||
|
||||
- Add /path/to/freeswitch/scripts/socket to your PYTHONPATH
|
||||
|
||||
TESTING
|
||||
=======
|
||||
|
||||
- Copy/Paste the code from test1() in fshelper.py to your own test module
|
||||
- Adapt code as needed and run
|
|
@ -312,7 +312,17 @@ class FreepyDispatcher(LineReceiver):
|
|||
self.transport.write("%s\n\n" % msg)
|
||||
return req.getDeferred()
|
||||
|
||||
|
||||
def broadcast(self, uuid, path, legs, bgapi = False):
|
||||
if bgapi == True:
|
||||
msg = "bgapi broadcast %s %s %s" % (uuid, path, legs)
|
||||
req = request.BgApiRequest()
|
||||
else:
|
||||
msg = "api broadcast %s %s %s" % (uuid, path, legs)
|
||||
req = request.ApiRequest()
|
||||
self.requestq.put(req)
|
||||
print "sending to fs: %s" % msg
|
||||
self.transport.write("%s\n\n" % msg)
|
||||
return req.getDeferred()
|
||||
|
||||
|
||||
def lineReceived(self, line):
|
||||
|
|
|
@ -290,6 +290,19 @@ class FsHelper(ClientFactory):
|
|||
return d
|
||||
|
||||
|
||||
def broadcast(self, uuid, path, legs="both", bgapi=True):
|
||||
"""
|
||||
@legs - one of the following strings: aleg|bleg|both
|
||||
"""
|
||||
def broadcast_inner(ignored):
|
||||
df = self.freepyd.broadcast(uuid, path, legs, bgapi)
|
||||
return df
|
||||
|
||||
d = self.connect()
|
||||
d.addCallback(broadcast_inner)
|
||||
return d
|
||||
|
||||
|
||||
def sofia_profile_restart(self, profile_name, bgapi=True):
|
||||
|
||||
def sofia_profile_restart_inner(ignored):
|
||||
|
|
Loading…
Reference in New Issue