# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1276254083 -10800 # Node ID 740ceea8e153de269e1c3626f8812f04fb3c9026 # Parent 9565022eef4555efdb1d6d1b865a1141e38937ad Revision: 201021 Kit: 2010123 diff -r 9565022eef45 -r 740ceea8e153 package_definition.xml --- a/package_definition.xml Thu May 27 13:13:56 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9565022eef45 -r 740ceea8e153 package_definition_v2.xml --- a/package_definition_v2.xml Thu May 27 13:13:56 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h Thu May 27 13:13:56 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h Fri Jun 11 14:01:23 2010 +0300 @@ -24,10 +24,11 @@ #include #include #include +#include #include "sipapnmanager.h" // CONSTANTS -const TInt KSecondaryApnMaxRetryCount = 100; +const TInt KDBMaxRetryCount = 100; // FORWARD DECLARATIONS class CCommsDatabase; @@ -107,7 +108,7 @@ void WatchConnectionStatusChange(); - void WatchDatabaseStatusChangeL( TUint32 aIapId ); + void WatchDatabaseStatusChangeL(); TBool ApnChangeNeededL( const TDesC8& aApn ); @@ -153,39 +154,39 @@ /// 2nd phase constructor void ConstructL(); + + void BlockCellularDataUsageL(); + + void AllowCellularDataUsage(); + + + /** + * Rollsback db in case of failure + * @param aDb + */ + static void RollBackDBTransaction(TAny* aDb); private: // Data - MSIPApnChangeObserver& iObserver; - - TSipApnMonitoringState iMonitoringState; - - RSocketServ iSocketSrv; - - RConnection iConnection; - - TPckgBuf iConnectionInfo; - - TNifProgressBuf iProgress; - - HBufC8* iApnProposal; - - TUint32 iIapId; - - CCommsDatabase* iCommsDatabase; - - TInt iMonitoringRetryCount; - - HBufC8* iCurrentApn; - - TBool iApnUseSecureAuthProposal; - - TBool iIsFailed; - - TBool iIsFatalFailure; - - HBufC8* iPrimaryApn; - HBufC8* iSecondaryApn; + MSIPApnChangeObserver& iObserver; + TSipApnMonitoringState iMonitoringState; + RSocketServ iSocketSrv; + RConnection iConnection; + TPckgBuf iConnectionInfo; + TNifProgressBuf iProgress; + HBufC8* iApnProposal; + TUint32 iIapId; + CCommsDatabase* iCommsDatabase; + TInt iDBMonitoringRetryCount; + HBufC8* iCurrentApn; + TBool iApnUseSecureAuthProposal; + TBool iIsFailed; + TBool iIsFatalFailure; + HBufC8* iPrimaryApn; + HBufC8* iSecondaryApn; + CRepository* iRepository; + TInt iCurrentUsageStatus; + TBool iCellularDataBlocked; #ifdef CPPUNIT_TEST friend class CSIPApnManagerTest; diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp Thu May 27 13:13:56 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp Fri Jun 11 14:01:23 2010 +0300 @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "sipapnconfigurationhandler.h" #include "SipProfileLog.h" @@ -58,17 +60,15 @@ { PROFILE_DEBUG1( "CSIPApnConfigurationHandler::~CSIPApnConfigurationHandler()" ) - + Cancel(); iConnection.Close(); iSocketSrv.Close(); - delete iApnProposal; delete iCurrentApn; - delete iPrimaryApn; delete iSecondaryApn; - + delete iRepository; delete iCommsDatabase; PROFILE_DEBUG1( @@ -105,7 +105,7 @@ return; } - iMonitoringRetryCount = 0; + iDBMonitoringRetryCount = 0; ChangeApnIfNotInUseL( aAllowAsync ); @@ -285,6 +285,11 @@ PROFILE_DEBUG3( "CSIPApnConfigurationHandler::RunError() err", aError ); + if(iCellularDataBlocked) + { + AllowCellularDataUsage(); + } + if ( aError != KErrNoMemory && aError != KErrNone ) { iObserver.ApnChanged( *iApnProposal, iIapId, aError ); @@ -307,7 +312,8 @@ CActiveScheduler::Add( this ); iIapId = aIapId; iIsFailed = EFalse; - iIsFatalFailure = EFalse; + iIsFatalFailure = EFalse; + iCellularDataBlocked = EFalse; } // ----------------------------------------------------------------------------- @@ -320,7 +326,7 @@ "CSIPApnConfigurationHandler::ConstructL()" ) User::LeaveIfError( iSocketSrv.Connect() ); - + iRepository = CRepository::NewL( KCRUidCmManager ); PROFILE_DEBUG1( "CSIPApnConfigurationHandler::ConstructL() exit" ) } @@ -426,7 +432,7 @@ // CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL // ----------------------------------------------------------------------------- // -void CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL( TUint32 aIapId ) +void CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL() { PROFILE_DEBUG1( "CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL()" ) @@ -436,22 +442,26 @@ if ( !iCommsDatabase ) { PROFILE_DEBUG1( - "CSIPApnConfigurationHandler:: create commsdb" ) + "CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL create commsdb" ) iCommsDatabase = CCommsDatabase::NewL(); } PROFILE_DEBUG1( - "CSIPApnConfigurationHandler:: request notification" ) + "CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL request notification" ) // Start monitoring for db events, there will be lots of them pouring in // as there's no filtering feature. We are interested only in // unlocked events. + + if(iDBMonitoringRetryCount > KDBMaxRetryCount) + { + PROFILE_DEBUG1("CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL max retries reached!" ) + User::Leave( KErrAbort ); + } + User::LeaveIfError( iCommsDatabase->RequestNotification( iStatus ) ); - SetActive(); - - iIapId = aIapId; - + SetMonitoringState( EMonitoringDatabase ); PROFILE_DEBUG1( @@ -542,7 +552,7 @@ __ASSERT_ALWAYS( aAllowAsync, User::Leave( KErrInUse ) ); - WatchDatabaseStatusChangeL( iIapId ); + WatchDatabaseStatusChangeL(); } else { @@ -570,8 +580,12 @@ using namespace CommsDat; - CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() ); + CMDBSession* db = CMDBSession::NewL( KCDVersion1_1 ); CleanupStack::PushL( db ); + + db->OpenTransactionL(); + CleanupStack::PushL(TCleanupItem(RollBackDBTransaction, db)); + // Set attributes so that also protected iaps can be accessed db->SetAttributeMask( ECDHidden | ECDProtectedWrite ); @@ -647,9 +661,19 @@ db->ClearAttributeMask( ECDHidden | ECDProtectedWrite ); CleanupStack::PopAndDestroy( iapRecord ); + + db->CommitTransactionL(); + + CleanupStack::Pop(); //cleanup item + CleanupStack::PopAndDestroy( db ); - SendApnChangedNotificationL( aApn ); + if (iCellularDataBlocked) + { + AllowCellularDataUsage(); + } + + SendApnChangedNotificationL( aApn ); PROFILE_DEBUG1( "CSIPApnConfigurationHandler::ChangeApnL(), exit" ) @@ -701,10 +725,10 @@ void CSIPApnConfigurationHandler::ConnectionMonitoringCompletedL( TInt aError ) { PROFILE_DEBUG3( - "CSIPApnConfigurationHandler:: progress.err", + "CSIPApnConfigurationHandler::ConnectionMonitoringCompletedL progress.err", iProgress().iError ); PROFILE_DEBUG3( - "CSIPApnConfigurationHandler:: progress.stage", + "CSIPApnConfigurationHandler::ConnectionMonitoringCompletedL progress.stage", iProgress().iStage ); if ( !aError ) @@ -748,30 +772,19 @@ { // Changing may be now possible, if not, db notifications or connection // monitoring is re-enabled inside following method + PROFILE_DEBUG1("DatabaseMonitoringCompletedL::DatabaseMonitoringCompletedL BlockCellularDataUsageL" ); + BlockCellularDataUsageL(); apnChanged = ChangeApnIfNotInUseL(); } else { - WatchDatabaseStatusChangeL( iIapId ); + iDBMonitoringRetryCount++; + WatchDatabaseStatusChangeL(); } - // Have some safety limit for monitoring as it's not guaranteed that - // db lock is ever released -> avoid unnecessary battery consumption - if ( !apnChanged ) + if(apnChanged) { - iMonitoringRetryCount++; - PROFILE_DEBUG3( - "DatabaseMonitoringCompletedL:: retrycount", - iMonitoringRetryCount ); - - if ( iMonitoringRetryCount > KSecondaryApnMaxRetryCount ) - { - PROFILE_DEBUG1( - "CSIPApnConfigurationHandler:: max retries reached!" ) - Cancel(); - - User::Leave( KErrAbort ); - } + iDBMonitoringRetryCount = 0; } } @@ -902,4 +915,40 @@ } } +// ----------------------------------------------------------------------------- +// CSIPApnConfigurationHandler::BlockCellularDataUsageL +// ----------------------------------------------------------------------------- +// +void CSIPApnConfigurationHandler::BlockCellularDataUsageL() + { + PROFILE_DEBUG1("DatabaseMonitoringCompletedL::BlockCellularDataUsageL Enter" ); + //Current Usage Status; + iRepository->Get( KCurrentCellularDataUsage, iCurrentUsageStatus ); + iRepository->Set( KCurrentCellularDataUsage, ECmCellularDataUsageDisabled ); + iCellularDataBlocked = ETrue; + PROFILE_DEBUG1("DatabaseMonitoringCompletedL::BlockCellularDataUsageL Exit" ); + } +// ----------------------------------------------------------------------------- +// CSIPApnConfigurationHandler::AllowCellularDataUsage +// ----------------------------------------------------------------------------- +// +void CSIPApnConfigurationHandler::AllowCellularDataUsage() + { + PROFILE_DEBUG1("DatabaseMonitoringCompletedL::AllowCellularDataUsage Enter" ); + iRepository->Set( KCurrentCellularDataUsage, iCurrentUsageStatus ); + iDBMonitoringRetryCount = 0; + iCellularDataBlocked = EFalse; + PROFILE_DEBUG1("DatabaseMonitoringCompletedL::AllowCellularDataUsage Exit" ); + } + +// ----------------------------------------------------------------------------- +// CSIPApnConfigurationHandler::RollBackDBTransaction +// ----------------------------------------------------------------------------- +// +void CSIPApnConfigurationHandler::RollBackDBTransaction(TAny* aDb) + { + CMDBSession* db = static_cast(aDb); + TRAP_IGNORE(db->RollbackTransactionL()); + } + // End of file diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnmanager.cpp --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnmanager.cpp Thu May 27 13:13:56 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnmanager.cpp Fri Jun 11 14:01:23 2010 +0300 @@ -216,7 +216,7 @@ { TBool isIapGPRS(EFalse); using namespace CommsDat; - CMDBSession* db = CMDBSession::NewL( CMDBSession::LatestVersion() ); + CMDBSession* db = CMDBSession::NewL( KCDVersion1_1 ); CleanupStack::PushL( db ); // Set any attributes if any db->SetAttributeMask( ECDHidden ); diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationmonitor.h --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationmonitor.h Thu May 27 13:13:56 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2009 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" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Name : sipphoneregistrationmonitor.h -* Part of : SIP Profile Agent / SIP IMS Agent -* Version : %version: 2 % -* -*/ - - - - -/** - @internalComponent -*/ - -#ifndef CSIPPHONEREGISTRATIONMONITOR_H -#define CSIPPHONEREGISTRATIONMONITOR_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MSipPhoneRegistrationObserver; - -// CLASS DEFINITION -/** - * Monitors the status of the phone's network registration. - * Notifies when the status changes. - */ -class CSipPhoneRegistrationMonitor : public CActive - { - public: - - /** Phone registration status */ - enum TStatus - { - ENotRegistered, - ERegisteredOnHomeNetwork, - ERegisteredRoaming - }; - - static CSipPhoneRegistrationMonitor* NewL( - RTelServer& aTelServer, - const RTelServer::TPhoneInfo& aPhoneInfo, - MSipPhoneRegistrationObserver& aObserver ); - - ~CSipPhoneRegistrationMonitor(); - - public: // New methods - - TStatus Status() const; - - protected: // From CActive - - void DoCancel(); - void RunL(); - TInt RunError(TInt aError); - - private: // Constructors - - /// Constructor - CSipPhoneRegistrationMonitor( - MSipPhoneRegistrationObserver& aObserver ); - - /// Default constructor, not implemented. - CSipPhoneRegistrationMonitor(); - - /// 2nd phase constructor - void ConstructL( - RTelServer& aTelServer, - const RTelServer::TPhoneInfo& aPhoneInfo ); - - void MonitorStatus(); - - private: // Data - - MSipPhoneRegistrationObserver& iObserver; - RMobilePhone iPhone; - RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus; - - -#ifdef CPPUNIT_TEST - friend class CSIPIMSProfileAgentTest; -#endif - }; - -#endif // CSIPPHONEREGISTRATIONMONITOR_H diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationobserver.h --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationobserver.h Thu May 27 13:13:56 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2009 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" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* Name : sipphoneregistrationobserver.h -* Part of : SIP Profile Agent / SIP IMS Agent -* Version : %version: 2 % -* -*/ - - - - -/** - @internalComponent -*/ - -#ifndef MSIPPHONEREGISTRATIONOBSERVER_H -#define MSIPPHONEREGISTRATIONOBSERVER_H - -// INCLUDES -#include - -// CLASS DECLARATION -/** -* MSipPhoneRegistrationObserver defines an internal interface for observing -* phone's network registration status. -*/ -class MSipPhoneRegistrationObserver - { - public: // Abstract methods - - /** - * Called when the phone's network registration status changes. - */ - virtual void PhoneRegistrationStatusChangedL() = 0; - - /** - * Called when there is a fatal failure when monitoring - * the phone's network registration status. - * The user should delete the monitor. - * @param aError the failure reason - */ - virtual void PhoneRegistrationStatusError( TInt aError ) = 0; - }; - -#endif // MSIPPHONEREGISTRATIONOBSERVER_H diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/sipphoneregistrationmonitor.cpp --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/sipphoneregistrationmonitor.cpp Thu May 27 13:13:56 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -// Copyright (c) 2009 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" -// which accompanies this distribution, and is available -// at the URL "http://www.eclipse.org/legal/epl-v10.html". -// -// Initial Contributors: -// Nokia Corporation - initial contribution. -// -// Contributors: -// -// Description: -// Name : sipphoneregistrationmonitor.cpp -// Part of : SIP Profile Agent / IMS Agent -// Version : %version: 2 % -// - - -#include "sipphoneregistrationmonitor.h" -#include "sipphoneregistrationobserver.h" - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::NewL -// ----------------------------------------------------------------------------- -// -CSipPhoneRegistrationMonitor* CSipPhoneRegistrationMonitor::NewL( - RTelServer& aTelServer, - const RTelServer::TPhoneInfo& aPhoneInfo, - MSipPhoneRegistrationObserver& aObserver ) - { - CSipPhoneRegistrationMonitor* self - = new( ELeave ) CSipPhoneRegistrationMonitor( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL( aTelServer, aPhoneInfo ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::CSipPhoneRegistrationMonitor -// ----------------------------------------------------------------------------- -// -CSipPhoneRegistrationMonitor::CSipPhoneRegistrationMonitor( - MSipPhoneRegistrationObserver& aObserver ) - : CActive( CActive::EPriorityStandard ), - iObserver( aObserver ), - iRegistrationStatus( RMobilePhone::ERegistrationUnknown ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::ConstructL -// ----------------------------------------------------------------------------- -// -#ifdef __WINSCW__ - -void CSipPhoneRegistrationMonitor::ConstructL( - RTelServer& /*aTelServer*/, - const RTelServer::TPhoneInfo& /*aPhoneInfo*/ ) - { - iRegistrationStatus = RMobilePhone::ERegisteredOnHomeNetwork; - } - -#else - -void CSipPhoneRegistrationMonitor::ConstructL( - RTelServer& aTelServer, - const RTelServer::TPhoneInfo& aPhoneInfo ) - { - - User::LeaveIfError( iPhone.Open( aTelServer, aPhoneInfo.iName ) ); - - // Get current status - TRequestStatus status; - iPhone.GetNetworkRegistrationStatus( status, iRegistrationStatus ); - User::WaitForRequest( status ); - User::LeaveIfError( status.Int() ); - - // Start to monitor the status - MonitorStatus(); - } - -#endif - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::~CSipPhoneRegistrationMonitor -// ----------------------------------------------------------------------------- -// -CSipPhoneRegistrationMonitor::~CSipPhoneRegistrationMonitor() - { - Cancel(); - iPhone.Close(); - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::Status -// ----------------------------------------------------------------------------- -// -CSipPhoneRegistrationMonitor::TStatus -CSipPhoneRegistrationMonitor::Status() const - { - TStatus status = ENotRegistered; - switch ( iRegistrationStatus ) - { - case RMobilePhone::ERegisteredOnHomeNetwork: - status = ERegisteredOnHomeNetwork; - break; - case RMobilePhone::ERegisteredRoaming: - status = ERegisteredRoaming; - break; - default: - break; - } - return status; - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::DoCancel -// ----------------------------------------------------------------------------- -// -void CSipPhoneRegistrationMonitor::DoCancel() - { - iPhone.CancelAsyncRequest( - EMobilePhoneNotifyNetworkRegistrationStatusChange ); - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::RunL -// ----------------------------------------------------------------------------- -// -void CSipPhoneRegistrationMonitor::RunL() - { - TInt err = iStatus.Int(); - - if ( err ) - { - iObserver.PhoneRegistrationStatusError( err ); - } - else - { - MonitorStatus(); - iObserver.PhoneRegistrationStatusChangedL(); - } - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::RunError -// ----------------------------------------------------------------------------- -// -TInt CSipPhoneRegistrationMonitor::RunError(TInt aError) - { - iObserver.PhoneRegistrationStatusError( aError ); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CSipPhoneRegistrationMonitor::MonitorStatus -// ----------------------------------------------------------------------------- -// -void CSipPhoneRegistrationMonitor::MonitorStatus() - { -#ifndef __WINSCW__ - - // Request further notification from ETel - iPhone.NotifyNetworkRegistrationStatusChange( iStatus, - iRegistrationStatus ); - SetActive(); - -#endif - } diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h --- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h Thu May 27 13:13:56 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h Fri Jun 11 14:01:23 2010 +0300 @@ -14,7 +14,7 @@ * Description: * Name : sipprflderegisterrequestedstate.h * Part of : sip profile fsm -* Version : %version: 2.1.1 % +* Version : %version: 2.1.2 % * */ @@ -72,6 +72,13 @@ CSIPConcreteProfile::TStatus ConcreteProfileState() const; + /* DeRegister requested + * update on multiple profile issue, when update on the previous profile is pending. + * 07 May 2010 + * */ + void DeregisterL( + MSIPProfileContext& aContext); + /** * Moves back the profile to "Registered" state * @param aContext a profile context diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp --- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp Thu May 27 13:13:56 2010 +0300 +++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp Fri Jun 11 14:01:23 2010 +0300 @@ -14,7 +14,7 @@ // Name : sipprflderegisterrequestedstate.cpp // Part of : sip profile fsm // implementation -// Version : %version: 2.1.1 % +// Version : %version: 2.1.2 % // @@ -98,6 +98,41 @@ } // ----------------------------------------------------------------------------- +// CSIPPrflDeregisterRequestedState::DeregisterL() +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void CSIPPrflDeregisterRequestedState::DeregisterL( + MSIPProfileContext& aContext) + { + __ASSERT_DEBUG(aContext.Profile()!=0, User::Invariant()); + __ASSERT_DEBUG(aContext.Registration()!=0, User::Invariant()); + if (aContext.Connection().State()==CSIPConnection::EActive) + { + if (iUser.AddProfileIntoQueue(*aContext.Profile())) //compares the registrar of the present profile with the other profiles existing in the connection context array. + { + iUser.DeregisterProfileL(*aContext.Profile()); + + } + else + { + CSIPMessageElements* elements = + aContext.CreateDeRegisterElementsL(); + CleanupStack::PushL(elements); + CSIPClientTransaction* tx = + aContext.Registration()->DeregisterL(elements); + CleanupStack::Pop(elements); + aContext.SetTransaction(tx); + aContext.SetNextState(*iDeregistrationInProgressState); + } + } + aContext.AgentObserver().SIPProfileStatusEvent( + *aContext.Profile(), + aContext.Registration()->ContextId()); + } + + +// ----------------------------------------------------------------------------- // CSIPPrflDeregisterRequestedState::ErrorOccured() // This can happen if the de-register was reguested while the connection is // suspended (registered->de-register requested). SIP stack has removed diff -r 9565022eef45 -r 740ceea8e153 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Thu May 27 13:13:56 2010 +0300 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Fri Jun 11 14:01:23 2010 +0300 @@ -1459,11 +1459,23 @@ if ( Protocol() == KProtocolTls ) { RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS ); - // SIP-URI with transport=TLS must not use sips scheme - uri.SIPURI()->SetSIPS( transportParam != tls ); + // SIP Scheme in Contact header should be same as From Header + CURIContainer& FromUri = (((aMessage->From())->SIPAddress()).URI()); + if(FromUri.IsSIPURI()) + { + CSIPURI* FromSIPUri =FromUri.SIPURI(); + if(FromSIPUri->IsSIPSURI()) + { + uri.SIPURI()->SetSIPS( ETrue ); + } + else + { + uri.SIPURI()->SetSIPS( EFalse ); + } + } if(transportParam == tls) { - uri.SIPURI()->SetSIPS(EFalse); + //uri.SIPURI()->SetSIPS(EFalse); //Delete the param transport=tls from the URI as it is deprecated in RFC 3261 uri.SIPURI()->DeleteParam(SIPStrings::StringF( SipStrConsts::ETransport )); }