--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
- <package id="ipappprotocols" name="IP App Protocols" levels="plugin conn server if">
- <collection id="rtp" name="RTP" level="server">
- <component id="rtpstack" filter="s60" name="RTP Stack">
- <unit bldFile="rtp/rtpstack/group"/>
- <!-- <unit bldFile="rtp/rtpstack/tsrc/ut_rtpstack/group"/> -->
- </component>
- </collection>
- <collection id="sipplugins" name="SIP Plugins" level="plugin">
- <component id="sippwlanplugin" filter="s60" name="SIP WLAN Plugin" class="plugin">
- <unit bldFile="sipplugins/sippwlanplugin/group"/>
- </component>
- <component id="sippsipsettingsui" filter="s60" name="SIP Settings UI" class="plugin">
- <unit bldFile="sipplugins/sippsipsettingsui/group"/>
- <!-- <unit bldFile="sipplugins/sippsipsettingsui/tsrc/ut_sipsettingsui/group"/> -->
- </component>
- <component id="sippdevmgmtsipadapter" filter="s60" name="Device Management SIP Settings Adapter" class="plugin">
- <unit bldFile="sipplugins/sippdevmgmtsipadapter/group"/>
- <!-- <unit bldFile="sipplugins/sippdevmgmtsipadapter/tsrc/ut_cnsmldmsipadapter/group"/> -->
- </component>
- <component id="sippsystemstatemonitor" filter="s60" name="SIP System State Monitor" class="plugin">
- <unit bldFile="sipplugins/sippsystemstatemonitor/group"/>
- </component>
- <component id="srtpstack" filter="s60" name="SRTP Stack">
- <unit bldFile="rtp/srtpstack/group"/>
- <!-- <unit bldFile="rtp/srtpstack/tsrc/ut_srtpstack/group"/> -->
- </component>
- </collection>
- <collection id="realtimenetprots" name="Real Time Net Protocols" level="server">
- <component id="symrtp" name="RTP" introduced="9.0" purpose="optional">
- <!-- Real Time Data Protocol -->
- <unit bldFile="realtimenetprots/rtp/group" mrp="realtimenetprots/rtp/group/mm-protocols_rtp.mrp"/>
- </component>
- <component id="sipfw" name="SIP Framework" introduced="9.2" purpose="optional">
- <unit version="2" bldFile="realtimenetprots/sipfw/Group" mrp="realtimenetprots/sipfw/Group/mm-protocols_SIP2_Com.mrp"/>
- </component>
- </collection>
- <collection id="sipproviderplugins" name="SIP Provider Plugins" level="conn">
- <component id="sipprovider" name="SIP Provider" introduced="^2" purpose="optional" class="plugin">
- <unit bldFile="sipproviderplugins/sipprovider/group" mrp="sipproviderplugins/sipprovider/group/mm-protocols_SipProvider.mrp"/>
- </component>
- </collection>
- <collection id="ipappprotocols_info" name="IP App Protocols Info" level="if">
- <component id="ipappprotocols_plat" filter="s60" name="IP App Protocols Platform Interfaces" class="api">
- <unit bldFile="ipappprotocols_plat/group"/>
- </component>
- <component id="ipappprotocols_metadata" name="IP App Protocols Metadata" class="config" introduced="^2" purpose="development" target="desktop">
- <unit mrp="ipappprotocols_info/ipappprotocols_metadata/ipappprotocols_metadata.mrp"/>
- </component>
- </collection>
- </package>
-</SystemDefinition>
--- 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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
- <package id="ipappprotocols" name="IP App Protocols" levels="plugin conn server if">
- <collection id="rtp" name="RTP" level="server">
- <component id="rtpstack" filter="s60" name="RTP Stack">
- <unit bldFile="rtp/rtpstack/group"/>
- <!-- <unit bldFile="rtp/rtpstack/tsrc/ut_rtpstack/group"/> -->
- </component>
- </collection>
- <collection id="sipplugins" name="SIP Plugins" level="plugin">
- <component id="sippwlanplugin" filter="s60" name="SIP WLAN Plugin" class="plugin">
- <unit bldFile="sipplugins/sippwlanplugin/group"/>
- </component>
- <component id="sippsipsettingsui" filter="s60" name="SIP Settings UI" class="plugin">
- <unit bldFile="sipplugins/sippsipsettingsui/group"/>
- <!-- <unit bldFile="sipplugins/sippsipsettingsui/tsrc/ut_sipsettingsui/group"/> -->
- </component>
- <component id="sippdevmgmtsipadapter" filter="s60" name="Device Management SIP Settings Adapter" class="plugin">
- <unit bldFile="sipplugins/sippdevmgmtsipadapter/group"/>
- <!-- <unit bldFile="sipplugins/sippdevmgmtsipadapter/tsrc/ut_cnsmldmsipadapter/group"/> -->
- </component>
- <component id="sippsystemstatemonitor" filter="s60" name="SIP System State Monitor" class="plugin">
- <unit bldFile="sipplugins/sippsystemstatemonitor/group"/>
- </component>
- <component id="srtpstack" filter="s60" name="SRTP Stack">
- <unit bldFile="rtp/srtpstack/group"/>
- <!-- <unit bldFile="rtp/srtpstack/tsrc/ut_srtpstack/group"/> -->
- </component>
- </collection>
- <collection id="realtimenetprots" name="Real Time Net Protocols" level="server">
- <component id="symrtp" name="RTP" introduced="9.0" purpose="optional">
- <!-- Real Time Data Protocol -->
- <unit bldFile="realtimenetprots/rtp/group" mrp="realtimenetprots/rtp/group/mm-protocols_rtp.mrp"/>
- </component>
- <component id="srtp" name="Secure RTP" introduced="^4" purpose="optional">
- <unit bldFile="realtimenetprots/srtp/group" mrp="realtimenetprots/srtp/group/mm-protocols_srtp.mrp"/>
- </component>
- <component id="sipfw" name="SIP Framework" introduced="9.2" purpose="optional">
- <unit version="2" bldFile="realtimenetprots/sipfw/Group" mrp="realtimenetprots/sipfw/Group/mm-protocols_SIP2_Com.mrp"/>
- </component>
- </collection>
- <collection id="sipproviderplugins" name="SIP Provider Plugins" level="conn">
- <component id="sipprovider" name="SIP Provider" introduced="^2" purpose="optional" class="plugin">
- <unit bldFile="sipproviderplugins/sipprovider/group" mrp="sipproviderplugins/sipprovider/group/mm-protocols_SipProvider.mrp"/>
- </component>
- </collection>
- <collection id="ipappprotocols_info" name="IP App Protocols Info" level="if">
- <component id="ipappprotocols_plat" filter="s60" name="IP App Protocols Platform Interfaces" class="api">
- <unit bldFile="ipappprotocols_plat/group"/>
- </component>
- <component id="ipappprotocols_metadata" name="IP App Protocols Metadata" class="config" introduced="^2" purpose="development" target="desktop">
- <unit mrp="ipappprotocols_info/ipappprotocols_metadata/ipappprotocols_metadata.mrp"/>
- </component>
- </collection>
- </package>
-</SystemDefinition>
--- 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 <etelpckt.h>
#include <es_enum.h>
#include <es_enum_partner.h>
+#include <centralrepository.h>
#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<TConnectionInfo> 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<TConnectionInfo> 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;
--- 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 <commsdattypesv1_1.h>
#include <commdb.h>
#include <commsdat.h>
+#include <cmgenconnsettings.h>
+#include <cmmanagerkeys.h>
#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<CMDBSession*>(aDb);
+ TRAP_IGNORE(db->RollbackTransactionL());
+ }
+
// End of file
--- 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 );
--- 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 <etelmm.h>
-
-// 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
--- 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 <e32def.h>
-
-// 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
--- 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
- }
--- 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
--- 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
--- 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 ));
}