voipplugins/sipconnectionprovider/src/scpsipconnection.cpp
branchRCL_3
changeset 12 876a3df1f464
parent 10 ed1e38b404e5
child 20 65a3ef1d5bd0
--- a/voipplugins/sipconnectionprovider/src/scpsipconnection.cpp	Wed Apr 14 15:49:55 2010 +0300
+++ b/voipplugins/sipconnectionprovider/src/scpsipconnection.cpp	Tue Apr 27 16:28:03 2010 +0300
@@ -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"
@@ -240,6 +240,24 @@
     }
 
 // -----------------------------------------------------------------------------
+// CScpSipConnection::ForceDisable
+// -----------------------------------------------------------------------------
+//
+TInt CScpSipConnection::ForceDisable()
+    {
+    SCPLOGSTRING2( "CScpSipConnection[0x%x]::ForceDisable", this );
+
+    iRegistrationRequestState = EDeregistrationRequested;   
+    CancelEnableTimeoutTimer();
+    
+    delete iSipConnection;
+    iSipConnection = NULL;
+    
+    TInt err = iProfileRegistry.ForceDisable( *iSipProfile );
+    return err;
+    }
+
+// -----------------------------------------------------------------------------
 // CScpSipConnection::DisableAlwaysOnModeL()
 // -----------------------------------------------------------------------------
 //
@@ -604,17 +622,18 @@
             result = KErrNotReady;
             }
         else
-            {
-            HBufC8* tmpUserName = HBufC8::NewLC( aors->MdcaPoint( 0 ).Length() );
-            tmpUserName->Des().Copy( aors->MdcaPoint( 0 ) );
+            {            
+            TBuf8<KUsernameMaxLength> tmpUserName;
+            tmpUserName.Copy( aors->MdcaPoint( 0 ) );
+            
             #ifdef _DEBUG
-                TBuf<256> tmpUri;
+                TBuf<KUsernameMaxLength> tmpUri;
                 tmpUri.Copy( aors->MdcaPoint( 0 ) );
                 SCPLOGSTRING2( "CScpSipConnection::GetUsername - use first registered AOR: %S", &tmpUri );
             #endif
-            TInt atPos = tmpUserName->Find( KSCPAt8 );
-            aUsername.Copy( tmpUserName->Left( atPos ) );
-            CleanupStack::PopAndDestroy( tmpUserName );
+                
+            TInt atPos = tmpUserName.Find( KSCPAt8 );
+            aUsername.Copy( tmpUserName.Left( atPos ) );
             }
         }
     SCPLOGSTRING2( "CScpSipConnection::GetUsername - return error: %d", result );