[Freeswitch-svn] [commit] r6019 - freeswitch/trunk/scripts/socket/freepy

Freeswitch SVN greenlizard at freeswitch.org
Mon Oct 22 15:50:34 EDT 2007


Author: greenlizard
Date: Mon Oct 22 15:50:34 2007
New Revision: 6019

Modified:
   freeswitch/trunk/scripts/socket/freepy/INSTALL
   freeswitch/trunk/scripts/socket/freepy/__init__.py
   freeswitch/trunk/scripts/socket/freepy/fshelper.py

Log:
broadcast wav functionality

Modified: freeswitch/trunk/scripts/socket/freepy/INSTALL
==============================================================================
--- freeswitch/trunk/scripts/socket/freepy/INSTALL	(original)
+++ freeswitch/trunk/scripts/socket/freepy/INSTALL	Mon Oct 22 15:50:34 2007
@@ -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

Modified: freeswitch/trunk/scripts/socket/freepy/__init__.py
==============================================================================
--- freeswitch/trunk/scripts/socket/freepy/__init__.py	(original)
+++ freeswitch/trunk/scripts/socket/freepy/__init__.py	Mon Oct 22 15:50:34 2007
@@ -312,7 +312,17 @@
         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):

Modified: freeswitch/trunk/scripts/socket/freepy/fshelper.py
==============================================================================
--- freeswitch/trunk/scripts/socket/freepy/fshelper.py	(original)
+++ freeswitch/trunk/scripts/socket/freepy/fshelper.py	Mon Oct 22 15:50:34 2007
@@ -290,6 +290,19 @@
         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):



More information about the Freeswitch-svn mailing list