[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Michael 'Mickey' Lauer mickey at vanille-media.de
Sat Aug 6 08:17:14 UTC 2011


The following commit has been merged in the debian branch:
commit a9f4779e0749ec89f9a0d502ae0fe5845bf5024d
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Tue May 12 18:45:01 2009 +0200

    ogsmd: CSD handling with external call handler part 2/3 done (outgoing)
    
    Limitation: the state machine does not know about the additional state and will raise an execption,
    on everything call handling while the call handler is active. To end a call while the csd handler
    is still active, you can only use org.freesmartphone.GSM.Call.ReleaseAll()

diff --git a/framework/subsystems/ogsmd/modems/abstract/calling.py b/framework/subsystems/ogsmd/modems/abstract/calling.py
index d31b74e..0653114 100644
--- a/framework/subsystems/ogsmd/modems/abstract/calling.py
+++ b/framework/subsystems/ogsmd/modems/abstract/calling.py
@@ -12,7 +12,7 @@ Module: calling
 New style abstract call handling
 """
 
-__version__ = "0.9.1.3"
+__version__ = "0.9.1.4"
 MODULE_NAME = "ogsmd.callhandler"
 
 from ogsmd import error
@@ -56,30 +56,41 @@ class CallHandler( object ):
         return self._calls[1]["status"], self._calls[2]["status"]
 
     #
-    # additional support for data call handling
+    # additional support for data call handling with a customizable data call handler
     #
     def onActivateResult( self, request, response ):
         """
         Called after ATA
         """
-        # if this is a data call, add the port where communication can happen
         if response[0].startswith( "CONNECT" ): # data call succeeded
-            self.csdid = callId = 1 if self._calls[1]["status"] == "active" else 2
-            self.csdchan = channel = self._object.modem.channel( "CallMediator" )
-            self.statusChangeFromNetwork( callId, { "status": "connect", "port": channel.port() } )
-
-            # check whether we have a data call handler registered
-            dataCallHandler = self._object.modem.data( "data-call-handler" )
-            if dataCallHandler is not None:
-                self.csdchan.freeze()
-                csd_commandline = dataCallHandler.split()
-                if not dataCallHandler.startswith( "/bin/sleep" ): # for debugging
-                    csd_commandline += [ channel.port(), self._calls[callId]["direction"] ]
-                self.csdproc = ProcessGuard( csd_commandline )
-                logger.info( "launching csd handler as commandline %s" % csd_commandline )
-                self.csdproc.execute( onExit=self._spawnedProcessDone )
-            else:
-                logger.info( "no csd handler registered" )
+            self._onDataCallEstablished()
+
+    def onInitiateResult( self, request, response ):
+        """
+        Called after ATDxyz
+        """
+        if response[0].startswith( "CONNECT" ): # data call succeeded
+            self._onDataCallEstablished()
+
+    def _onDataCallEstablished( self ):
+        logger.debug( "data call established" )
+        # if this is a data call, add the port where communication happens
+        self.csdid = callId = 1 if self._calls[1]["status"] == "active" else 2
+        self.csdchan = channel = self._object.modem.channel( "CallMediator" )
+        self.statusChangeFromNetwork( callId, { "status": "connect", "port": channel.port() } )
+
+        # check whether we have a data call handler registered
+        dataCallHandler = self._object.modem.data( "data-call-handler" )
+        if dataCallHandler is not None:
+            self.csdchan.freeze()
+            csd_commandline = dataCallHandler.split()
+            if not dataCallHandler.startswith( "/bin/sleep" ): # for debugging
+                csd_commandline += [ channel.port(), self._calls[callId]["direction"] ]
+            self.csdproc = ProcessGuard( csd_commandline )
+            logger.info( "launching csd handler as commandline %s" % csd_commandline )
+            self.csdproc.execute( onExit=self._spawnedProcessDone )
+        else:
+            logger.info( "no csd handler registered" )
 
     def _spawnedProcessDone( self, pid, exitcode, exitsignal ):
         """
@@ -89,7 +100,8 @@ class CallHandler( object ):
         # unfreeze
         self.csdchan.thaw()
         # release call and resume normal operation
-        self.release( self.csdid, self._object.modem.channel( "MiscMediator" ) )
+        # self.release( self.csdid, self._object.modem.channel( "MiscMediator" ) )
+        self.releaseAll( self._object.modem.channel( "MiscMediator" ) )
 
     #
     # called from mediators
@@ -227,7 +239,7 @@ class CallHandler( object ):
     def state_release_release( self, action, *args, **kwargs ):
         if action == "initiate":
             dialstring, commchannel = args
-            commchannel.enqueue( "D%s" % dialstring, self.responseFromChannel, self.errorFromChannel )
+            commchannel.enqueue( "D%s" % dialstring, self.onInitiateResult, self.errorFromChannel )
             return 1
 
     def state_incoming_release( self, action, *args, **kwargs ):

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list