]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
broadcast wav functionality
authorTraun Leyden <tleyden@branchcut.com>
Mon, 22 Oct 2007 19:50:34 +0000 (19:50 +0000)
committerTraun Leyden <tleyden@branchcut.com>
Mon, 22 Oct 2007 19:50:34 +0000 (19:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6019 d0543943-73ff-0310-b7d9-9358b9ac24b2

scripts/socket/freepy/INSTALL
scripts/socket/freepy/__init__.py
scripts/socket/freepy/fshelper.py

index 9e5075dec4e94ca36cde54e947081aa4cd697dd5..1817af5893867fdf4999a5b22d6d6ea01de756cc 100644 (file)
@@ -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
\ No newline at end of file
index 0d1cea37a140782e624e9f905574775a731b0009..d1fe6edf29e7957e062dca78e2bafe56572c6978 100644 (file)
@@ -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):
index 84e749b6b47e30e15e4d90c232b12bd521b98c4d..b62d894ca3e255193a4c616fbda7a23e54358bb1 100644 (file)
@@ -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):