voipplugins/sipconnectionprovider/src/scpprofilehandler.cpp
branchRCL_3
changeset 9 bddb6d4447db
parent 0 a4daefaec16c
child 10 ed1e38b404e5
--- a/voipplugins/sipconnectionprovider/src/scpprofilehandler.cpp	Fri Mar 12 15:42:09 2010 +0200
+++ b/voipplugins/sipconnectionprovider/src/scpprofilehandler.cpp	Mon Mar 15 12:39:55 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -459,6 +459,26 @@
     }
 
 // -----------------------------------------------------------------------------
+// CScpProfileHandler::StartAlrMigration
+// -----------------------------------------------------------------------------
+//
+void CScpProfileHandler::StartAlrMigration( TUint32 aProfileId )
+    {
+    SCPLOGSTRING2( "CScpProfileHandler::StartMigrtion profile: %i", aProfileId );
+    SCPLOGSTRING2( "CScpProfileHandler::StartMigrtion iNewAlrIapId: %i", iNewAlrIapId );
+    
+    TRAP_IGNORE(
+       iAlrController->AllowMigrationL( aProfileId, iNewAlrIapId ) );
+    
+    CScpSipConnection* sipConnection( NULL );
+    
+    sipConnection = GetSipConnection( aProfileId );
+    sipConnection->SetProfileCurrentlyRoaming();
+    
+    SCPLOGSTRING( "CScpProfileHandler::StartMigrtion -exit" );
+    }
+
+// -----------------------------------------------------------------------------
 // CScpProfileHandler::AlrEvent
 // -----------------------------------------------------------------------------
 //
@@ -502,13 +522,29 @@
                     }
                 else
                     {
-                    sipConnection->SetProfileCurrentlyRoaming();
+                    iAlrAllowedToStartImmediately = ETrue;
 
-                    TRAP_IGNORE(
-                        iAlrController->AllowMigrationL( aProfileId, aIapId ) );
+                    for ( TInt i = 0; i < iObservers.Count(); i++ )
+                        {
+                        if ( !iObservers[ i ]->IsSipProfileAllowedToStartAlr() )
+                            {
+                            iAlrAllowedToStartImmediately = EFalse;
+                            break;
+                            }
+                        }
+                    if ( iAlrAllowedToStartImmediately )
+                        {
+                        TRAP_IGNORE(
+                            iAlrController->AllowMigrationL( aProfileId, aIapId ) );
+                        sipConnection->SetProfileCurrentlyRoaming();
+                        }
+                    else
+                        {
+                        iNewAlrIapId = aIapId;
+                        sipConnection->HandleMigrationStarted();
+                        }
                     }
                 }
-
             break;
             }
 
@@ -519,11 +555,10 @@
             {
             sipConnection = GetSipConnection( aProfileId );
             
-            if( sipConnection )
+            if( sipConnection && iAlrAllowedToStartImmediately )
                 {
                 sipConnection->HandleMigrationStarted();
                 }
-            
             break;
             }
         
@@ -597,6 +632,15 @@
     }
 
 // -----------------------------------------------------------------------------
+// CScpProfileHandler::IsSipProfileAllowedToStartAlr
+// -----------------------------------------------------------------------------
+//
+TBool CScpProfileHandler::IsSipProfileAllowedToStartAlr()
+    {
+    return ETrue;
+    }
+    
+// -----------------------------------------------------------------------------
 // CScpProfileHandler::VmbxInterfaceL
 // -----------------------------------------------------------------------------
 //