voipplugins/sipconnectionprovider/src/scpservicemanager.cpp
branchRCL_3
changeset 20 65a3ef1d5bd0
parent 15 43658d24f35d
equal deleted inserted replaced
18:8c9c07ad8b6b 20:65a3ef1d5bd0
    34 
    34 
    35 const TInt KUsernameMaxLength = 255;
    35 const TInt KUsernameMaxLength = 255;
    36 const TInt KDomainMaxLength = 255;
    36 const TInt KDomainMaxLength = 255;
    37 const TInt KTempBufMaxLength = 255;
    37 const TInt KTempBufMaxLength = 255;
    38 
    38 
       
    39 const TUint32 KBearerWlanOnly = 1;
       
    40 
    39 #ifdef _DEBUG
    41 #ifdef _DEBUG
    40 const TInt KDebugInfoMaxLength = 255;
    42 const TInt KDebugInfoMaxLength = 255;
    41 #endif
    43 #endif
    42 
    44 
    43 // -----------------------------------------------------------------------------
    45 // -----------------------------------------------------------------------------
  1020 // CScpServiceManager::CheckRestrictedConnectionsL
  1022 // CScpServiceManager::CheckRestrictedConnectionsL
  1021 // -----------------------------------------------------------------------------
  1023 // -----------------------------------------------------------------------------
  1022 //
  1024 //
  1023 void CScpServiceManager::CheckRestrictedConnectionsL( TUint aServiceId )
  1025 void CScpServiceManager::CheckRestrictedConnectionsL( TUint aServiceId )
  1024     {
  1026     {
  1025     if ( !iSettingHandler->IsVoIPOverWcdmaAllowedL( aServiceId ) )
  1027     TBool sipConnectionCreated( EFalse );
  1026         {
  1028     CScpSipConnection* sipConnection = GetSipConnectionL( 
  1027         SCPLOGSTRING( "CScpServiceManager::CheckRestrictedConnectionsL WCDMA not allowed" );
       
  1028         
       
  1029         TBool sipConnectionCreated( EFalse );
       
  1030         CScpSipConnection* sipConnection = GetSipConnectionL( 
       
  1031                                                     aServiceId,
  1029                                                     aServiceId,
  1032                                                     ECCHVoIPSub, 
  1030                                                     ECCHVoIPSub, 
  1033                                                     sipConnectionCreated );
  1031                                                     sipConnectionCreated );
  1034         
  1032         
  1035         if( sipConnectionCreated )
  1033     if( sipConnectionCreated )
  1036             {
  1034         {
  1037             CleanupStack::PushL( sipConnection );
  1035         CleanupStack::PushL( sipConnection );
  1038             }
  1036         }
  1039         
  1037     // Check bearer filttering setting from sip
       
  1038     TUint32 bearerFilttering( 0 );
       
  1039     TInt err = sipConnection->BearerFiltteringSetting( bearerFilttering );
       
  1040         
       
  1041     SCPLOGSTRING2( "CScpServiceManager::CheckAvailableConnectionsL bearerFilttering = %d", bearerFilttering );
       
  1042     
       
  1043     if ( ( KErrNone == err ) && ( KBearerWlanOnly == bearerFilttering ) )
       
  1044         {
       
  1045         SCPLOGSTRING( "CScpServiceManager::CheckAvailableConnectionsL WLAN only" );
  1040         TUint32 snapId( KErrNone );
  1046         TUint32 snapId( KErrNone );
  1041         sipConnection->GetSnap( snapId );
  1047         sipConnection->GetSnap( snapId );
  1042         
  1048         
  1043         RArray<TInt> iaps;
  1049         RArray<TInt> iaps;
  1044         CleanupClosePushL( iaps );
  1050         CleanupClosePushL( iaps );
  1087         
  1093         
  1088         CleanupStack::PopAndDestroy( &destination ); 
  1094         CleanupStack::PopAndDestroy( &destination ); 
  1089         CleanupStack::PopAndDestroy( &cmm );
  1095         CleanupStack::PopAndDestroy( &cmm );
  1090         CleanupStack::PopAndDestroy( &iaps );
  1096         CleanupStack::PopAndDestroy( &iaps );
  1091         
  1097         
  1092         if( sipConnectionCreated )
  1098         
  1093             {
       
  1094             CleanupStack::PopAndDestroy( sipConnection );
       
  1095             }
       
  1096         
  1099         
  1097         if ( !available && wlanIapFound )
  1100         if ( !available && wlanIapFound )
  1098             {
  1101             {
  1099             User::Leave( KCCHErrorNetworkLost );
  1102             User::Leave( KCCHErrorNetworkLost );
  1100             }
  1103             }
  1101         
  1104         
  1102         else if( !wlanIapFound )
  1105         else if( !wlanIapFound )
  1103             {
  1106             {
  1104             User::Leave( KCCHErrorAccessPointNotDefined );
  1107             User::Leave( KCCHErrorAccessPointNotDefined );
  1105             }
  1108             }
       
  1109         } 
       
  1110     
       
  1111     if( sipConnectionCreated )
       
  1112         {
       
  1113         CleanupStack::PopAndDestroy( sipConnection );
  1106         }
  1114         }
  1107     }
  1115     }
  1108     
  1116     
  1109 // End of file
  1117 // End of file