[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. debian/0.9.5.9+git20110512-1-44-g2b0bd1a

Felix Huber felix.huber at schyf.de
Tue May 15 11:58:58 UTC 2012


The following commit has been merged in the debian branch:
commit 3d1346af8414f6f262385643b7e1060f91a97deb
Author: Felix Huber <felix.huber at schyf.de>
Date:   Wed Jan 4 23:26:56 2012 +0100

    ogsmd: bug fixes, start work for conference, toggle and 3rd incoming call

diff --git a/framework/subsystems/ogsmd/modems/abstract/calling.py b/framework/subsystems/ogsmd/modems/abstract/calling.py
index 7652b8c..fbfb018 100644
--- a/framework/subsystems/ogsmd/modems/abstract/calling.py
+++ b/framework/subsystems/ogsmd/modems/abstract/calling.py
@@ -15,6 +15,8 @@ New style abstract call handling
 __version__ = "0.9.1.4"
 MODULE_NAME = "ogsmd.callhandler"
 
+import mediator
+
 from ogsmd import error
 from ogsmd.gsm import const
 
@@ -40,6 +42,7 @@ class CallHandler( object ):
         self._calls = {}
         self._calls[1] = { "status": "release" }
         self._calls[2] = { "status": "release" }
+        # we can have at least 2 calls, more will be added when coming in
 
         self.unsetHook()
 
@@ -117,6 +120,11 @@ class CallHandler( object ):
         self._hook( "activate", result )
         return result
 
+    def activateConference( self, index, commchannel ):
+        result = self.feedUserInput( "conference", index=index, channel=commchannel )
+        self._hook( "conference", result )
+        return result
+
     def release( self, index, commchannel ):
         result = self.feedUserInput( "release", index=index, channel=commchannel )
         self._hook( "release", result )
@@ -144,6 +152,8 @@ class CallHandler( object ):
                 # FIXME is the above comment really true?
 
     def statusChangeFromNetwork( self, callId, info ):
+        if not self._calls.has_key(callId):
+            self._calls[callId] = { "status": "release" }
         lastStatus = self._calls[callId].copy()
         self._calls[callId].update( info )
 
@@ -200,15 +210,17 @@ class CallHandler( object ):
     # synchronize status
     #
     def syncStatus( self, request, response ):
-        CallListCalls( Object.instance(), self.syncStatus_ok, self.syncStatus_err )
+        mediator.CallListCalls( self._object, self.syncStatus_ok, self.syncStatus_err )
 
     def syncStatus_ok( self, calls ):
         if len( calls ) > 1:
             logger.warning( "unhandled case" )
-            return
+            logger.warning( "calls is %s", calls)
+            #return
         # synthesize status change from network
-        callid, status, properties = calls[0]
-        self.statusChangeFromNetwork( callid, {"status": status} )
+        for call in calls:
+            callid, status, properties = call
+            self.statusChangeFromNetwork( callid, {"status": status} )
 
     def syncStatus_err( self, request, error ):
         logger.error( "error from channel to %s = %s", request, error )
@@ -264,6 +276,7 @@ class CallHandler( object ):
         elif action == "hold":
             # put active call on hold without accepting any waiting or held
             # this is not supported by all modems / networks
+            # thus we must call syncStatus to check
             self.channel = kwargs["channel"]
             kwargs["channel"].enqueue( "+CHLD=2", self.syncStatus )
             return True
@@ -280,6 +293,10 @@ class CallHandler( object ):
             self.channel = kwargs["channel"]
             kwargs["channel"].enqueue( "+CHLD=2", self.syncStatus )
             return True
+        elif action == "initiate":
+            dialstring, commchannel = args
+            commchannel.enqueue( "D%s" % dialstring, self.onInitiateResult, self.errorFromChannel )
+            return 2
 
     #
     # 1st call active, 2nd call call incoming or on hold
@@ -314,11 +331,14 @@ class CallHandler( object ):
                 # release held call
                 kwargs["channel"].enqueue( "+CHLD=12" )
                 return True
+            else:
+                # Fixme: we can have a 3rd call incoming that cannot be accepted, however, but still rejected
+                # TI Calypso indicates the 3rd call, but refuses the index on commanding???
+                logger.warning("FIXME: callid >2 (%s), don't know what to do", kwargs["index"])
         elif action == "activate":
-            if kwargs["index"] == 2:
-                # put active call on hold, activate held call
-                kwargs["channel"].enqueue( "+CHLD=2" )
-                return True
+            # 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
@@ -328,7 +348,7 @@ class CallHandler( object ):
 
     def state_held_active( self, action, *args, **kwargs ):
         # should be the same as the reversed state
-        return state_active_held( self, action, *args, **kwargs )
+        return self.state_active_held( action, *args, **kwargs )
 
     # both calls active
     def state_active_active( self, action, *args, **kwargs ):
@@ -352,3 +372,4 @@ class CallHandler( object ):
         elif action == "connect":
             kwargs["channel"].enqueue( "+CHLD=4" )
             return True
+
diff --git a/framework/subsystems/ogsmd/modems/abstract/mediator.py b/framework/subsystems/ogsmd/modems/abstract/mediator.py
index 5b37856..05d33ad 100644
--- a/framework/subsystems/ogsmd/modems/abstract/mediator.py
+++ b/framework/subsystems/ogsmd/modems/abstract/mediator.py
@@ -1627,6 +1627,15 @@ class CallActivate( CallMediator ):
             self._error( DBusError.CallNotFound( "no such call to activate" ) )
 
 #=========================================================================#
+class CallActivateConference( CallMediator ):                         
+#=========================================================================#
+    def trigger( self ):
+        if CallHandler.getInstance().activateConference( self.index, self._commchannel ) is not None:
+            self._ok()                        
+        else:
+            self._error( DBusError.CallNotFound( "no such calls to put into conference" ) )
+                                    
+#=========================================================================#
 class CallHoldActive( CallMediator ):
 #=========================================================================#
     def trigger( self ):
@@ -1808,6 +1817,7 @@ class DebugCommand( DebugMediator ):
     def responseFromChannel( self, request, response ):
         self._ok( response )
 
+
 #=========================================================================#
 if __name__ == "__main__":
 #=========================================================================#
diff --git a/framework/subsystems/ogsmd/modems/ti_calypso/unsolicited.py b/framework/subsystems/ogsmd/modems/ti_calypso/unsolicited.py
index 53a29f5..35dfda5 100644
--- a/framework/subsystems/ogsmd/modems/ti_calypso/unsolicited.py
+++ b/framework/subsystems/ogsmd/modems/ti_calypso/unsolicited.py
@@ -122,6 +122,14 @@ class UnsolicitedResponseDelegate( AbstractUnsolicitedResponseDelegate ):
         pass
 
     # +CSSU: 2,,"",128
+    # 0 Forwarded call
+    # 1 CUG (plus index)
+    # 2 remotely put on hold
+    # 3 remote hold released
+    # 4 Multiparty call entered
+    # 5 Call on hold has been released
+    # 6 -
+    # 7,8 ?
     def plusCSSU( self, righthandside ):
         code, index, number, type = safesplit( righthandside, "," )
         info = {}
@@ -136,7 +144,11 @@ class UnsolicitedResponseDelegate( AbstractUnsolicitedResponseDelegate ):
         else:
             logger.info( "unhandled +CSSU code '%s'" % code )
         if info:
-            self._callHandler.statusChangeFromNetworkByStatus( "incoming", info )
+            # This is not failsafe since we don't know the call ID
+            if code in "23":
+                self._callHandler.statusChangeFromNetworkByStatus( "active", info )
+            else:
+                self._callHandler.statusChangeFromNetworkByStatus( "incoming", info )
 
     #
     # TI Calypso proprietary
@@ -144,6 +156,22 @@ class UnsolicitedResponseDelegate( AbstractUnsolicitedResponseDelegate ):
 
     # %CCCN: 0,0,A10E02010402011030068101428F0101
 
+    # FIXME: need decoder for this
+    # reponses to conference AT+CHLD=3 with one call held and one active:
+    # failed (with e-plus)
+    # %CCCN: 1,1,A10602010002017C
+    #                     ^ fail ?
+    # +CMS ERROR: 320          HEX data packet: 7e 0d ef 0d 0a 2b 43...
+    #                                               ^ channel 3(MISC)? TI firmware bug? 
+    # %CCCN: 0,1,A306020100020112
+    #
+    #
+    # succeded (with D2)
+    # %CCCN: 1,1,A10602010102017C
+    #                     ^ ok ?
+    # %CCCN: 0,1,A203020101 
+    #
+    #
     # call to homezone number while in homezone
     # this is sent while the call is incoming
     # %CCCN: 0,0,A10E0201000201103006810120850101
@@ -221,8 +249,14 @@ class UnsolicitedResponseDelegate( AbstractUnsolicitedResponseDelegate ):
         ... case B.3: local cancel ...
         ?
 
+        ... case C.1: first call active, second incoming and accepted (puts first on hold)
+        %CPI: 1,10,0,1,0,0,"+496912345678",145,,,0
+        %CPI: 2,6,0,1,1,0,"+496912345679",129,,,0
+
         """
         callId, msgType, ibt, tch, direction, mode, number, ntype, alpha, cause, line = safesplit( righthandside, "," )
+        if msgType == "10":
+            msgType ="A"  # stupid hack to have single char types
 
         #devchannel = self._object.modem.communicationChannel( "DeviceMediator" )
         #devchannel.enqueue( "+CPAS;+CEER" )
@@ -262,7 +296,9 @@ class UnsolicitedResponseDelegate( AbstractUnsolicitedResponseDelegate ):
             info.update( { "status": "outgoing" } )
         elif msgType == "3": # Sometimes setup is not sent?!
             info.update( { "status": info["direction"] } )
-        if msgType in "013689":
+        elif msgType == "A": # hold
+            info.update( { "status": "held" } )
+        if msgType in "013689A":
             self._callHandler.statusChangeFromNetwork( int(callId), info )
 
         # DSP bandaid

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list