[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Michael 'Mickey' Lauer mickey at vanille-media.de
Mon Feb 2 18:51:27 UTC 2009


The following commit has been merged in the master branch:
commit 815794a2510bb6134dd16ce251056601d06e84e2
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Fri Nov 28 17:48:59 2008 +0100

    ogsmd: Revamped callhandling. Refactored the state-based call handler
    from TI Calypso (and Freescale Neptune) into a generic class that will
    be used from all modem abstractions. Ported singleline to use the new
    call handler. More tests needed for TI Calypso and Freescale Neptune.

diff --git a/ChangeLog b/ChangeLog
index 99a8461..09b3369 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
+2008-11-28	Michael Lauer	<mickey at openmoko.org>
+
+	* [ogsmd] Revamped callhandling. Refactored the state-based call handler
+	  from TI Calypso (and Freescale Neptune) into a generic class that will
+	  be used from all modem abstractions. Ported singleline to use the new
+	  call handler. More tests needed for TI Calypso and Freescale Neptune.
+
 2008-11-27	Michael Lauer	<mickey at openmoko.org>
 
-	* [tests] Start with dbus API tests
+	* [tests] Started with dbus API tests
 
 2008-11-23	Michael Lauer	<mickey at openmoko.org>
 
diff --git a/framework/subsystems/ogsmd/modems/abstract/calling.py b/framework/subsystems/ogsmd/modems/abstract/calling.py
index ca276bd..9781fb4 100644
--- a/framework/subsystems/ogsmd/modems/abstract/calling.py
+++ b/framework/subsystems/ogsmd/modems/abstract/calling.py
@@ -12,8 +12,14 @@ Module: calling
 New style abstract call handling
 """
 
+__version__ = "0.9.1.0"
+MODULE_NAME = "ogsmd.callhandler"
+
 from ogsmd.gsm import error, const
 
+import logging
+logger = logging.getLogger( MODULE_NAME )
+
 #=========================================================================#
 class CallHandler( object ):
 #=========================================================================#
@@ -29,27 +35,55 @@ class CallHandler( object ):
     def __init__( self, dbus_object ):
         self._object = dbus_object
         self._calls = {}
-        self._calls[1] = { "status":"release" }
-        self._calls[2] = { "status":"release" }
+        self._calls[1] = { "status": "release" }
+        self._calls[2] = { "status": "release" }
 
-    def _updateStatus( self, callId ):
-        """send dbus signal indicating call status for a callId"""
-        self._object.CallStatus( callId, self._calls[callId]["status"], self._calls[callId] )
+        self.unsetHook()
+
+    def setHook( self, hook ):
+        self._hook = hook
+
+    def unsetHook( self ):
+        self._hook = lambda *args, **kwargs: None
+
+    def isBusy( self ):
+        return self._calls[1]["status"] != "release" or self._calls[2]["status"] != "release"
+
+    def status( self ):
+        return self._calls[1]["status"], self._calls[2]["status"]
+
+    #
+    # called from mediators
+    #
 
     def initiate( self, dialstring, commchannel ):
-        return self.feedUserInput( "initiate", dialstring, commchannel )
+        result = self.feedUserInput( "initiate", dialstring, commchannel )
+        self._hook( "initiate", result )
+        return result
 
     def activate( self, index, commchannel ):
-        return self.feedUserInput( "activate", index=index, channel=commchannel )
+        result = self.feedUserInput( "activate", index=index, channel=commchannel )
+        self._hook( "activate", result )
+        return result
 
     def release( self, index, commchannel ):
-        return self.feedUserInput( "release", index=index, channel=commchannel )
+        result = self.feedUserInput( "release", index=index, channel=commchannel )
+        self._hook( "release", result )
+        return result
 
     def releaseAll( self, commchannel ):
-        return self.feedUserInput( "dropall", channel=commchannel )
+        result = self.feedUserInput( "dropall", channel=commchannel )
+        self._hook( "dropall", result )
+        return result
 
     def hold( self, commchannel ):
-        return self.feedUserInput( "hold", channel=commchannel )
+        result = self.feedUserInput( "hold", channel=commchannel )
+        self._hook( "hold", result )
+        return result
+
+    #
+    # called from unsolicited response delegates
+    #
 
     def ring( self ):
         for callId, info in self._calls.items():
@@ -59,10 +93,19 @@ class CallHandler( object ):
                 # FIXME is the above comment really true?
 
     def statusChangeFromNetwork( self, callId, info ):
+        lastStatus = self._calls[callId].copy()
         self._calls[callId].update( info )
+
         if self._calls[callId]["status"] == "release":
-            self._calls[callId] = { "status":"release" }
-        self._updateStatus( callId )
+            # release signal always without properties
+            self._calls[callId] = { "status": "release" }
+
+        if self._calls[callId]["status"] != "incoming":
+            # suppress sending the same signal twice
+            if lastStatus != self._calls[callId]:
+                self._updateStatus( callId )
+        else:
+            self._updateStatus( callId )
 
     def statusChangeFromNetworkByStatus( self, status, info ):
         calls = [call for call in self._calls.items() if call[1]["status"] == status]
@@ -70,6 +113,14 @@ class CallHandler( object ):
             raise error.InternalException( "non-unique call state '%'" % status )
         self.statusChangeFromNetwork( calls[0][0], info )
 
+    #
+    # internal
+    #
+
+    def _updateStatus( self, callId ):
+        """send dbus signal indicating call status for a callId"""
+        self._object.CallStatus( callId, self._calls[callId]["status"], self._calls[callId] )
+
     def feedUserInput( self, action, *args, **kwargs ):
         # simple actions
         # FIXME might rather want to consider using the state machine, since that would be more clear
diff --git a/framework/subsystems/ogsmd/modems/abstract/mediator.py b/framework/subsystems/ogsmd/modems/abstract/mediator.py
index e76c208..a25955e 100644
--- a/framework/subsystems/ogsmd/modems/abstract/mediator.py
+++ b/framework/subsystems/ogsmd/modems/abstract/mediator.py
@@ -22,6 +22,7 @@ TODO:
 """
 
 __version__ = "0.9.10.2"
+MODULE_NAME = "ogsmd.modems.abstract.mediator"
 
 from .calling import CallHandler
 
@@ -33,6 +34,9 @@ import ogsmd.gsm.sms
 import gobject
 import re, time
 
+import logging
+logger = logging.getLogger( MODULE_NAME )
+
 #=========================================================================#
 class AbstractMediator( object ):
 #=========================================================================#
@@ -1165,7 +1169,9 @@ class CallListCalls( NetworkMediator ): # a(isa{sv})
                 if not line: # some modems might include empty lines here, one for every (not present) call...
                     continue
                 gd = const.groupDictIfMatch( const.PAT_CLCC, line )
-                assert gd is not None, "parsing error"
+                if gd is None:
+                    logger.warning( "+CLCC parsing error for line '%s'" % line )
+                    continue
                 index = int( gd["id"] )
                 stat = int( gd["stat"] )
                 direction = const.CALL_DIRECTION[ int( gd["dir"] ) ]
diff --git a/framework/subsystems/ogsmd/modems/abstract/unsolicited.py b/framework/subsystems/ogsmd/modems/abstract/unsolicited.py
index 0f74ae5..a5728e7 100644
--- a/framework/subsystems/ogsmd/modems/abstract/unsolicited.py
+++ b/framework/subsystems/ogsmd/modems/abstract/unsolicited.py
@@ -11,6 +11,8 @@ Package: ogsmd.modems.abstract
 Module: unsolicited
 """
 
+__version__ = "0.9.9.0"
+
 import calling
 
 from ogsmd.gsm.decor import logged
@@ -18,6 +20,11 @@ from ogsmd.gsm import const, convert
 from ogsmd.helpers import safesplit
 import ogsmd.gsm.sms
 
+import logging
+logger = logging.getLogger( "ogsmd.modems.abstract.unsolicited" )
+
+import gobject
+
 #=========================================================================#
 class AbstractUnsolicitedResponseDelegate( object ):
 #=========================================================================#
@@ -26,10 +33,13 @@ class AbstractUnsolicitedResponseDelegate( object ):
         self._object = dbus_object
         self._mediator = mediator
         self._callHandler = calling.CallHandler.getInstance( dbus_object )
+        self._callHandler.setHook( self._cbCallHandlerAction )
 
         self.lac = None
         self.cid = None
 
+        self._syncTimeout = None
+
     def _sendStatus( self ):
         self._object.Status( self.operator, self.register, self.strength )
 
@@ -67,8 +77,8 @@ class AbstractUnsolicitedResponseDelegate( object ):
         """
         number, ntype, rest = safesplit( righthandside, ',', 2 )
         number = number.replace( '"', '' )
-        BROKEN = "PLEASE FIX ME"
-        self._mediator.Call.clip( self._object, const.phonebookTupleToNumber( number, int(ntype ) ) )
+        logger.warning( "plusCLIP not handled -- please fix me" )
+        #self._mediator.Call.clip( self._object, const.phonebookTupleToNumber( number, int(ntype ) ) )
 
     # +CMT: "004D00690063006B006500790020007000720069",22
     # 0791947107160000000C9194712716464600008001301131648003D9B70B
@@ -89,8 +99,9 @@ class AbstractUnsolicitedResponseDelegate( object ):
         """
         storage, index = safesplit( righthandside, ',' )
         if storage != '"SM"':
-            assert False, "unhandled +CMTI message notification"
-        self._object.IncomingStoredMessage( int(index) )
+            logger.warning( "unhandled +CMTI message notification" )
+        else:
+            self._object.IncomingStoredMessage( int(index) )
 
     # +CREG: 1,"000F","032F"
     def plusCREG( self, righthandside ):
@@ -111,19 +122,17 @@ class AbstractUnsolicitedResponseDelegate( object ):
         Incoming call
         """
         if calltype == "VOICE":
-            self._mediator.Call.ring( self._object, calltype )
-        elif category == "UnsolicitedMediator":
-            return self._channels["UNSOL"]
+            self._syncCallStatus( "RING" )
+            self._startTimeoutIfNeeded()
         else:
-            assert False, "unhandled call type"
+            logger.warning( "unhandled call type, ignoring for now. Please fix me..." )
 
     # +CMS ERROR: 322
     def plusCMS_ERROR( self, righthandside ):
         """
         Incoming unsolicited error
 
-        This is pretty rare in general, I've only seen 322 so far
-        when we are using SMS in SIM-buffered mode.
+        Seen, when we are using SMS in SIM-buffered mode.
         """
         errornumber = int( righthandside )
         if errornumber == 322:
@@ -134,9 +143,6 @@ class AbstractUnsolicitedResponseDelegate( object ):
         """
         Incoming USSD result
         """
-
-        # FIXME needs to be adjusted for PDU mode
-
         values = safesplit( righthandside, ',' )
         if len( values ) == 1:
             mode = const.NETWORK_USSD_MODE[int(values[0])]
@@ -146,7 +152,7 @@ class AbstractUnsolicitedResponseDelegate( object ):
             message = convert.ucs2hexToUnicode(values[1].strip( '" ' ) )
             self._object.IncomingUssd( mode, message )
         else:
-            assert False, "unknown format"
+            logger.warning( "Ignoring unknown format: '%s'" % righthandside )
     #
     # helpers
     #
@@ -159,4 +165,55 @@ class AbstractUnsolicitedResponseDelegate( object ):
         self._object.Status( status ) # send dbus signal
 
     def statusERR( self, values ):
-        print "error... ignoring"
+        logger.warning( "statusERR... ignoring" )
+
+    def _startTimeoutIfNeeded( self ):
+        if self._syncTimeout is None:
+            self._syncTimeout = gobject.timeout_add_seconds( 1, self._cbSyncTimeout )
+
+    def _syncCallStatus( self, initiator ):
+       self._mediator.CallListCalls( self._object, self._syncCallStatus_ok, self._syncCallStatus_err )
+
+    def _syncCallStatus_ok( self, calls ):
+        seen = []
+        for callid, status, properties in calls:
+            seen.append( callid )
+            self._callHandler.statusChangeFromNetwork( callid, {"status": status} )
+        # synthesize remaining calls
+        if not 1 in seen:
+            self._callHandler.statusChangeFromNetwork( 1, {"status": "release"} )
+        if not 2 in seen:
+            self._callHandler.statusChangeFromNetwork( 2, {"status": "release"} )
+
+    def _syncCallStatus_err( self, request, error ):
+        logger.warning( "+CLCC didn't succeed -- ignoring" )
+
+    def _cbSyncTimeout( self, *args, **kwargs ):
+        """
+        Called by the glib mainloop while anything call-related happens.
+        """
+        logger.debug( "sync timeout while GSM is not idle" )
+        self._syncCallStatus( "SYNC TIMEOUT" )
+
+        if self._callHandler.isBusy():
+            logger.debug( "call handler is busy" )
+            return True # glib mainloop: please call me again
+        else:
+            logger.debug( "call handler is not busy" )
+            self._syncTimeout = None
+            return False # glib mainloop: don't call me again
+
+    def _cbCallHandlerAction( self, action, result ):
+        """
+        Called by the call handler once a user-initiated action has been performed.
+        """
+        self._syncCallStatus( "MEDIATOR ACTION" )
+        logger.debug( "call handler action %s w/ result %s" % ( action, result ) )
+        if result is not False:
+            if action == "initiate":
+                first, second = self._callHandler.status()
+                if first == "release":
+                    self._callHandler.statusChangeFromNetwork( 1, {"status": "outgoing"} )
+                else:
+                    self._callHandler.statusChangeFromNetwork( 2, {"status": "outgoing"} )
+            self._startTimeoutIfNeeded()
diff --git a/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py b/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py
index 18cf19a..1d63a0f 100644
--- a/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py
+++ b/framework/subsystems/ogsmd/modems/freescale_neptune/mediator.py
@@ -9,26 +9,16 @@ Package: ogsmd.modems.freescale_neptune
 Module: mediator
 """
 
-__version__ = "0.4.0.0"
+__version__ = "0.5.0.0"
+MODULE_NAME = "ogsmd.modems.freescale_neptune.mediator"
 
-from ogsmd.modems.abstract import mediator
+from ogsmd.modems.abstract import *
 from ogsmd.gsm.decor import logged
 from ogsmd.gsm import const
 from ogsmd.helpers import safesplit
 
-# Ok, now this is a bit of magic...:
-# We suck everything from the abstract mediator into this and overload on-demand.
-# Think inheritage on a module-base... :M:
-
-import types
-
-for key, val in mediator.__dict__.items():
-    #print key, "=", type( val )
-    if type( val ) == types.TypeType:
-        execstring = "global %s; %s = mediator.%s" % ( key, key, key )
-        #print execstring
-        exec execstring
-del mediator
+import logging
+logger = logging.getLogger( MODULE_NAME )
 
 # add overrides here
 
@@ -48,6 +38,7 @@ PAT_SMS_PDU_HEADER_SINGLE = re.compile( '(?P<status>\d+)(?:,"(?P<name>[^"]*)")?,
 const.PAT_SMS_PDU_HEADER = PAT_SMS_PDU_HEADER
 const.PAT_SMS_PDU_HEADER_SINGLE = PAT_SMS_PDU_HEADER_SINGLE
 
+
 #=========================================================================#
 class DeviceGetInfo( DeviceMediator ):
 #=========================================================================#
@@ -141,295 +132,6 @@ class NetworkGetStatus( NetworkMediator ):
 
         self._ok( result )
 
-#=========================================================================#
-class CallInitiate( CallMediator ):
-#=========================================================================#
-    def trigger( self ):
-        if self.calltype == "voice":
-            dialstring = "%s;" % self.number
-        else:
-            dialstring = self.number
-
-        line = callHandler.initiate( dialstring, self._commchannel )
-        if line is None:
-            self._error( error.CallNoCarrier( "unable to dial" ) )
-        else:
-            self._ok( line )
-
-#=========================================================================#
-class CallRelease( CallMediator ):
-#=========================================================================#
-    def trigger( self ):
-        if callHandler.release( self.index, self._commchannel ) is not None:
-            self._ok()
-        else:
-            self._error( error.CallNotFound( "no such call to release" ) )
-
-#=========================================================================#
-class CallReleaseAll( CallMediator ):
-#=========================================================================#
-    def trigger( self ):
-            callHandler.releaseAll( self._commchannel )
-            self._ok()
-
-#=========================================================================#
-class CallActivate( CallMediator ):
-#=========================================================================#
-    def trigger( self ):
-        if callHandler.activate( self.index, self._commchannel ) is not None:
-            self._ok()
-        else:
-            self._error( error.CallNotFound( "no such call to activate" ) )
-
-#=========================================================================#
-class CallHoldActive( CallMediator ):
-#=========================================================================#
-    def trigger( self ):
-        if callHandler.hold( self._commchannel ) is not None:
-            self._ok()
-        else:
-            self._error( error.CallNotFound( "no such call to hold" ) )
-
-#=========================================================================#
-class CallHandler( object ):
-#=========================================================================#
-    def __init__( self, dbus_object ):
-        self._object = dbus_object
-        self._calls = {}
-        self._calls[1] = { "status": "release" }
-        self._calls[2] = { "status": "release" }
-
-    def _updateStatus( self, callId ):
-        """send dbus signal indicating call status for a callId"""
-        self._object.CallStatus( callId, self._calls[callId]["status"], self._calls[callId] )
-
-    def initiate( self, dialstring, commchannel ):
-        return self.feedUserInput( "initiate", dialstring, commchannel )
-
-    def activate( self, index, commchannel ):
-        return self.feedUserInput( "activate", index=index, channel=commchannel )
-
-    def release( self, index, commchannel ):
-        return self.feedUserInput( "release", index=index, channel=commchannel )
-
-    def releaseAll( self, commchannel ):
-        # not going via state machine, since this is possible at any time
-        commchannel.enqueue( "ATH" )
-
-    def hold( self, commchannel ):
-        return self.feedUserInput( "hold", channel=commchannel )
-
-    def ring( self ):
-        for callId, info in self._calls.items():
-            if info["status"] == "incoming":
-                self._updateStatus( callId )
-                break # can't be more than one call incoming at once (GSM limitation)
-
-    def statusChangeFromNetwork( self, callId, info ):
-        print "statusChangeFromNetwork:"
-        print "last status was: ", self._calls
-
-        lastStatus = self._calls[callId].copy()
-        self._calls[callId].update( info )
-
-        if self._calls[callId]["status"] == "release":
-            # release signal always without properties
-            self._calls[callId] = { "status": "release" }
-
-        if self._calls[callId]["status"] != "incoming":
-            # suppress sending the same signal twice
-            if lastStatus != self._calls[callId]:
-                self._updateStatus( callId )
-        else:
-            self._updateStatus( callId )
-
-        print "status now is: ", self._calls
-
-
-    def feedUserInput( self, action, *args, **kwargs ):
-        # simple actions
-        if action == "dropall":
-            kwargs["channel"].enqueue( 'H' )
-            return True
-        try:
-            state = "state_%s_%s" % ( self._calls[1]["status"], self._calls[2]["status"] )
-            method = getattr( self, state )
-        except AttributeError:
-            raise error.InternalException( "unhandled state '%s' in state machine. calls are %s" % ( state, repr(self._calls) ) )
-        else:
-            return method( action, *args, **kwargs )
-
-    #
-    # deal with responses from call control commands
-    #
-    def responseFromChannel( self, request, response ):
-        print "AT RESPONSE FROM CHANNEL=", response
-
-    def errorFromChannel( self, request, response ):
-        print "AT ERROR FROM CHANNEL=", response
-
-    #
-    # synchronize status
-    #
-    def syncStatus( self, request, response ):
-        CallListCalls( self._object, self.syncStatus_ok, self.syncStatus_err )
-
-    def syncStatus_ok( self, calls ):
-        assert len( calls ) == 1, "unhandled case"
-        # synthesize status change from network
-        callid, status, properties = calls[0]
-        self.statusChangeFromNetwork( callid, {"status": status} )
-
-    def syncStatus_err( self, request, error ):
-        print "AT ERROR FROM CHANNEL=", error
-
-    #
-    # state machine actions following. micro states:
-    #
-    # release: line idle, call has been released
-    # incoming: remote party is calling, network is alerting us
-    # outgoing: local party is calling, network is alerting remote party
-    # active: local and remote party talking
-    # held: remote party held
-
-    # An important command here is +CHLD=<n>
-    # <n>  Description
-    # -----------------
-    #  0   Release all held calls or set the busy state for the waiting call.
-    #  1   Release all active calls.
-    #  1x  Release only call x.
-    #  2   Put active calls on hold (and activate the waiting or held call).
-    #  2x  Put active calls on hold and activate call x.
-    #  3   Add the held calls to the active conversation.
-    #  4   Add the held calls to the active conversation, and then detach the local subscriber from the conversation.
-
-    #
-    # action with 1st call, 2nd call released
-    #
-    def state_release_release( self, action, *args, **kwargs ):
-        if action == "initiate":
-            dialstring, commchannel = args
-            commchannel.enqueue( "D%s" % dialstring, self.responseFromChannel, self.errorFromChannel )
-            return 1
-
-    def state_incoming_release( self, action, *args, **kwargs ):
-        if action == "release" and kwargs["index"] == 1:
-            kwargs["channel"].enqueue( 'H' )
-            return True
-        elif action == "activate" and kwargs["index"] == 1:
-            kwargs["channel"].enqueue( 'A' )
-            return True
-
-    def state_outgoing_release( self, action, *args, **kwargs ):
-        if action == "release" and kwargs["index"] == 1:
-            kwargs["channel"].cancelCurrentCommand()
-            return True
-
-    def state_active_release( self, action, *args, **kwargs ):
-        if action == "release" and kwargs["index"] == 1:
-            kwargs["channel"].enqueue( 'H' )
-            return True
-        elif action == "hold":
-            # put active call on hold without accepting any waiting or held
-            # this is not supported by all modems / networks
-            self.channel = kwargs["channel"]
-            kwargs["channel"].enqueue( "+CHLD=2", self.syncStatus )
-            return True
-
-    def state_held_release( self, action, *args, **kwargs ):
-        # state not supported by all modems
-        if action == "release" and kwargs["index"] == 1:
-            kwargs["channel"].enqueue( 'H' )
-            return True
-        elif action == "activate" and kwargs["index"] == 1:
-            # activate held call
-            self.channel = kwargs["channel"]
-            kwargs["channel"].enqueue( "+CHLD=2", self.syncStatus )
-            return True
-
-    #
-    # 1st call active, 2nd call call incoming or on hold
-    #
-    def state_active_incoming( self, action, *args, **kwargs ):
-        if action == "release":
-            if kwargs["index"] == 1:
-                # release active call, waiting call becomes active
-                kwargs["channel"].enqueue( "+CHLD=1" )
-                return True
-            elif kwargs["index"] == 2:
-                # reject waiting call, sending busy signal
-                kwargs["channel"].enqueue( "+CHLD=0" )
-                return True
-        elif action == "activate":
-            if kwargs["index"] == 2:
-                # put active call on hold, take waiting call
-                kwargs["channel"].enqueue( "+CHLD=2" )
-                return True
-        elif action == "conference":
-            # put active call on hold, take waiting call, add held call to conversation
-            kwargs["channel"].enqueue( "+CHLD=2;+CHLD=3" )
-            return True
-
-    def state_active_held( self, action, *args, **kwargs ):
-        if action == "release":
-            if kwargs["index"] == 1:
-                # release active call, (auto)activate the held call
-                kwargs["channel"].enqueue( "+CHLD=11" )
-                return True
-            elif kwargs["index"] == 2:
-                # release held call
-                kwargs["channel"].enqueue( "+CHLD=12" )
-                return True
-        elif action == "activate":
-            if kwargs["index"] == 2:
-                # put active call on hold, activate held call
-                kwargs["channel"].enqueue( "+CHLD=2" )
-                return True
-        elif action == "conference":
-            kwargs["channel"].enqueue( "+CHLD=3" )
-            return True
-        elif action == "connect":
-            kwargs["channel"].enqueue( "+CHLD=4" )
-            return True
-
-    def state_held_active( self, action, *args, **kwargs ):
-        # should be the same as the reversed state
-        return state_active_held( self, action, *args, **kwargs )
-
-    # both calls active
-    def state_active_active( self, action, *args, **kwargs ):
-        if action == "release":
-            if kwargs["index"] == 1:
-                # release only call 1
-                kwargs["channel"].enqueue( "+CHLD=11" )
-                return True
-            elif kwargs["index"] == 2:
-                kwargs["channel"].enqueue( "+CHLD=12" )
-                return True
-        elif action == "activate":
-            if kwargs["index"] == 1:
-                # put 2nd call on hold
-                kwargs["channel"].enqueue( "+CHLD=21" )
-                return True
-            elif kwargs["index"] == 2:
-                # put 1st call on hold
-                kwargs["channel"].enqueue( "+CHLD=22" )
-                return True
-        elif action == "connect":
-            kwargs["channel"].enqueue( "+CHLD=4" )
-            return True
-
-#=========================================================================#
-def createCallHandler( dbus_object ):
-#=========================================================================#
-    global callHandler
-    assert callHandler is None, "call handler created more than once"
-    callHandler = CallHandler( dbus_object )
-
-#=========================================================================#
-callHandler = None
-#=========================================================================#
-
 #
 # CB Mediators
 #
diff --git a/framework/subsystems/ogsmd/modems/singleline/channel.py b/framework/subsystems/ogsmd/modems/singleline/channel.py
index d780b43..33f162a 100644
--- a/framework/subsystems/ogsmd/modems/singleline/channel.py
+++ b/framework/subsystems/ogsmd/modems/singleline/channel.py
@@ -17,10 +17,9 @@ from ogsmd.modems.abstract.channel import AbstractModemChannel
 class SingleLineChannel( AbstractModemChannel ):
 #=========================================================================#
     def __init__( self, *args, **kwargs ):
-        AbstractModemChannel.__init__( self, *args, **kwargs )
-
         if not "timeout" in kwargs:
             kwargs["timeout"] = 60*60
+        AbstractModemChannel.__init__( self, *args, **kwargs )
 
     def _populateCommands( self ):
         """
diff --git a/framework/subsystems/ogsmd/modems/singleline/modem.py b/framework/subsystems/ogsmd/modems/singleline/modem.py
index 72db021..7e5a10f 100644
--- a/framework/subsystems/ogsmd/modems/singleline/modem.py
+++ b/framework/subsystems/ogsmd/modems/singleline/modem.py
@@ -36,4 +36,4 @@ class SingleLine( AbstractModem ):
             return self._channels["SINGLE"]
 
     def portfactory( self, name ):
-        return config.getValue("ogsmd", "serial", default="/dev/ttySAC0")
+        return config.getValue( "ogsmd", "serial", default="/dev/ttySAC0" )
diff --git a/framework/subsystems/ogsmd/modems/singleline/unsolicited.py b/framework/subsystems/ogsmd/modems/singleline/unsolicited.py
index efde49b..1a7de70 100644
--- a/framework/subsystems/ogsmd/modems/singleline/unsolicited.py
+++ b/framework/subsystems/ogsmd/modems/singleline/unsolicited.py
@@ -13,4 +13,7 @@ Module: unsolicited
 from ..abstract.unsolicited import AbstractUnsolicitedResponseDelegate
 
 class UnsolicitedResponseDelegate( AbstractUnsolicitedResponseDelegate ):
-    pass
+
+    def __init__( self, *args, **kwargs ):
+        AbstractUnsolicitedResponseDelegate.__init__( self, *args, **kwargs )
+

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list