voipplugins/sipconnectionprovider/src/scpsipconnection.cpp
branchRCL_3
changeset 12 876a3df1f464
parent 10 ed1e38b404e5
child 20 65a3ef1d5bd0
equal deleted inserted replaced
11:6134b5029079 12:876a3df1f464
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   234     if ( err == KErrNone )
   234     if ( err == KErrNone )
   235         {
   235         {
   236         err = err1;
   236         err = err1;
   237         }
   237         }
   238 
   238 
       
   239     return err;
       
   240     }
       
   241 
       
   242 // -----------------------------------------------------------------------------
       
   243 // CScpSipConnection::ForceDisable
       
   244 // -----------------------------------------------------------------------------
       
   245 //
       
   246 TInt CScpSipConnection::ForceDisable()
       
   247     {
       
   248     SCPLOGSTRING2( "CScpSipConnection[0x%x]::ForceDisable", this );
       
   249 
       
   250     iRegistrationRequestState = EDeregistrationRequested;   
       
   251     CancelEnableTimeoutTimer();
       
   252     
       
   253     delete iSipConnection;
       
   254     iSipConnection = NULL;
       
   255     
       
   256     TInt err = iProfileRegistry.ForceDisable( *iSipProfile );
   239     return err;
   257     return err;
   240     }
   258     }
   241 
   259 
   242 // -----------------------------------------------------------------------------
   260 // -----------------------------------------------------------------------------
   243 // CScpSipConnection::DisableAlwaysOnModeL()
   261 // CScpSipConnection::DisableAlwaysOnModeL()
   602             {
   620             {
   603             SCPLOGSTRING( "CScpSipConnection::GetUsername - KErrNotReady" );
   621             SCPLOGSTRING( "CScpSipConnection::GetUsername - KErrNotReady" );
   604             result = KErrNotReady;
   622             result = KErrNotReady;
   605             }
   623             }
   606         else
   624         else
   607             {
   625             {            
   608             HBufC8* tmpUserName = HBufC8::NewLC( aors->MdcaPoint( 0 ).Length() );
   626             TBuf8<KUsernameMaxLength> tmpUserName;
   609             tmpUserName->Des().Copy( aors->MdcaPoint( 0 ) );
   627             tmpUserName.Copy( aors->MdcaPoint( 0 ) );
       
   628             
   610             #ifdef _DEBUG
   629             #ifdef _DEBUG
   611                 TBuf<256> tmpUri;
   630                 TBuf<KUsernameMaxLength> tmpUri;
   612                 tmpUri.Copy( aors->MdcaPoint( 0 ) );
   631                 tmpUri.Copy( aors->MdcaPoint( 0 ) );
   613                 SCPLOGSTRING2( "CScpSipConnection::GetUsername - use first registered AOR: %S", &tmpUri );
   632                 SCPLOGSTRING2( "CScpSipConnection::GetUsername - use first registered AOR: %S", &tmpUri );
   614             #endif
   633             #endif
   615             TInt atPos = tmpUserName->Find( KSCPAt8 );
   634                 
   616             aUsername.Copy( tmpUserName->Left( atPos ) );
   635             TInt atPos = tmpUserName.Find( KSCPAt8 );
   617             CleanupStack::PopAndDestroy( tmpUserName );
   636             aUsername.Copy( tmpUserName.Left( atPos ) );
   618             }
   637             }
   619         }
   638         }
   620     SCPLOGSTRING2( "CScpSipConnection::GetUsername - return error: %d", result );
   639     SCPLOGSTRING2( "CScpSipConnection::GetUsername - return error: %d", result );
   621     return result;                
   640     return result;                
   622     }
   641     }