# HG changeset patch # User William Roberts # Date 1279813040 -3600 # Node ID f91588750b61ea4ebecf693069bd04ccab7b30ec # Parent 0cae6035b26634ee9b205ab05264c926e63ab345# Parent a858c2cf6a45d56ccfab11fa26a8252348868705 Catchup to latest Symbian^4 diff -r 0cae6035b266 -r f91588750b61 group/bld.inf --- a/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -20,6 +20,7 @@ #include "../ipappprotocols_plat/group/bld.inf" #include "../rtp/group/bld.inf" +#include "../realtimenetprots/rtp/group/bld.inf" #include "../realtimenetprots/sipfw/Group/bld.inf" #include "../sipplugins/group/bld.inf" diff -r 0cae6035b266 -r f91588750b61 package_definition.xml --- a/package_definition.xml Thu Jun 17 22:31:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 0cae6035b266 -r f91588750b61 package_definition_v2.xml --- a/package_definition_v2.xml Thu Jun 17 22:31:40 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/cfrtp/group/bld.inf --- a/realtimenetprots/rtp/cfrtp/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/cfrtp/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -27,7 +27,7 @@ ../inc/rtp_proto_id.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(rtp_proto_id.h) #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY ../inc/rtp_subconparams.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(rtp_subconparams.h) -./cfrtp.iby /epoc32/rom/include/cfrtp.iby +./cfrtp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cfrtp.iby) PRJ_MMPFILES cfrtp.mmp diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/cfrtp/src/rtpflowfactory.cpp --- a/realtimenetprots/rtp/cfrtp/src/rtpflowfactory.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/cfrtp/src/rtpflowfactory.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -96,7 +96,7 @@ protocolDescription->iServiceInfo = KSIConnectionLess | KSIDatagram | KSIGracefulClose | KSIPeekData | KSIRequiresOwnerInfo; - protocolDescription->iNamingServices = KNSNameResolution | KNSRequiresConnectionStartup; + protocolDescription->iNamingServices = 0; protocolDescription->iSecurity = KSocketNoSecurity; protocolDescription->iMessageSize = 65536-128; /*KSocketMessageSizeUndefined;*/ protocolDescription->iServiceTypeInfo = ESocketSupport | ETransport | @@ -116,7 +116,7 @@ protocolDescription->iServiceInfo = KSIConnectionLess | KSIDatagram | KSIGracefulClose | KSIPeekData | KSIRequiresOwnerInfo; - protocolDescription->iNamingServices = KNSNameResolution | KNSRequiresConnectionStartup; + protocolDescription->iNamingServices = 0; protocolDescription->iSecurity = KSocketNoSecurity; protocolDescription->iMessageSize = 65536-128; /*KSocketMessageSizeUndefined;*/ protocolDescription->iServiceTypeInfo = ESocketSupport | ETransport | diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/group/bld.inf --- a/realtimenetprots/rtp/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -25,10 +25,10 @@ PRJ_EXPORTS -./rtp.iby /epoc32/rom/include/rtp.iby +./rtp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(rtp.iby) PRJ_TESTEXPORTS -./te_rtp.iby /epoc32/rom/include/te_rtp.iby +./te_rtp.iby /epoc32/rom/include/te_rtp.iby ./rtptest.xml z:/testdata/configs/rtp/rtptest.xml diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/rtpcore/group/bld.inf --- a/realtimenetprots/rtp/rtpcore/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/rtpcore/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -19,7 +19,7 @@ */ PRJ_EXPORTS -./rtpcore.iby /epoc32/rom/include/rtpcore.iby +./rtpcore.iby CORE_MW_LAYER_IBY_EXPORT_PATH(rtpcore.iby) PRJ_MMPFILES rtpcore.mmp diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/shimrtp/eabi/rtpmu.def --- a/realtimenetprots/rtp/shimrtp/eabi/rtpmu.def Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/shimrtp/eabi/rtpmu.def Thu Jul 22 16:37:20 2010 +0100 @@ -116,4 +116,5 @@ _ZN20RRtpSession_Internal36SetPrePostProcessingRegisterCallbackEP26MPrePostProcessingCallback @ 115 NONAME _ZN20RRtpSession_Internal5OpenLER11RSocketServR9TSockAddrS3_iR14RSubConnectioniRK6TDesC8 @ 116 NONAME _ZN14RRtpSendPacket5CloseEv @ 117 NONAME + _ZNK11RRtcpRRItem10SenderSSRCEv @ 118 NONAME diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/shimrtp/group/bld.inf --- a/realtimenetprots/rtp/shimrtp/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/shimrtp/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -21,7 +21,7 @@ PRJ_EXPORTS -./shimrtp.iby /epoc32/rom/include/shimrtp.iby +./shimrtp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(shimrtp.iby) ../inc/rtp.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(rtp.h) #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS ../inc/rtpsession_internal.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(rtpsession_internal.h) diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/shimrtp/src/rtp/rtcp.cpp --- a/realtimenetprots/rtp/shimrtp/src/rtp/rtcp.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/shimrtp/src/rtp/rtcp.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -70,6 +70,12 @@ return iPtr->dlsr; } +EXPORT_C TUint RRtcpRRItem::SenderSSRC() const + { + __RTP_LOG(_L("RRtcpSRItem::SenderSSRC() ... ")); + return AboutSSRC(); + } + /******/ EXPORT_C RRtcpRRPart::RRtcpRRPart(TRtcpRRPart& aRR) :iRRPart(aRR) diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/rtp/shimrtp/src/stubs/rtcp_stub.cpp --- a/realtimenetprots/rtp/shimrtp/src/stubs/rtcp_stub.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/rtp/shimrtp/src/stubs/rtcp_stub.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -70,6 +70,11 @@ return 0; } +EXPORT_C TUint RRtcpRRItem::SenderSSRC() const + { + ASSERT(0); + return 0; + } /******/ EXPORT_C RRtcpRRPart::RRtcpRRPart(TRtcpRRPart& aRR) :iRRPart(aRR) diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/Data/101F413C.txt Binary file realtimenetprots/sipfw/Data/101F413C.txt has changed diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/Data/101f413c.cre Binary file realtimenetprots/sipfw/Data/101f413c.cre has changed diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/Group/bld.inf --- a/realtimenetprots/sipfw/Group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/Group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -35,8 +35,6 @@ ../Data/101F413C.txt z:/private/10202be9/101f413c.txt // ProfileAgent's cenrep configuration file for expiry duration ../Data/2001F889.txt z:/private/10202be9/2001f889.txt -// ProfileAgent's default cre file -../Data/101f413c.cre z:/private/10202be9/101f413c.cre // ConfML files ../conf/sipframework.confml MW_LAYER_EXPORTS_CONFML(sipframework.confml) @@ -46,8 +44,8 @@ ../conf/sipframework_2001f889.crml MW_LAYER_EXPORTS_CRML(sipframework_2001f889.crml) // SIP iby-files -../rom/sipsw.iby /epoc32/rom/include/sipsw.iby -../rom/siph2lanbearermonitor.iby /epoc32/rom/include/siph2lanbearermonitor.iby +../rom/sipsw.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sipsw.iby) +../rom/siph2lanbearermonitor.iby CORE_MW_LAYER_IBY_EXPORT_PATH(siph2lanbearermonitor.iby) // SDP Codec API ../SDP/api/SdpAttributeField.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(sdpattributefield.h) diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h Thu Jul 22 16:37:20 2010 +0100 @@ -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 ); @@ -139,10 +140,8 @@ /** * Reads the APN of specified IAP. - * @param aIapId IAP id - * @return APN or NULL if not found. Ownership is transferred. */ - HBufC8* ReadCurrentApnL(); + void ReadCurrentApnL(); private: // Constructors @@ -153,39 +152,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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -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 ); @@ -126,7 +126,7 @@ // CSIPApnConfigurationHandler::ReadCurrentApnL // ----------------------------------------------------------------------------- // -HBufC8* CSIPApnConfigurationHandler::ReadCurrentApnL() +void CSIPApnConfigurationHandler::ReadCurrentApnL() { HBufC8* apn(NULL); @@ -193,15 +193,13 @@ delete iCurrentApn; iCurrentApn = NULL; - iCurrentApn = apn->AllocL(); + iCurrentApn = apn; } db->ClearAttributeMask( ECDHidden ); CleanupStack::PopAndDestroy( iapRecord ); CleanupStack::PopAndDestroy( db ); - - return apn; } // ----------------------------------------------------------------------------- @@ -285,6 +283,11 @@ PROFILE_DEBUG3( "CSIPApnConfigurationHandler::RunError() err", aError ); + if(iCellularDataBlocked) + { + AllowCellularDataUsage(); + } + if ( aError != KErrNoMemory && aError != KErrNone ) { iObserver.ApnChanged( *iApnProposal, iIapId, aError ); @@ -307,7 +310,8 @@ CActiveScheduler::Add( this ); iIapId = aIapId; iIsFailed = EFalse; - iIsFatalFailure = EFalse; + iIsFatalFailure = EFalse; + iCellularDataBlocked = EFalse; } // ----------------------------------------------------------------------------- @@ -320,7 +324,8 @@ "CSIPApnConfigurationHandler::ConstructL()" ) User::LeaveIfError( iSocketSrv.Connect() ); - + iRepository = CRepository::NewL( KCRUidCmManager ); + ReadCurrentApnL(); PROFILE_DEBUG1( "CSIPApnConfigurationHandler::ConstructL() exit" ) } @@ -426,7 +431,7 @@ // CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL // ----------------------------------------------------------------------------- // -void CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL( TUint32 aIapId ) +void CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL() { PROFILE_DEBUG1( "CSIPApnConfigurationHandler::WatchDatabaseStatusChangeL()" ) @@ -436,22 +441,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( @@ -468,16 +477,12 @@ "CSIPApnConfigurationHandler::ApnChangeNeededL()" ) TBool apnChangeNeeded( EFalse ); - HBufC8* currentApn = ReadCurrentApnL(); - - if ( currentApn && currentApn->Compare( aApn ) != 0 ) + if ( iCurrentApn && iCurrentApn->Compare( aApn ) != 0 ) { // Apn is not the same as wanted apnChangeNeeded = ETrue; } - delete currentApn; - PROFILE_DEBUG3( "CSIPApnConfigurationHandler::ApnChangeNeededL(), apnChangeNeeded", apnChangeNeeded ) @@ -542,7 +547,7 @@ __ASSERT_ALWAYS( aAllowAsync, User::Leave( KErrInUse ) ); - WatchDatabaseStatusChangeL( iIapId ); + WatchDatabaseStatusChangeL(); } else { @@ -570,8 +575,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 +656,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 +720,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 +767,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; } } @@ -783,13 +791,12 @@ const TDesC8& aNewApn, TInt aError ) { - if ( !IsPrimaryApnUsed() ) + HBufC8* currentApn = aNewApn.AllocL(); + delete iCurrentApn; + iCurrentApn = NULL; + iCurrentApn = currentApn; + if ( IsPrimaryApnUsed() ) { - HBufC8* currentApn = aNewApn.AllocL(); - delete iCurrentApn; - iCurrentApn = NULL; - iCurrentApn = currentApn; - iObserver.ApnChanged( *iCurrentApn, iIapId, aError ); } } @@ -902,4 +909,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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnmanager.cpp --- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnmanager.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnmanager.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Group/sipietfagent.mmp --- a/realtimenetprots/sipfw/ProfileAgent/Group/sipietfagent.mmp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipietfagent.mmp Thu Jul 22 16:37:20 2010 +0100 @@ -60,6 +60,6 @@ VENDORID 0x70000001 -CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData +CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl SMPSAFE diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Group/sipimsagent.mmp --- a/realtimenetprots/sipfw/ProfileAgent/Group/sipimsagent.mmp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipimsagent.mmp Thu Jul 22 16:37:20 2010 +0100 @@ -83,9 +83,10 @@ LIBRARY commsdat.lib LIBRARY flogger.lib LIBRARY efsrv.lib +LIBRARY satclient.lib VENDORID 0x70000001 -CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData +CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl SMPSAFE diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Group/sipprofilefsm.mmp --- a/realtimenetprots/sipfw/ProfileAgent/Group/sipprofilefsm.mmp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipprofilefsm.mmp Thu Jul 22 16:37:20 2010 +0100 @@ -58,6 +58,6 @@ VENDORID 0x70000001 -CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData +CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl SMPSAFE diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Group/sipprofileserver.mmp --- a/realtimenetprots/sipfw/ProfileAgent/Group/sipprofileserver.mmp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipprofileserver.mmp Thu Jul 22 16:37:20 2010 +0100 @@ -97,7 +97,7 @@ VENDORID 0x70000001 -CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData +CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl // MACRO PLAT_SEC_TEST diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Group/sipproxyrsv.mmp --- a/realtimenetprots/sipfw/ProfileAgent/Group/sipproxyrsv.mmp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Group/sipproxyrsv.mmp Thu Jul 22 16:37:20 2010 +0100 @@ -43,6 +43,6 @@ VENDORID 0x70000001 -CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData +CAPABILITY ProtServ NetworkServices ReadDeviceData WriteDeviceData NetworkControl SMPSAFE diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/IETF_Agent/src/Sipietfprofilecontext.cpp --- a/realtimenetprots/sipfw/ProfileAgent/IETF_Agent/src/Sipietfprofilecontext.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/IETF_Agent/src/Sipietfprofilecontext.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -494,11 +494,11 @@ return (aError == K503ServiceUnavailable || aError == K408TimeOut || aError == K500ServerInternalError || - aError == KErrSIPOutboundProxyNotResponding || aError == KErrTimedOut || ((aError == KErrSIPResolvingFailure || aError == KErrSIPTransportFailure || - aError == KErrSIPICMPFailure) && + aError == KErrSIPICMPFailure || + aError == KErrSIPOutboundProxyNotResponding ) && iConnection.State() != CSIPConnection::ESuspended)); } diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationmonitor.h --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationmonitor.h Thu Jun 17 22:31:40 2010 +0100 +++ /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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationobserver.h --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Inc/sipphoneregistrationobserver.h Thu Jun 17 22:31:40 2010 +0100 +++ /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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/Sipimsprofilecontext.cpp --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/Sipimsprofilecontext.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/Sipimsprofilecontext.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -785,12 +785,12 @@ aError == K408TimeOut || aError == K480TemporarilyUnavailable || aError == K500ServerInternalError || - aError == K504ServerTimeOut || - aError == KErrSIPOutboundProxyNotResponding || + aError == K504ServerTimeOut || aError == KErrTimedOut || ((aError == KErrSIPResolvingFailure || aError == KErrSIPTransportFailure || - aError == KErrSIPICMPFailure) && + aError == KErrSIPICMPFailure || + aError == KErrSIPOutboundProxyNotResponding ) && iConnection.State() != CSIPConnection::ESuspended)); } diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/sipphoneregistrationmonitor.cpp --- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/sipphoneregistrationmonitor.cpp Thu Jun 17 22:31:40 2010 +0100 +++ /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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileCacheItem.h --- a/realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileCacheItem.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileCacheItem.h Thu Jul 22 16:37:20 2010 +0100 @@ -290,6 +290,18 @@ */ TBool IsShutdownInitiated() const; + /** + * System is about to go in Offline Mode + */ + void OfflineInitiated(TBool aOfflineInitiated); + + /** + * Tells if system is about to be Offline. + * @return ETrue if system Offline has been initiated + * EFalse otherwise + */ + TBool IsOfflineInitiated() const; + /** * System is about to be shut down. */ @@ -554,11 +566,7 @@ * @param aStatus Status of the profile */ void HandleProfileError(TInt aError, - CSIPConcreteProfile& aProfile); - /** - * Function resets the boolean variable iIsShutdownInitiated - */ - void ResetShutdownvariable(); + CSIPConcreteProfile& aProfile); private: @@ -647,6 +655,9 @@ // ETrue if system shutdown has been initiated TBool iIsShutdownInitiated; + //ETrue if system offline has been initiated + TBool iIsOfflineInitiated; + // ETrue if Rfs has been initiated TBool iIsRfsInprogress; diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileServerCore.h --- a/realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileServerCore.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Server/Inc/SipProfileServerCore.h Thu Jul 22 16:37:20 2010 +0100 @@ -493,7 +493,7 @@ *Starts timer of type CDeltaTimer, *which callback is ConnectionCloseTimerExpired function */ - void StartConnectionCloseTimer(); + void StartConnectionCloseTimer(TInt aValue); /** * A callback for CDeltaTimer @@ -770,9 +770,23 @@ */ TBool CheckIapSettings(TUint32 aProfileId); + /** + * Issues the change of APN to PrimaryAPN + */ void UsePrimaryApn(TUint32 aIapId); - + + /** + * Issues the change of APN to SecondaryAPN + */ void UseBackupApn( TUint32 aIapId, TBool aFatalFailure = ETrue ); + + /** + * Compares the two plugin typr info + * @returns ETrue if the match completely + * EFalse otherwise + */ + static TBool Compare(const TSIPProfileTypeInfo& first, + const TSIPProfileTypeInfo& second); private: // Data @@ -821,8 +835,6 @@ //ApnManager CSIPApnManager* iApnManager; // iBackupApnSettings; RArray iWaitForApnSettings; - - TBool iOfflineEventReceived; TBool iFeatMgrInitialized; diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp --- a/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -87,6 +87,7 @@ iIsVpnInUse = EFalse; iInitialApnSelected = EFalse; iApnSwitchEnabled = EFalse; + iIsOfflineInitiated = EFalse; iDeltaTimerEntry.Set(iDeltaTimerCallBack); } @@ -570,6 +571,7 @@ void CSIPProfileCacheItem::VpnInUse(TBool aStatus) { iIsVpnInUse = aStatus; + iCurrentState->ShutdownInitiated(*this); } // ----------------------------------------------------------------------------- @@ -1357,14 +1359,6 @@ iServerCore.SendErrorEvent( *this, CSIPConcreteProfile::ERegistrationInProgress, KErrCancel ); } -// ----------------------------------------------------------------------------- -// CSIPProfileCacheItem::ResetShutdownvariable -// ----------------------------------------------------------------------------- -// -void CSIPProfileCacheItem::ResetShutdownvariable() - { - iIsShutdownInitiated = EFalse; - } // ----------------------------------------------------------------------------- // CSIPProfileCacheItem::DefaultSNAPL @@ -1384,3 +1378,28 @@ PROFILE_DEBUG3("CSIPProfileCacheItem::DefaultSNAPL with Value: ", aSnapId) CleanupStack::PopAndDestroy(); } + +// ----------------------------------------------------------------------------- +// CSIPProfileCacheItem::OfflineInitiated +// ----------------------------------------------------------------------------- +// +void CSIPProfileCacheItem::OfflineInitiated(TBool aOfflineInitiated) + { + if(aOfflineInitiated) + { + iIsOfflineInitiated = ETrue; + iCurrentState->ShutdownInitiated(*this); + } + else + iIsOfflineInitiated = EFalse; + } + +// ----------------------------------------------------------------------------- +// CSIPProfileCacheItem::IsOfflineInitiated +// ----------------------------------------------------------------------------- +// +TBool CSIPProfileCacheItem::IsOfflineInitiated() const + { + return iIsOfflineInitiated; + } + diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp --- a/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileServerCore.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -57,6 +57,7 @@ const TInt KMicroSecInSec = 1000000; const TInt KIdleTimer = 2; +const TInt KOfflineTimer = 5; // ============================ MEMBER FUNCTIONS =============================== @@ -171,8 +172,6 @@ iNotify = CSIPProfileStorageSecureBackup::NewL(this); iServer = CSIPProfileCSServer::NewL(*this); - - iOfflineEventReceived = EFalse; PROFILE_DEBUG1("ProfileServer started") } @@ -243,6 +242,15 @@ TUint32 aContextId) { CSIPProfileCacheItem* item = ProfileCacheItem(aProfile.Id()); + + if(aContextId == 0 && item) + { + if(item->IsApnSwitchEnabled()) + { + UsePrimaryApn(aProfile.IapId()); + } + } + TRAPD(err, SIPProfileStatusEventL(aProfile.Id(), aContextId)); if (err != KErrNone) @@ -291,8 +299,11 @@ } } + + //For Profiles which were in RegInProgress and has moved to Registered State, + //needs to be deregistered if Offline or RFs or Vpn if in Use has been triggered. TBool eventCompleted = EFalse; - if(item && (item->IsRfsInprogress() || iOfflineEventReceived || + if(item && (item->IsRfsInprogress() || item->IsOfflineInitiated() || (FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn )&& item->IsVpnInUse()))) { @@ -305,25 +316,49 @@ { count--; } - else if (status == CSIPConcreteProfile::ERegistered ) + else if (status == CSIPConcreteProfile::ERegistered) { - iProfileCache[i]->ShutdownInitiated(); - } - } + if(item->IsOfflineInitiated()) + { + //Don't do anything. If the ProfileStatusEvent = Registered in Offline, it + //will only be for WLAN so don't deregister it. If ProfileStatusEvent = Deregistered + //means application triggered deregistration so ProfileAgent should not attempt registering it. + } + else + { + iProfileCache[i]->ShutdownInitiated(); + } + } //end if unregistered if ( !count ) eventCompleted = ETrue; - } + } //end for + } //end outer if + + if(eventCompleted) { if (item->IsRfsInprogress()) - StartConnectionCloseTimer(); - else if(iOfflineEventReceived) + StartConnectionCloseTimer(KIdleTimer); + else if(item->IsOfflineInitiated() ) ConfirmSystemstateMonitor(CSipSystemStateMonitor::ESystemState); else if((FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn )&& item->IsVpnInUse())) ConfirmSystemstateMonitor(CSipSystemStateMonitor::EVpnState); } - } + + if(FeatureManager::FeatureSupported( KFeatureIdFfSipApnSwitching)) + { + if(item && item->IsApnSwitchEnabled() && aContextId) + { + CSIPConcreteProfile::TStatus status; + iPluginDirector->State( status, item->Profile() ); + if(status == CSIPConcreteProfile::EUnregistered) + { + UseBackupApn(item->Profile().IapId(), EFalse); + } + } + } + } CheckServerStatus(); } @@ -444,50 +479,56 @@ { PROFILE_DEBUG3("CSIPProfileServerCore::SystemVariableUpdated System State changed to value", aValue) - //If the SystemState is Offline, turn the boolean variable to true so that Profile-Server - //can indicate System State monitor that event processing is completed, provided all the - //profiles have got deregistered - if (CSipSystemStateMonitor::ESystemOffline == aValue) - iOfflineEventReceived = ETrue; - - if ( aVariable == CSipSystemStateMonitor::ESystemState && - (aValue == CSipSystemStateMonitor::ESystemShuttingDown || - aValue == CSipSystemStateMonitor::ESystemOffline - )) + if ( aVariable == CSipSystemStateMonitor::ESystemState ) { - TBool waitForDeregistration = EFalse; - for (TInt i = 0; i < iProfileCache.Count(); i++) - { - iProfileCache[i]->ShutdownInitiated(); - CSIPConcreteProfile::TStatus status; - iPluginDirector->State(status, iProfileCache[i]->UsedProfile()); - if(status != CSIPConcreteProfile::EUnregistered) - waitForDeregistration = ETrue; - } - if(!waitForDeregistration) - { - ConfirmSystemstateMonitor(CSipSystemStateMonitor::ESystemState); - } - } - //If the System State is Online, register all the profiles in always on mode - else if(aVariable == CSipSystemStateMonitor::ESystemState && - aValue == CSipSystemStateMonitor::ESystemOnline) - { - iOfflineEventReceived = EFalse; - for (TInt i = 0; i < iProfileCache.Count(); i++) - { - iProfileCache[i]->ResetShutdownvariable(); - CSIPProfileCacheItem* item = iProfileCache[i]; - if (iProfileCache[i]->IsReferred()) - { - TRAPD(err, item->StartRegisterL(*iWaitForIAP, *iRegInProg, ETrue)); - if (err != KErrNone) - { - HandleAsyncError(*item,CSIPConcreteProfile::ERegistrationInProgress,err); - } - } - } - } + // If the System is Shutting down + if(aValue == CSipSystemStateMonitor::ESystemShuttingDown) + { + for (TInt i = 0; i < iProfileCache.Count(); i++) + { + iProfileCache[i]->ShutdownInitiated(); + } + } //end if Shutdown + + //If the System receives Offline event + if(aValue == CSipSystemStateMonitor::ESystemOffline) + { + StartConnectionCloseTimer(KOfflineTimer); + TBool waitForDeregistration = EFalse; + for (TInt i = 0; i < iProfileCache.Count(); i++) + { + CSIPConcreteProfile::TStatus status; + iPluginDirector->State(status, iProfileCache[i]->UsedProfile()); + if(status != CSIPConcreteProfile::EUnregistered) + waitForDeregistration = ETrue; + iProfileCache[i]->OfflineInitiated(ETrue); + } + if(!waitForDeregistration) + { + ConfirmSystemstateMonitor(CSipSystemStateMonitor::ESystemState); + } + } //end if Offline + + //If the System receives Online event + if(aValue == CSipSystemStateMonitor::ESystemOnline) + { + for (TInt i = 0; i < iProfileCache.Count(); i++) + { + CSIPProfileCacheItem* item = iProfileCache[i]; + item->OfflineInitiated(EFalse); + CSIPConcreteProfile::TStatus status; + iPluginDirector->State(status, item->UsedProfile()); + if (item->IsReferred() && status == CSIPConcreteProfile::EUnregistered) + { + TRAPD(err, item->StartRegisterL(*iWaitForIAP, *iRegInProg, ETrue)); + if (err != KErrNone) + { + HandleAsyncError(*item,CSIPConcreteProfile::ERegistrationInProgress,err); + } + } + } + } //end if Online + } //end if SystemState else if(aVariable == CSipSystemStateMonitor::ERfsState) { if(aValue == CSipSystemStateMonitor::ERfsStarted) @@ -496,11 +537,11 @@ TBool waitForDeregistration = EFalse; for (TInt i = 0; i < iProfileCache.Count(); i++) { - iProfileCache[i]->RfsInprogress(ETrue); CSIPConcreteProfile::TStatus status; iPluginDirector->State(status, iProfileCache[i]->UsedProfile()); if (status != CSIPConcreteProfile::EUnregistered) waitForDeregistration = ETrue; + iProfileCache[i]->RfsInprogress(ETrue); } if(!waitForDeregistration) { @@ -545,12 +586,11 @@ TBool waitForDeregistration = EFalse; for (TInt i = 0; i < iProfileCache.Count(); i++) { - iProfileCache[i]->VpnInUse( ETrue ); - iProfileCache[i]->ShutdownInitiated(); CSIPConcreteProfile::TStatus status; iPluginDirector->State(status, iProfileCache[i]->UsedProfile()); if (status != CSIPConcreteProfile::EUnregistered) waitForDeregistration = ETrue; + iProfileCache[i]->VpnInUse( ETrue ); } if (!waitForDeregistration) { @@ -622,7 +662,12 @@ CImplementationInformation* ecomInfo = infoArray[i]; TSIPProfileTypeInfo info; ConvertTypeInfoL(*ecomInfo, info); - array.AppendL(info); + TIdentityRelation identityRelation(CSIPProfileServerCore::Compare); + TInt alreadyExits = array.Find(info,identityRelation); + if(alreadyExits == KErrNotFound) + { + array.AppendL(info); + } } } CleanupStack::Pop(&infoArray); @@ -1067,7 +1112,15 @@ } } else - User::LeaveIfError(KErrNotSupported); + { + // At this point the registration has failed fatally already and profile will be in + // unregistered state. Since we cann't do any regisrtation related activity and + // not to lose user's updated data we are doing this. + if(item->UsedProfile().Status() == CSIPConcreteProfile::EUnregistered) + { + item->ClearOldProfile(); + } + } } else { @@ -1614,26 +1667,33 @@ CSIPConcreteProfile::TStatus aStatus, TInt aError) { - TInt err(aError); - if (aStatus == CSIPConcreteProfile::EUnregistrationInProgress) + PROFILE_DEBUG3("CSIPProfileServerCore::HandleAsyncError, error", aError) + TBool isFatal(EFalse); + if(aError != KErrSIPApnSwitchNonFatalFailure) { - err = KErrNone; - } + TInt err(aError); + if (aStatus == CSIPConcreteProfile::EUnregistrationInProgress) + { + err = KErrNone; + } - if (HandleProfileError(aItem, err)) - { - if (err == KErrTotalLossOfPrecision) - { - TRAP_IGNORE(SendUnregisteredStatusEventL(aItem)) - } - else - { - SendErrorEvent(aItem, aStatus, aError); - } - } + if (HandleProfileError(aItem, err)) + { + if (err == KErrTotalLossOfPrecision) + { + TRAP_IGNORE(SendUnregisteredStatusEventL(aItem)) + } + else + { + SendErrorEvent(aItem, aStatus, aError); + isFatal = ETrue; + } + } + } + if(aItem.IsApnSwitchEnabled()) { - UseBackupApn(aItem.Profile().IapId(), ETrue); + UseBackupApn(aItem.Profile().IapId(), isFatal); } } @@ -2123,11 +2183,11 @@ // CSIPProfileServerCore::StartConnectionCloseTimer // ----------------------------------------------------------------------------- // -void CSIPProfileServerCore::StartConnectionCloseTimer() +void CSIPProfileServerCore::StartConnectionCloseTimer(TInt aValue) { PROFILE_DEBUG1("CSIPProfileServerCore::StartConnectionCloseTimer") iDeltaTimer->Remove(iDeltaTimerEntry); - TTimeIntervalMicroSeconds32 interval(KMicroSecInSec * KIdleTimer); + TTimeIntervalMicroSeconds32 interval(KMicroSecInSec * aValue); iDeltaTimer->Queue(interval, iDeltaTimerEntry); } @@ -2139,7 +2199,33 @@ { PROFILE_DEBUG1("CSIPProfileServerCore::ConnectionCloseTimerExpired") CSIPProfileServerCore* self = reinterpret_cast(aPtr); - self->ConfirmSystemstateMonitor(CSipSystemStateMonitor::ERfsState); + + TBool IsOffline = self->iProfileCache[0]->IsOfflineInitiated(); + if(IsOffline) + { + self->ConfirmSystemstateMonitor(CSipSystemStateMonitor::ESystemState); + for (TInt i = 0; i < self->iProfileCache.Count(); i++) + { + CSIPProfileCacheItem* item = self->iProfileCache[i]; + CSIPConcreteProfile::TStatus status; + self->iPluginDirector->State( status, self->iProfileCache[i]->UsedProfile() ); + item->OfflineInitiated(EFalse); + if (item->IsReferred() && (!self->iApnManager->IsIapGPRSL(item->Profile().IapId())) + && status == CSIPConcreteProfile::EUnregistered) + { + TRAPD(err, item->StartRegisterL(*(self->iWaitForIAP), *(self->iRegInProg), ETrue)); + if (err != KErrNone) + { + self->HandleAsyncError(*item,CSIPConcreteProfile::ERegistrationInProgress,err); + } + } + else + {} + } //end for + }//end Outer If + else + self->ConfirmSystemstateMonitor(CSipSystemStateMonitor::ERfsState); + return ETrue; } @@ -2149,9 +2235,8 @@ // void CSIPProfileServerCore::ConfirmSystemstateMonitor( CSipSystemStateMonitor::TSystemVariable aVariable) - { - iSystemStateMonitor->EventProcessingCompleted( - aVariable, 0, *this); + { + iSystemStateMonitor->EventProcessingCompleted(aVariable, 0, *this); } // ---------------------------------------------------------------------------- @@ -2344,7 +2429,7 @@ { PROFILE_DEBUG1("CSIPProfileServerCore::UseBackupApn") - if ( iApnManager->IsFailed( aIapId ) || aFatalFailure ) + if ( !iApnManager->IsFailed( aIapId ) || aFatalFailure ) { iApnManager->SetFailed( aIapId, ETrue, aFatalFailure ); } @@ -2353,11 +2438,34 @@ } // ---------------------------------------------------------------------------- +// CSIPProfileServerCore::Compare +// ---------------------------------------------------------------------------- +// +TBool CSIPProfileServerCore::Compare(const TSIPProfileTypeInfo& first, + const TSIPProfileTypeInfo& second) + { + TInt result = first.iSIPProfileName.Compare(second.iSIPProfileName); + return ( 0 == result && first.iSIPProfileClass == second.iSIPProfileClass); + } + +// ---------------------------------------------------------------------------- // CSIPProfileServerCore::IsUpdateAllowed // ---------------------------------------------------------------------------- // TBool CSIPProfileServerCore::IsUpdateAllowed( CSIPConcreteProfile *aProfile ) { - PROFILE_DEBUG1("CSIPIMSProfileAgent::IsUpdateAllowed, enter") - return !(iApnManager->IsFailed(aProfile->IapId())); + PROFILE_DEBUG1("CSIPProfileServerCore::IsUpdateAllowed, enter") + TBool allowed(ETrue); + CSIPProfileCacheItem* item = ProfileCacheItem(aProfile->Id()); + if(item) + { + CSIPConcreteProfile& profile = item->LatestProfile(); + TBool iapIdChange(profile.IapId()!=aProfile->IapId()); + if(iapIdChange && + (iApnManager->IsFailed(aProfile->IapId()) || iApnManager->IsFailed(profile.IapId()))) + { + allowed = EFalse; + } + } + return allowed; } diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileStateUnregistered.cpp --- a/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileStateUnregistered.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileStateUnregistered.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -114,7 +114,7 @@ TBool isVpnInUse = (FeatureManager::FeatureSupported( KFeatureIdFfImsDeregistrationInVpn ) && aItem.IsVpnInUse()); - if ( aItem.IsReferred() && !aItem.IsShutdownInitiated() && + if ( aItem.IsReferred() && !aItem.IsShutdownInitiated() && !aItem.IsOfflineInitiated() && !aItem.IsRfsInprogress() && !isVpnInUse) { aItem.ClearOldProfile(); diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h --- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/inc/sipprflderegisterrequestedstate.h Thu Jul 22 16:37:20 2010 +0100 @@ -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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp --- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflderegisterrequestedstate.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -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 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflregisteredstate.cpp --- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflregisteredstate.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprflregisteredstate.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -14,7 +14,7 @@ // Name : sipprflregisteredstate.cpp // Part of : sip profile fsm // implementation -// Version : %version: 2.1.2 % +// Version : %version: 2.1.3 % // @@ -370,7 +370,8 @@ } else if ((aError == KErrSIPTransportFailure || aError == KErrSIPResolvingFailure || - aError == KErrSIPICMPFailure) && + aError == KErrSIPICMPFailure || + aError == KErrSIPOutboundProxyNotResponding ) && aContext.Connection().State() == CSIPConnection::ESuspended) { //registration was dropped due to the expired diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/sipprflregistrationinprogressstate.cpp --- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/sipprflregistrationinprogressstate.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/sipprflregistrationinprogressstate.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -14,7 +14,7 @@ // Name : sipprflregistrationinprogressstate.cpp // Part of : sip profile fsm // implementation -// Version : %version: 2.1.1 % +// Version : %version: 2.1.2 % // @@ -174,7 +174,8 @@ } else if ((aError == KErrSIPTransportFailure || aError == KErrSIPResolvingFailure || - aError == KErrSIPICMPFailure) && + aError == KErrSIPICMPFailure || + aError == KErrSIPOutboundProxyNotResponding ) && aContext.Connection().State()==CSIPConnection::ESuspended) { //registration failed due to the suspended connection, re-try later diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Codec/src/CSIPAcceptEncodingHeader.cpp --- a/realtimenetprots/sipfw/SIP/Codec/src/CSIPAcceptEncodingHeader.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Codec/src/CSIPAcceptEncodingHeader.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -28,6 +28,7 @@ #include "sipstrconsts.h" #include "sipcodecutils.h" #include "_sipcodecdefs.h" +#include // ---------------------------------------------------------------------------- @@ -161,10 +162,19 @@ { HBufC8* tmp = aCodings.AllocLC(); tmp->Des().Trim(); - if (tmp->Length() > 0 && !SIPSyntaxCheck::Token(*tmp)) + //Allowing '/' token for interoperability issues + RArray array; + if(CFeatureDiscovery::IsFeatureSupportedL(TUid::Uid(KFeatureIdFfSipApnSwitching))) + { + array.Append('/'); + } + + if (tmp->Length() > 0 && !SIPSyntaxCheck::Token(*tmp,&array)) { + array.Close(); User::Leave(KErrSipCodecAcceptEncodingHeader); } + array.Close(); CleanupStack::Pop(tmp); delete iCodings; iCodings = tmp; diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.cpp --- a/realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -20,7 +20,6 @@ #include "SIPSyntaxCheck.h" -#include "TSIPChar.h" #include "sipcodecerr.h" #include @@ -31,8 +30,9 @@ // SIPSyntaxCheck::Token // ----------------------------------------------------------------------------- // -TBool SIPSyntaxCheck::Token (const TDesC8& aValue) +TBool SIPSyntaxCheck::Token (const TDesC8& aValue, RArray* aArray) { + if (aValue.Length() == 0) { return EFalse; @@ -41,7 +41,7 @@ TSIPChar sipChr = lex.Get(); while (sipChr) { - if (!sipChr.IsTokenChar()) + if (!sipChr.IsTokenChar( aArray ) ) { return EFalse; } diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.h --- a/realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Codec/src/SIPSyntaxCheck.h Thu Jul 22 16:37:20 2010 +0100 @@ -31,6 +31,7 @@ #define SIPSYNTAXCHECK_H #include "siphostport.h" +#include "TSIPChar.h" #include @@ -39,7 +40,7 @@ { public: - static TBool Token (const TDesC8& aValue); + static TBool Token (const TDesC8& aValue , RArray* aArray = NULL ); static TBool AlphaMaxSize8 (const TDesC8& aValue); static TBool Host (const TDesC8& aValue); static TBool Word (const TDesC8& aValue); diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Codec/src/TSIPChar.h --- a/realtimenetprots/sipfw/SIP/Codec/src/TSIPChar.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Codec/src/TSIPChar.h Thu Jul 22 16:37:20 2010 +0100 @@ -45,7 +45,7 @@ inline TBool IsReserved() const; inline TBool IsUnreserved() const; inline TBool IsMark() const; - inline TBool IsTokenChar() const; + inline TBool IsTokenChar(RArray* aArray = NULL) const; inline TBool IsSeparator() const; inline TBool IsWordChar() const; inline TBool IsQuotedPairChar() const; diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Codec/src/TSIPChar.inl --- a/realtimenetprots/sipfw/SIP/Codec/src/TSIPChar.inl Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Codec/src/TSIPChar.inl Thu Jul 22 16:37:20 2010 +0100 @@ -112,20 +112,33 @@ // TSIPChar::IsTokenChar // ----------------------------------------------------------------------------- // -inline TBool TSIPChar::IsTokenChar () const +inline TBool TSIPChar::IsTokenChar (RArray* aArray) const { if (IsAlphaDigit()) { return ETrue; } - TSIPChar val = *this; - if (val == '-' || val == '.' || val == '!' || val == '%' || val == '*' || + TInt length= 0; + TSIPChar val = *this; + //Allowing '/' token for interoperability issues + if (aArray) + length = aArray->Count(); + if(length) + { + for (TInt i =0; ioperator [](i)) + return ETrue; + } + } + if (val == '-' || val == '.' || val == '!' || val == '%' || val == '*' || val == '_' || val == '+' || val == '\'' || val == '~' || val == '`') - { - return ETrue; - } - return EFalse; - } + { + return ETrue; + } + + return EFalse; + } // ----------------------------------------------------------------------------- // TSIPChar::IsSeparator diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CReceiverTcp.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CReceiverTcp.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CReceiverTcp.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -149,8 +149,8 @@ iContext.SocketContainer().CancelRecv(); } else - { - iContext.SocketContainer().Socket().CancelAll(); + { + iContext.SocketContainer().CancelAll(); } RemoveReceived(); } diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -237,5 +237,21 @@ CSocketContainer( aSocket ) { } - + +// ----------------------------------------------------------------------------- +// CSecureSocketContainer::CancelAll +// ----------------------------------------------------------------------------- +// +void CSecureSocketContainer::CancelAll() + { + if ( HasSecureSocket() ) + { + iSecureSocket->CancelAll(); + } + else + { + CSocketContainer::CancelAll(); + } + } + // End of file diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.h --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSecureSocketContainer.h Thu Jul 22 16:37:20 2010 +0100 @@ -66,6 +66,8 @@ void CancelConnect(); + void CancelAll(); + void RemoteName( TSockAddr& aAddr ); TInt SetOpt( TUint aOptionName, TUint aOptionLevel, const TDesC8& aOption ); diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -192,5 +192,14 @@ CSocketContainer::CSocketContainer( RSocket& aSocket ) : iSocket( aSocket ) { } - + +// ----------------------------------------------------------------------------- +// CSocketContainer::CancelAll +// ----------------------------------------------------------------------------- +// +void CSocketContainer::CancelAll() + { + iSocket.CancelAll(); + } + // End of file diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.h --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CSocketContainer.h Thu Jul 22 16:37:20 2010 +0100 @@ -72,6 +72,8 @@ virtual void CancelConnect(); + virtual void CancelAll(); + virtual void RemoteName( TSockAddr& aAddr ); virtual TInt SetOpt( TUint aOptionName, diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -274,7 +274,7 @@ if ( IsConnectedTransport() ) { TResponseRoute route( id, aRemoteAddr ); - iIDArray.Append( route ); + iIDArray.AppendL( route ); } TRAP( leaveValue, receiver->ReceiveL( static_cast( aMessage ) ) ); @@ -610,7 +610,12 @@ // Sent-by is now set for the first time, must set the port too if ( receivePort == 0 ) { - receivePort = KDefaultSipPort; + //If the Transport in the outgoing request is TLS and port value = 0 + //provide 5061 for TLS and 5060 for UDP/TCP + if(SIPStrings::StringF(SipStrConsts::ETLS) == viaHeader->Transport()) + receivePort = KDefaultSipsPort; + else + receivePort = KDefaultSipPort; } } if ( receivePort ) @@ -1450,27 +1455,44 @@ RStringF transportParam = uri.SIPURI()->ParamValue( SIPStrings::StringF( SipStrConsts::ETransport ) ); - - if ( Protocol() == KProtocolTls ) + + RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS ); + //If the Contact header has parameter transport=tls, remove it + //as it is deprecated in RFC 3261 + if(transportParam == tls) + { + uri.SIPURI()->DeleteParam(SIPStrings::StringF( SipStrConsts::ETransport )); + } + + //If the message is CSIPRequest, make sure its scheme is as per From Header. + //So if the FROM header is SIPS, Contact header is SIPS, if FROM header is SIP, + //Contact header scheme is sip + if(aMessage->IsRequest()) { - RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS ); - // SIP-URI with transport=TLS must not use sips scheme - uri.SIPURI()->SetSIPS( transportParam != tls ); - if(transportParam == tls) + if ( Protocol() == KProtocolTls ) + { + 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 ); + } + } + } + else { - 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 )); + uri.SIPURI()->SetSIPS( EFalse ); } - } - else - { - uri.SIPURI()->SetSIPS( EFalse ); - } - } - } - } - + } //end if (aMessage->IsRequest) + } //end if (uri.IsSIPURI()) + } //end if(sipaddr) + } //end while } // ----------------------------------------------------------------------------- diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/ConnectionMgr/src/TTlsTransTlsConnecting.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/TTlsTransTlsConnecting.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/TTlsTransTlsConnecting.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -22,8 +22,10 @@ #include "TTlsTransTlsConnecting.h" #include "MTlsTransStateOwner.h" - -const TInt KConnectTLSTimeout = 10000; // 10 seconds +// SIP layer waits 30 seconds for TLS Handshake to happen, if the timer +// fires and negotiation does not happen, it cancels the handshake assuming +// some problem while handshaking. +const TInt KConnectTLSTimeout = 30000; // 30 seconds // ----------------------------------------------------------------------------- // TTlsTransTlsConnecting::EnterL diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Group/sipcodec.mmp --- a/realtimenetprots/sipfw/SIP/Group/sipcodec.mmp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Group/sipcodec.mmp Thu Jul 22 16:37:20 2010 +0100 @@ -135,7 +135,8 @@ LIBRARY estor.lib LIBRARY charconv.lib LIBRARY inetprotutil.lib - +LIBRARY featdiscovery.lib + VENDORID 0x70000001 CAPABILITY All -Tcb diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/Server/src/CSipCSSession.cpp --- a/realtimenetprots/sipfw/SIP/Server/src/CSipCSSession.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/Server/src/CSipCSSession.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -252,7 +252,10 @@ { TInt handle = 0; ITC().ReadL(aMessage,handle,ESipItcArgSubSessionHandle); - CloseSubSession (handle); + if(iSubSessionIndex->AtL(handle)) + CloseSubSession (handle); + else + {} } break; diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/SIP/sipapi/api/siperr.h --- a/realtimenetprots/sipfw/SIP/sipapi/api/siperr.h Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/SIP/sipapi/api/siperr.h Thu Jul 22 16:37:20 2010 +0100 @@ -93,4 +93,7 @@ /** ICMP error has occured */ const TInt KErrSIPICMPFailure = -17718; +/** Error code to indicate switching to secondary APN on non fatal error */ +const TInt KErrSIPApnSwitchNonFatalFailure = -17719; + #endif //SIPERR_H diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/conf/sipframework_101f413c.crml Binary file realtimenetprots/sipfw/conf/sipframework_101f413c.crml has changed diff -r 0cae6035b266 -r f91588750b61 realtimenetprots/sipfw/rom/sipsw.iby --- a/realtimenetprots/sipfw/rom/sipsw.iby Thu Jun 17 22:31:40 2010 +0100 +++ b/realtimenetprots/sipfw/rom/sipsw.iby Thu Jul 22 16:37:20 2010 +0100 @@ -77,7 +77,7 @@ ECOM_PLUGIN(siptls.dll,siptls.rsc) -#ifdef SYMBIAN_EXCLUDE_IPSEC +#ifndef __IPSEC REM Feature IPSEC not included in this rom #else ECOM_PLUGIN(sipipsec.dll,sipipsec.rsc) @@ -103,14 +103,13 @@ ECOM_PLUGIN(sipietfagnt.dll,sipietfagnt.rsc) +#ifndef FF_EXCLUDE_STANDARD_IMSAGENT ECOM_PLUGIN(sipimsagnt.dll,sipimsagnt.rsc) +#endif /* Resources - XML for secure profile backup*/ data=ZPRIVATE\101F413C\backup_registration.xml private\101F413C\backup_registration.xml -// ProfileAgent's default cre file -data=DATAZ_\private\10202be9\101f413c.cre private\10202be9\101f413c.cre - #endif /* SYMBIAN_EXCLUDE_SIP*/ #endif /* __SIPSW_IBY__ */ diff -r 0cae6035b266 -r f91588750b61 rtp/srtpstack/inc/srtputils.h --- a/rtp/srtpstack/inc/srtputils.h Thu Jun 17 22:31:40 2010 +0100 +++ b/rtp/srtpstack/inc/srtputils.h Thu Jul 22 16:37:20 2010 +0100 @@ -29,6 +29,7 @@ #include #include +#include #ifdef SRTP_UNIT_TEST_COVERAGE diff -r 0cae6035b266 -r f91588750b61 sipplugins/group/bld.inf --- a/sipplugins/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/sipplugins/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -19,7 +19,6 @@ #include "../sippwlanplugin/group/bld.inf" -#include "../sippsipsettingsui/group/bld.inf" #include "../sippdevmgmtsipadapter/group/bld.inf" #include "../sippsystemstatemonitor/group/bld.inf" #include "../sippsipadapter/group/bld.inf" diff -r 0cae6035b266 -r f91588750b61 sipplugins/sippsystemstatemonitor/src/sipdevicestateaware.cpp --- a/sipplugins/sippsystemstatemonitor/src/sipdevicestateaware.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/sipplugins/sippsystemstatemonitor/src/sipdevicestateaware.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -219,8 +219,11 @@ if( iObservers.Count() == iCount) { iGuardTimer->Cancel(); - iStateAwareSession.AcknowledgeStateNotification(KErrNone); - iCount = 0; + if(iState == CSipSystemStateMonitor::ESystemOffline) + { + iStateAwareSession.AcknowledgeStateNotification(KErrNone); + iCount = 0; + } } } @@ -231,7 +234,10 @@ void CSipDeviceStateAware::EventProcessingCompleted() { iGuardTimer->Cancel(); - iStateAwareSession.AcknowledgeStateNotification(KErrNone); - iCount = 0; + if(iState == CSipSystemStateMonitor::ESystemOffline) + { + iStateAwareSession.AcknowledgeStateNotification(KErrNone); + iCount = 0; + } } diff -r 0cae6035b266 -r f91588750b61 sipplugins/sippsystemstatemonitor/src/sipvpnmonitorao.cpp --- a/sipplugins/sippsystemstatemonitor/src/sipvpnmonitorao.cpp Thu Jun 17 22:31:40 2010 +0100 +++ b/sipplugins/sippsystemstatemonitor/src/sipvpnmonitorao.cpp Thu Jul 22 16:37:20 2010 +0100 @@ -191,9 +191,11 @@ // SIP deregistration has been completed. Stop the guard timer and tell // the VPN client about it. iGuardTimer->Cancel(); - - iProperty.Set( KPSVpnSipUid, KVpnSipState, ESipDeregisterCompleted ); - iCount = 0; + if (iState == CSipSystemStateMonitor::EVpnInitiating) + { + iProperty.Set( KPSVpnSipUid, KVpnSipState, ESipDeregisterCompleted ); + iCount = 0; + } } // ----------------------------------------------------------------------------- diff -r 0cae6035b266 -r f91588750b61 sipproviderplugins/sipprovider/sipconnectionplugins/group/bld.inf --- a/sipproviderplugins/sipprovider/sipconnectionplugins/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/sipproviderplugins/sipprovider/sipconnectionplugins/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -26,7 +26,7 @@ ../data/esock_sip.cmi z:/private/101f7988/esock_sip.cmi -../group/sipproviders.iby /epoc32/rom/include/sipproviders.iby +../group/sipproviders.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sipproviders.iby) PRJ_MMPFILES sipproviders.mmp diff -r 0cae6035b266 -r f91588750b61 sipproviderplugins/sipprovider/sipdummyprt/group/bld.inf --- a/sipproviderplugins/sipprovider/sipdummyprt/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/sipproviderplugins/sipprovider/sipdummyprt/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -21,13 +21,13 @@ */ PRJ_EXPORTS -../group/SIPDummyPRT.iby /epoc32/rom/include/sipdummyprt.iby +../group/SIPDummyPRT.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sipdummyprt.iby) ../data/sip.providers.esk z:/private/101f7989/esock/sip.providers.esk #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY -../group/siphlapi.iby /epoc32/rom/include/siphlapi.iby +../group/siphlapi.iby CORE_MW_LAYER_IBY_EXPORT_PATH(siphlapi.iby) ../data/esock_sip.cmi z:/private/101f7988/esock_sip.cmi #endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY diff -r 0cae6035b266 -r f91588750b61 sipproviderplugins/sipprovider/sipstatemachine/group/bld.inf --- a/sipproviderplugins/sipprovider/sipstatemachine/group/bld.inf Thu Jun 17 22:31:40 2010 +0100 +++ b/sipproviderplugins/sipprovider/sipstatemachine/group/bld.inf Thu Jul 22 16:37:20 2010 +0100 @@ -25,5 +25,5 @@ SipStateMachine.mmp PRJ_EXPORTS -../group/SipStateMachine.iby /epoc32/rom/include/sipstatemachine.iby +../group/SipStateMachine.iby CORE_MW_LAYER_IBY_EXPORT_PATH(sipstatemachine.iby) ../inc/siphlerr.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(siphlerr.h) \ No newline at end of file