realtimenetprots/sipfw/SIP/NetworkMonitor/src/CNetworkManager.cpp
changeset 0 307788aac0a8
child 12 c2e8c8b73582
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : CNetworkManager.cpp
       
    15 // Part of     : NetworkMonitor
       
    16 // Implementation
       
    17 // Version     : SIP/4.0
       
    18 //
       
    19 
       
    20 
       
    21 
       
    22 #include <commsdat.h>
       
    23 #include <metadatabase.h>
       
    24 #include <es_sock.h>
       
    25 #include "sipbearermonitor.h"
       
    26 #include "CNetworkManager.h"
       
    27 #include "sipnetworkinfoobserver.h"
       
    28 #include "SipLogs.h"
       
    29 
       
    30 
       
    31 // Observer array granularity.
       
    32 #if defined (CPPUNIT_TEST)
       
    33 const TInt KObserverGranularity( 1 );
       
    34 #else
       
    35 const TInt KObserverGranularity( 4 );
       
    36 #endif
       
    37 
       
    38 // ECom plugin interface UID
       
    39 const TUid KSIPBearerInterfaceUid = { 0x102010D8 };
       
    40 
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CNetworkManager::NewL
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CNetworkManager* CNetworkManager::NewL()
       
    47 	{
       
    48 	CNetworkManager* self = new( ELeave ) CNetworkManager;
       
    49 	CleanupStack::PushL( self );
       
    50 	self->ConstructL();
       
    51 	CleanupStack::Pop( self );
       
    52 	return self;
       
    53 	}
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CNetworkManager::CNetworkManager
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CNetworkManager::CNetworkManager() :
       
    60 	iObservers( KObserverGranularity ),
       
    61 	iNetworkInfoObserver( NULL )
       
    62 	{
       
    63 	}
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CNetworkManager::ConstructL
       
    67 // -----------------------------------------------------------------------------
       
    68 //
       
    69 void CNetworkManager::ConstructL()
       
    70 	{
       
    71 	iContainerIndex = CObjectConIx::NewL();
       
    72 	iContainer = iContainerIndex->CreateL();
       
    73 	}
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CNetworkManager::~CNetworkManager
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 CNetworkManager::~CNetworkManager()
       
    80 	{
       
    81 	// Deregister all observers, delete CConnectionMonitors
       
    82 	// and free Bearer handles
       
    83 	TInt count = iObservers.Count();
       
    84 	for( TInt i = 0; i < count; i++ )
       
    85 		{
       
    86 		MSIPNetworkObserver* observer = iObservers[ i ].iObserver;
       
    87 		if ( observer )
       
    88 		    {
       
    89 		    Deregister( *observer );
       
    90 		    }
       
    91 		}
       
    92 
       
    93 	// Destroy reference counted object framework objects
       
    94 	delete iContainerIndex;
       
    95 	}
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // CNetworkManager::RegisterObserverL
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 void CNetworkManager::RegisterObserverL( MSIPNetworkObserver& aObserver,
       
   102 										 TInt aIapId,
       
   103 										 TInt aError )
       
   104 	{
       
   105 	__SIP_LOG("CNetworkManager::RegisterObserverL, Start")
       
   106 	// A bearer monitor plugin is not needed on emulator, except when doing
       
   107 	// unit testing
       
   108 #if ((defined (__WINS__) || defined(__WINSCW__)) && !defined(CPPUNIT_TEST) )
       
   109 
       
   110 	aError++; aIapId++; aObserver; // Avoid compiler warnings
       
   111 	return;
       
   112 
       
   113 #else
       
   114 
       
   115 	// Try to find an existing observer entry from the registry
       
   116 	TInt index = FindRegistryEntry( aObserver );
       
   117 	if( index != KErrNotFound )
       
   118 		{
       
   119 		// Already registered, just refresh.
       
   120 		const TObserverEntry& entry  = iObservers[ index ];
       
   121 		__SIP_LOG("CNetworkManager::RegisterObserverL, Already registered, just refresh")
       
   122 		entry.iBearer->RefreshL( aError );
       
   123 		return;
       
   124 		}
       
   125     
       
   126 	// Find a bearer for the specified observer (and its RConnection)
       
   127 	CSIPBearerMonitor* bearer = FindBearerL( aIapId, aError );
       
   128 	
       
   129 	// Associate the observer with a bearer only when the bearer is not NULL
       
   130 	if (bearer != NULL)
       
   131 		{
       
   132 		__SIP_LOG("CNetworkManager::RegisterObserverL, Associate the observer with a bearer")
       
   133     	TObserverEntry entry;
       
   134     	entry.iObserver = &aObserver;
       
   135     	entry.iBearer = bearer;
       
   136     	entry.iReportedState = MSIPNetworkObserver::ENetworkUnknown;
       
   137     	CleanupClosePushL( *bearer );
       
   138    		iObservers.AppendL( entry );
       
   139     	CleanupStack::Pop( bearer );	
       
   140 		}
       
   141 #endif
       
   142 	}
       
   143 
       
   144 // -----------------------------------------------------------------------------
       
   145 // CNetworkManager::Deregister
       
   146 // -----------------------------------------------------------------------------
       
   147 //
       
   148 void CNetworkManager::Deregister( MSIPNetworkObserver& aObserver )
       
   149 	{
       
   150 	// Find a matching observer entry from the registry
       
   151 	TInt index = FindRegistryEntry( aObserver );
       
   152 
       
   153 	// Remove from the registry entry if a match was found, otherwise
       
   154 	// do nothing (fail silently)
       
   155 	if( index != KErrNotFound )
       
   156 		{
       
   157 		TObserverEntry entry = iObservers[ index ];
       
   158 		iObservers.Delete( index );
       
   159 		// Notify bearer that a client has gone (decrement reference count)
       
   160 		if( entry.iBearer )
       
   161 			{
       
   162 			entry.iBearer->Close();
       
   163 			}
       
   164 		}
       
   165 	}
       
   166 	
       
   167 // -----------------------------------------------------------------------------
       
   168 // CNetworkManager::ContinueMonitoring
       
   169 // -----------------------------------------------------------------------------
       
   170 //
       
   171 TBool CNetworkManager::ContinueMonitoring( MSIPNetworkObserver& aObserver, 
       
   172                                            TInt aError )
       
   173     {
       
   174 	__SIP_LOG("CNetworkManager::ContinueMonitoring, Start")
       
   175     // Find a matching observer entry from the registry
       
   176 	TInt index = FindRegistryEntry( aObserver );
       
   177 
       
   178 	// Ask from corresponding monitor plugin whether monitoring should be
       
   179 	// continued after aError has occured while re-establishment of the 
       
   180 	// connection
       
   181 	if( index != KErrNotFound )
       
   182 		{
       
   183 		__SIP_LOG("CNetworkManager::ContinueMonitoring, returning found")
       
   184 		TObserverEntry entry = iObservers[ index ];
       
   185 		if( entry.iBearer )
       
   186 			{
       
   187 			return entry.iBearer->ContinueMonitoring( aError );
       
   188 			}
       
   189 		}
       
   190 	__SIP_LOG("CNetworkManager::ContinueMonitoring, returning default")
       
   191 	return EFalse;
       
   192     }
       
   193 
       
   194 // -----------------------------------------------------------------------------
       
   195 // CNetworkManager::State
       
   196 // -----------------------------------------------------------------------------
       
   197 //
       
   198 MSIPNetworkObserver::TNetworkState CNetworkManager::State(
       
   199 											 MSIPNetworkObserver& aObserver ) const
       
   200 	{
       
   201 	// Find a matching observer entry from the registry
       
   202 	TInt index = FindRegistryEntry( aObserver );
       
   203 
       
   204 	// Return bearer state if successful, otherwise return unknown state.
       
   205 	if( index != KErrNotFound )
       
   206 		{
       
   207 		const TObserverEntry& entry = iObservers[ index ];
       
   208  		return entry.iBearer->State();
       
   209 		}
       
   210 	else
       
   211 		{
       
   212 		return MSIPNetworkObserver::ENetworkUnknown;
       
   213 		}
       
   214 	}
       
   215 
       
   216 // -----------------------------------------------------------------------------
       
   217 // CNetworkManager::BearerStateChanged
       
   218 // -----------------------------------------------------------------------------
       
   219 //
       
   220 void CNetworkManager::BearerStateChanged( CSIPBearerMonitor* aBearer,
       
   221 								 		  TInt aError )
       
   222 	{
       
   223 	 __SIP_INT_LOG1( "CNetworkManager::BearerStateChanged", aError )	
       
   224 	// A bearer reported a state change.
       
   225 	// Broadcast that to all registered observers for that bearer
       
   226 	TInt count = iObservers.Count();
       
   227  	for( TInt i = 0; i < count; i++ )
       
   228  		{
       
   229  		TObserverEntry& entry = iObservers[ i ];
       
   230  		if( entry.iBearer == aBearer )
       
   231  			{
       
   232  			MSIPNetworkObserver::TNetworkState newState = aBearer->State();
       
   233  			if( newState != entry.iReportedState )
       
   234  				{
       
   235  				entry.iReportedState = newState;
       
   236  				}
       
   237 			__SIP_INT_LOG2( "CNetworkManager::BearerStateChanged, State ,Error",newState, aError )	
       
   238  			entry.iObserver->NetworkStateChanged( newState, aError );
       
   239  			}
       
   240  		}
       
   241 	}
       
   242 
       
   243 // -----------------------------------------------------------------------------
       
   244 // CNetworkManager::InfoChanged
       
   245 // -----------------------------------------------------------------------------
       
   246 //
       
   247 void CNetworkManager::InfoChanged( const TSIPAccessNetworkInfo& aInfo )
       
   248 	{
       
   249 	iAccessNetworkInfo = aInfo;
       
   250 
       
   251 	if ( iNetworkInfoObserver )
       
   252 		{
       
   253 		iNetworkInfoObserver->InfoChanged( iAccessNetworkInfo );
       
   254 		}
       
   255 	}
       
   256 
       
   257 // -----------------------------------------------------------------------------
       
   258 // CNetworkManager::FindRegistryEntry
       
   259 // -----------------------------------------------------------------------------
       
   260 //
       
   261 TInt CNetworkManager::FindRegistryEntry( MSIPNetworkObserver& aObserver ) const
       
   262 	{
       
   263 	TInt index;
       
   264 	TObserverEntry ref;
       
   265 	ref.iObserver = &aObserver;
       
   266 	const TInt keyOffset = _FOFF( CNetworkManager::TObserverEntry, iObserver );
       
   267 	TKeyArrayFix findKey( keyOffset, ECmpTUint32 );
       
   268 
       
   269 	// Try to find a matching observer entry from the registry
       
   270 	TInt found = iObservers.Find( ref, findKey, index );
       
   271 
       
   272 	// Return entry index if successful, otherwise return an error.
       
   273 	if( found == 0 )
       
   274 		{
       
   275 		return index;
       
   276 		}
       
   277 	else
       
   278 		{
       
   279 		return KErrNotFound;
       
   280 		}
       
   281 	}
       
   282 
       
   283 // -----------------------------------------------------------------------------
       
   284 // CNetworkManager::FindBearerL
       
   285 // -----------------------------------------------------------------------------
       
   286 //
       
   287 CSIPBearerMonitor* CNetworkManager::FindBearerL( TInt aIapId, TInt aError )
       
   288 	{	
       
   289 	__SIP_LOG("CNetworkManager::FindBearerL, Start")
       
   290 	TBuf< KCDMaxFieldNameLength > serviceType;
       
   291 	// Reserve space for possibly appended iapId
       
   292 	const TInt KMaxTIntAsDesLen = 11;
       
   293 	const TInt objectNameLen( KCDMaxFieldNameLength + KMaxTIntAsDesLen );
       
   294 	TBuf< objectNameLen > objectName;
       
   295 	
       
   296 	// Fetch service type and objectName for this connection from CommDb.
       
   297 	// Use serviceType as resolving parameter, objectName is used for
       
   298 	// identifying loaded plugins stored in iContainer
       
   299 	TInt realIapId =
       
   300 	    GetServiceTypeAndObjectNameL( aIapId, serviceType, objectName );
       
   301 	    
       
   302 	if (realIapId == 0)
       
   303 		{
       
   304 		// No bearer associated with IAP ID:0. Hence return NULL. 
       
   305 		// This results in not starting the bearer monitor 
       
   306 	    return NULL; 		
       
   307 		}   
       
   308     
       
   309 	// Try to find a matching object from the object container
       
   310 	TName tmp;
       
   311 	TInt objectHandle( 0 );
       
   312 	TInt found = iContainer->FindByName( objectHandle, objectName, tmp );
       
   313 
       
   314 	CSIPBearerMonitor* bearer;
       
   315 	if( found == KErrNotFound )
       
   316 		{
       
   317 		__SIP_LOG("CNetworkManager::FindBearerL, Object Was not found and calling CreateImpl")
       
   318 		// Object was not found, create a new one using ECom
       
   319 		HBufC8* objectName8 = HBufC8::NewLC( serviceType.Length() * 2 );
       
   320 		TPtr8 ptrObjectName8( objectName8->Des() );
       
   321 		ptrObjectName8.Copy( serviceType );
       
   322 		
       
   323 		// Find implementation by name
       
   324 	    TEComResolverParams resolverParams;
       
   325 	    resolverParams.SetDataType( ptrObjectName8 );
       
   326 	    
       
   327 	    TSIPBearerParams bearerParams( *this, realIapId, aError, *this );
       
   328 	    
       
   329     	bearer = reinterpret_cast< CSIPBearerMonitor* >(
       
   330     	    REComSession::CreateImplementationL(
       
   331     	        KSIPBearerInterfaceUid,
       
   332     	        _FOFF( CSIPBearerMonitor, iInstanceKey ),
       
   333     	        &bearerParams,
       
   334     	        resolverParams,
       
   335     	        KRomOnlyResolverUid ) );
       
   336 		// Register it to the object container
       
   337 		CleanupClosePushL( *bearer );
       
   338 		bearer->SetNameL( &objectName );
       
   339 		iContainer->AddL( bearer );
       
   340 		CleanupStack::Pop(); // bearer
       
   341 		CleanupStack::PopAndDestroy( objectName8 );
       
   342 		}
       
   343 	else
       
   344 		{
       
   345 		__SIP_LOG("CNetworkManager::FindBearerL, Object Was Found")
       
   346 		// Object was found, go fetch it and cast to appropriate type
       
   347 		bearer = static_cast< CSIPBearerMonitor* >(
       
   348 										 iContainer->At( objectHandle ) );
       
   349 		// Increase reference count
       
   350 		User::LeaveIfError( bearer->Open() );
       
   351 		
       
   352 		// Refresh
       
   353 		bearer->RefreshL( aError );
       
   354 		}
       
   355 		__SIP_LOG("CNetworkManager::FindBearerL, End")
       
   356 	return bearer;
       
   357 	}
       
   358 
       
   359 // -----------------------------------------------------------------------------
       
   360 // CNetworkManager::GetServiceTypeAndObjectNameL
       
   361 // -----------------------------------------------------------------------------
       
   362 //
       
   363 TInt CNetworkManager::GetServiceTypeAndObjectNameL( 
       
   364     TInt aIapId, TDes& aServiceType, TDes& aObjectName )
       
   365 	{
       
   366 	const TInt KMaxTIntAsDesLen = 11;
       
   367 	
       
   368 	__ASSERT_ALWAYS( 
       
   369 	    aServiceType.MaxLength() >= KCDMaxFieldNameLength &&
       
   370 	    aObjectName.MaxLength() >= ( KCDMaxFieldNameLength + KMaxTIntAsDesLen ), 
       
   371 	    User::Leave( KErrArgument ) );
       
   372 	
       
   373     TInt realIapId( aIapId );
       
   374 
       
   375     CMDBSession* db = CMDBSession::NewLC( KCDVersion1_1 ); 
       
   376     
       
   377     db->SetAttributeMask( ECDHidden );
       
   378     
       
   379     // Create an iap record
       
   380     CCDIAPRecord* iapRecord = 
       
   381         static_cast<CCDIAPRecord*>( 
       
   382             CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) );
       
   383     CleanupStack::PushL( iapRecord );
       
   384     
       
   385     iapRecord->SetRecordId( aIapId );
       
   386 
       
   387     iapRecord->LoadL( *db );
       
   388 
       
   389     GetServiceTypeL( *iapRecord, aServiceType );
       
   390     
       
   391     // If VPN IAP is used, "really" used IAP have to be fetched
       
   392     if ( aServiceType.Compare( TPtrC( KCDTypeNameVPNService ) ) == 0 )
       
   393         {
       
   394         realIapId = HandleVPNServiceL( *db, *iapRecord, aServiceType );
       
   395         }
       
   396     
       
   397     CleanupStack::PopAndDestroy( iapRecord );
       
   398     CleanupStack::PopAndDestroy( db );
       
   399     
       
   400     aObjectName.Copy( aServiceType );
       
   401     
       
   402     // Find out if the IAP is LANService access point.
       
   403     // If so, aIapId will be appended to aObjectName descriptor which is
       
   404     // used for identifying bearer monitor plugins. By this we achieve
       
   405     // that own monitor plugin is loaded for each LANService IAP
       
   406     
       
   407 #ifndef CPPUNIT_TEST
       
   408     if ( aServiceType.Compare( TPtrC( KCDTypeNameLANService ) ) == 0 )
       
   409         {
       
   410         aObjectName.AppendNum( static_cast<TInt64>( realIapId ) );
       
   411         }        
       
   412 #endif
       
   413 
       
   414     return realIapId;
       
   415 	}
       
   416 
       
   417 // -----------------------------------------------------------------------------
       
   418 // CNetworkManager::HandleVPNServiceL
       
   419 // -----------------------------------------------------------------------------
       
   420 //	
       
   421 TInt CNetworkManager::HandleVPNServiceL( 
       
   422     CMDBSession& aCommsDat, CCDIAPRecord& aIapRecord, TDes& aServiceType )
       
   423     {   
       
   424     aIapRecord.iService.LoadL( aCommsDat );
       
   425     
       
   426     if ( !aIapRecord.iService.iLinkedRecord )
       
   427         {
       
   428         // Ownership of created record is transferred
       
   429         aIapRecord.iService.iLinkedRecord = 
       
   430             static_cast<CCDVPNServiceRecord*>(
       
   431                 CCDRecordBase::RecordFactoryL( KCDTIdVPNServiceRecord ) );
       
   432         aIapRecord.iService.iLinkedRecord->SetRecordId( aIapRecord.iService );
       
   433         
       
   434         aIapRecord.iService.iLinkedRecord->LoadL( aCommsDat );
       
   435         }  
       
   436     
       
   437     CCDVPNServiceRecord* serviceRecord = 
       
   438         static_cast<CCDVPNServiceRecord*>( aIapRecord.iService.iLinkedRecord );
       
   439     
       
   440     serviceRecord->iServiceIAP.LoadL( aCommsDat );
       
   441     
       
   442     // It is valid to have 0 for iServiceIAP when the SNAP is configured for VPN IAP. 
       
   443     // So treat this is a valid configuaration and fill the aServiceType to NULL which usually contains the IAP service type(like LAN Service, Outgoing GPRS etc )     
       
   444     if (serviceRecord->iServiceIAP == 0)
       
   445     	{    	
       
   446    		aServiceType.Copy(_L8("")); 
       
   447     	return (serviceRecord->iServiceIAP);
       
   448     	}
       
   449     
       
   450     if ( !serviceRecord->iServiceIAP.iLinkedRecord )
       
   451         {
       
   452         // Ownership of created record is transferred
       
   453         serviceRecord->iServiceIAP.iLinkedRecord = 
       
   454             static_cast<CCDIAPRecord*>(
       
   455                 CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) );
       
   456         serviceRecord->iServiceIAP.iLinkedRecord->SetRecordId( 
       
   457             serviceRecord->iServiceIAP );
       
   458             
       
   459         serviceRecord->iServiceIAP.iLinkedRecord->LoadL( aCommsDat );
       
   460         }
       
   461 
       
   462     CCDIAPRecord* iapRecord = 
       
   463         static_cast<CCDIAPRecord*>( serviceRecord->iServiceIAP.iLinkedRecord );
       
   464     
       
   465     // We need service type info of the "real" iap
       
   466     GetServiceTypeL( *iapRecord, aServiceType );
       
   467        
       
   468     return iapRecord->RecordId();
       
   469     }
       
   470 
       
   471 // -----------------------------------------------------------------------------
       
   472 // CNetworkManager::GetServiceTypeL
       
   473 // -----------------------------------------------------------------------------
       
   474 //    
       
   475 void CNetworkManager::GetServiceTypeL( 
       
   476     CCDIAPRecord& aIapRecord, TDes& aServiceType )
       
   477     {
       
   478     CMDBField<TDesC>* serviceType = 
       
   479             ( CMDBField<TDesC>* )aIapRecord.GetFieldByIdL( 
       
   480                                                 KCDTIdIAPServiceType );
       
   481             
       
   482     __ASSERT_ALWAYS( serviceType && !serviceType->IsNull(), 
       
   483                      User::Leave( KErrNotFound ) );
       
   484     
       
   485     aServiceType.Copy( *serviceType );
       
   486     }
       
   487 
       
   488 // -----------------------------------------------------------------------------
       
   489 // CNetworkManager::RegisterAccessNetworkObserver
       
   490 // -----------------------------------------------------------------------------
       
   491 //
       
   492 const TSIPAccessNetworkInfo& CNetworkManager::RegisterAccessNetworkObserver(
       
   493     MSIPNetworkInfoObserver& aObserver )
       
   494 	{
       
   495 	// A bearer monitor plugin is not needed on emulator, except when doing
       
   496 	// unit testing
       
   497 #if ((defined (__WINS__) || defined(__WINSCW__)) && !defined(CPPUNIT_TEST) )
       
   498 	aObserver; // Avoid compiler warnings
       
   499 	
       
   500 	//Since the real plugin is not started in emulator, pass hardcoded values
       
   501 	//to ConnectionMgr so that the P-Access-Network-Info header can be tested.
       
   502 	iAccessNetworkInfo = DummyAccessNetworkValues();
       
   503 	
       
   504 #else
       
   505 	iNetworkInfoObserver = &aObserver;
       
   506 #endif
       
   507 
       
   508 	return iAccessNetworkInfo;
       
   509 	}
       
   510 	
       
   511 // -----------------------------------------------------------------------------
       
   512 // CNetworkManager::DummyAccessNetworkValues
       
   513 // -----------------------------------------------------------------------------
       
   514 //
       
   515 TSIPAccessNetworkInfo CNetworkManager::DummyAccessNetworkValues() const
       
   516 	{
       
   517 	_LIT( KDummyCountryCode, "12" );
       
   518     _LIT( KDummyNetworkCode, "345" );
       
   519     const TUint KDummyLocationAreaCode = 0x6789;
       
   520     const TUint KDummyCellId = 0xABCD;
       
   521     
       
   522     TSIPAccessNetworkInfo accessNetworkInfo;
       
   523 	
       
   524     accessNetworkInfo.iNetworkMode = RMobilePhone::ENetworkModeGsm; 
       
   525     accessNetworkInfo.iMobileCountryCode.Copy( KDummyCountryCode );
       
   526     accessNetworkInfo.iMobileNetworkCode.Copy( KDummyNetworkCode );
       
   527     accessNetworkInfo.iAreaKnown = ETrue;
       
   528     accessNetworkInfo.iLocationAreaCode = KDummyLocationAreaCode;
       
   529     accessNetworkInfo.iCellId = KDummyCellId;
       
   530 	
       
   531     return accessNetworkInfo;
       
   532 	}
       
   533 
       
   534 // -----------------------------------------------------------------------------
       
   535 // CNetworkManager::DeregisterAccessNetworkObserver
       
   536 // -----------------------------------------------------------------------------
       
   537 //
       
   538 void CNetworkManager::DeregisterAccessNetworkObserver()
       
   539 	{
       
   540 	iNetworkInfoObserver = NULL;
       
   541 	}
       
   542 
       
   543 // -----------------------------------------------------------------------------
       
   544 // CNetworkManager::RefreshConnection
       
   545 // -----------------------------------------------------------------------------
       
   546 //
       
   547 void CNetworkManager::RefreshConnectionL(TUint32 aIapId)
       
   548 	{
       
   549         CSIPBearerMonitor* bearer= FindBearerL(aIapId,KErrNone);
       
   550 	if(bearer!=NULL)
       
   551 	  {	
       
   552 	  CleanupClosePushL( *bearer );
       
   553           bearer->RefreshL(KErrNone);
       
   554           CleanupStack::PopAndDestroy();
       
   555 	  }
       
   556 	}