telephonyserverplugins/common_tsy/test/integration/inc/cetelsessionmgr.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-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 // Contains the CEtelSessionMgr class declaration.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalTechnology
       
    21 */
       
    22  
       
    23  
       
    24 #ifndef CETELSESSIONMGR_H
       
    25 #define CETELSESSIONMGR_H
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <etelmm.h>
       
    29 #include <etelpckt.h>
       
    30 #include <etelqos.h>
       
    31 #include <ctsy/rmmcustomapi.h>
       
    32 
       
    33 
       
    34 #include "cthreadexec.h"
       
    35 #include "tetelrequeststatus.h"
       
    36 
       
    37 enum TServerId
       
    38 	{
       
    39 	KMainServer,
       
    40 	KAltServer,
       
    41 	KMaxServers
       
    42 	};	
       
    43 	
       
    44 enum TPhoneId
       
    45 	{
       
    46 	KMainPhone,
       
    47 	KMaxPhones
       
    48 	};	
       
    49 	
       
    50 enum TLineId
       
    51 	{
       
    52 	KVoiceLine,
       
    53 	KDataLine,
       
    54 	KFaxLine,
       
    55 	KAuxLine,
       
    56 	KMaxLines
       
    57 	};
       
    58 
       
    59 enum TCallId
       
    60 	{
       
    61 	KCall1,
       
    62 	KCall2,
       
    63 	KCall3,
       
    64 	KCall4,
       
    65 	KCall5,
       
    66 	KCall6,
       
    67 	KMaxCalls
       
    68 	};
       
    69 
       
    70 enum TPacketServiceId
       
    71 	{
       
    72 	KMainPacketService,
       
    73 	KAltPacketService,
       
    74 	KMaxPacketService
       
    75 	};
       
    76 	
       
    77 enum TPrimaryPacketContextId
       
    78 	{
       
    79 	KPrimaryPacketContext1,
       
    80 	KPrimaryPacketContext2,
       
    81 	KPrimaryPacketContext3,
       
    82 	KPrimaryPacketContext4,
       
    83 	KMaxPrimaryPacketContext
       
    84 	};
       
    85 
       
    86 enum TSecondaryPacketContextId
       
    87 	{
       
    88 	KSecondaryPacketContext1,
       
    89 	KSecondaryPacketContext2,
       
    90 	KSecondaryPacketContext3,
       
    91 	KSecondaryPacketContext4,
       
    92 	KMaxSecondaryPacketContext
       
    93 	};
       
    94 	
       
    95 enum TConferenceCallId
       
    96 	{
       
    97 	KMainConferenceCall,
       
    98 	KMaxConferenceCall
       
    99 	};
       
   100 enum TONStoreId
       
   101 	{
       
   102 	KMainONStore,
       
   103 	KMaxONStore
       
   104 	};
       
   105 
       
   106 enum TENStoreId
       
   107 	{
       
   108 	KMainENStore,
       
   109 	KMaxENStore
       
   110 	};
       
   111 
       
   112 enum TPhoneBookStoreId
       
   113 	{
       
   114 	KMeAdnPhoneBook,
       
   115 	KMeDialledPhoneBook,
       
   116 	KMeMissedPhoneBook,
       
   117 	KMeReceivedPhoneBook,
       
   118 	KCombinedAdnPhoneBook,
       
   119 	KTaAdnPhoneBook,
       
   120 	KIccAdnPhoneBook,
       
   121 	KIccFdnPhoneBook,
       
   122 	KIccSdnPhoneBook,
       
   123 	KIccBdnPhoneBook,
       
   124 	KIccLndPhoneBook,
       
   125 	KIccVoiceMailBox,
       
   126 	KIccMbdnPhoneBook,
       
   127 	KMaxPhoneBookStore
       
   128 	};
       
   129 
       
   130 enum TSmsStoreId
       
   131 	{
       
   132 	KMeSmsStore,
       
   133 	KIccSmsStore,
       
   134 	KCombinedSmsStore,
       
   135 	KMaxSmsStore
       
   136 	};
       
   137 
       
   138 enum TSmsMessagingId
       
   139 	{
       
   140 	KMainSmsMessaging,
       
   141 	KMaxSmsMessaging
       
   142 	};
       
   143 
       
   144 enum TBroadcastMessagingId
       
   145 	{
       
   146 	KMainBroadcastMessaging,
       
   147 	KMaxBroadcastMessaging
       
   148 	};
       
   149 
       
   150 enum TUssdMessagingId
       
   151 	{
       
   152 	KMainUssdMessaging,
       
   153 	KMaxUssdMessaging
       
   154 	};
       
   155 	
       
   156 enum TFaxId
       
   157 	{
       
   158 	KMainFax,
       
   159 	KMaxFax
       
   160 	};
       
   161 		
       
   162 enum TCustomApiId
       
   163     {
       
   164     KMainCustomApi,
       
   165     KMaxCustomApi
       
   166     };
       
   167 
       
   168 /**
       
   169  * The session manager is responsible for opening and closing
       
   170  * all Etel-related subsessions.
       
   171 */
       
   172 
       
   173 class CEtelSessionMgr : public CBase
       
   174 	{
       
   175 public:
       
   176 
       
   177 public:
       
   178 	static CEtelSessionMgr* NewL(TName& aTsyName, TName& aPhoneName, TBool aKeepSessOpen);
       
   179 	virtual ~CEtelSessionMgr();
       
   180 
       
   181 public:
       
   182 	void OpenL(TBool aAutoOpenSess); 
       
   183 	void Close();
       
   184 	void RestartL();
       
   185 	
       
   186 public:
       
   187 	RTelServer& GetServerL(TServerId aServerId);	
       
   188 	RMobilePhone& GetPhoneL(TServerId aServerId, TPhoneId aPhoneId);
       
   189 	RMobileLine& GetLineL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId);
       
   190 	RMobileCall& GetCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId);
       
   191 	RFax& GetFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId);
       
   192 
       
   193 	RMobileCall& GetIncomingCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, const TName& aName, TCallId& aCallId);
       
   194 	
       
   195 	RMobileConferenceCall& GetConferenceCallL( TServerId aServerId, 
       
   196 												TPhoneId aPhoneId,TConferenceCallId aConferenceCallId );
       
   197 	RPacketService& GetPacketServiceL(TServerId aServerId, TPhoneId aPhoneId,TPacketServiceId aPacketServiceId);
       
   198 	RPacketContext& GetPrimaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,TPacketServiceId aPacketServiceId,
       
   199 												TPrimaryPacketContextId aPrimaryPacketContextId);
       
   200 												
       
   201 	RPacketQoS& GetPrimaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId,TPacketServiceId aPacketServiceId,
       
   202 												TPrimaryPacketContextId aPrimaryPacketContextId);
       
   203 												
       
   204 												
       
   205 	RPacketContext& GetSecondaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId,TPacketServiceId aPacketServiceId,
       
   206 												TPrimaryPacketContextId aPrimaryPacketContextId,
       
   207 												TSecondaryPacketContextId aSecondaryPacketContextId);
       
   208 
       
   209 	RPacketQoS& GetSecondaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId,TPacketServiceId aPacketServiceId,
       
   210 												TPrimaryPacketContextId aPrimaryPacketContextId,
       
   211 												TSecondaryPacketContextId aSecondaryPacketContextId);
       
   212 												
       
   213 	RMobileONStore& GetONStoreL(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId);
       
   214 	RMobileENStore& GetENStoreL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId);
       
   215 	RMobilePhoneBookStore& GetPhoneBookStoreL(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId);
       
   216 
       
   217 	RMobileSmsMessaging& GetSmsMessagingL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId);
       
   218 	RMobileSmsStore& GetSmsStoreL(TServerId aServerId, TPhoneId aPhoneId, 
       
   219 											TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId);
       
   220 	RMobileBroadcastMessaging& GetBroadcastMessagingL(TServerId aServerId, TPhoneId aPhoneId, TBroadcastMessagingId aBroadcastMessagingId);
       
   221 	RMobileUssdMessaging& GetUssdMessagingL(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId);
       
   222     RMmCustomAPI& GetCustomApiL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId);
       
   223 	
       
   224 
       
   225 	void ReleaseServer(TServerId aServerId);
       
   226 	void ReleasePhone(TServerId aServerId, TPhoneId aPhoneId);
       
   227 	void ReleaseLine(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId);
       
   228 	void ReleaseCall(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId);
       
   229 	void ReleaseFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId);
       
   230 	void ReleaseConferenceCall( TServerId aServerId, 
       
   231 												TPhoneId aPhoneId,TConferenceCallId aConferenceCallId );
       
   232 	void ReleasePacketServiceL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId);
       
   233 	void ReleasePrimaryPacketContext(TServerId aServerId, TPhoneId aPhoneId, 
       
   234 									TPacketServiceId aPacketServiceId, TPrimaryPacketContextId aPrimaryPacketContextId);
       
   235 	void ReleasePrimaryPacketContextQoS(TServerId aServerId, TPhoneId aPhoneId, 
       
   236 									TPacketServiceId aPacketServiceId, TPrimaryPacketContextId aPrimaryPacketContextId);
       
   237 									
       
   238 	void ReleaseSecondaryPacketContext(TServerId aServerId, TPhoneId aPhoneId, 
       
   239 									TPacketServiceId aPacketServiceId, 
       
   240 									TPrimaryPacketContextId aPrimaryPacketContextId,
       
   241 									TSecondaryPacketContextId aSecondaryPacketContextId);
       
   242 	void ReleaseSecondaryPacketContextQoS(TServerId aServerId, TPhoneId aPhoneId, 
       
   243 									TPacketServiceId aPacketServiceId, 
       
   244 									TPrimaryPacketContextId aPrimaryPacketContextId,
       
   245 									TSecondaryPacketContextId aSecondaryPacketContextId);
       
   246 									
       
   247 
       
   248 	void ReleaseONStore(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId);
       
   249 	void ReleaseENStore(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId);
       
   250 	void ReleasePhoneBookStore(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId);
       
   251 	void ReleaseSmsStore(TServerId aServerId, TPhoneId aPhoneId, 
       
   252 										TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId);
       
   253 
       
   254 	void ReleaseSmsMessaging(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId);
       
   255 	void ReleaseBroadcastMessaging(TServerId aServerId, TPhoneId aPhoneId, TBroadcastMessagingId aBroadcastMessagingId);
       
   256 	void ReleaseUssdMessaging(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId);
       
   257     void ReleaseCustomApi(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId);
       
   258 	
       
   259 	inline TBool HasLine(TLineId aLineId);
       
   260 	
       
   261 	inline TDesC& PhoneName();
       
   262 	
       
   263 	void AsyncExec(CThreadExec::MFunctor* aFunction);
       
   264 	void SyncExec(CThreadExec::MFunctor* aFunction);
       
   265 
       
   266 private:
       
   267 	enum TSessionStatus
       
   268 		{
       
   269 		ESessClosed =0,				//< Session is closed
       
   270 		ESessOpenAutomatically =1,	//< Session was open automatically 
       
   271 		ESessOpenManually =2		//< Session was open by an explicit call
       
   272 		};
       
   273 
       
   274 private:
       
   275 	CThreadExec* iThreadExec;
       
   276 	TBool iIsOpen;
       
   277 	TBool iAutoSessionOpened;
       
   278 	
       
   279 	/**
       
   280 	*	Class to hold a simple reference count for a name, e.g. for use with call names
       
   281 	*/
       
   282 	class TRefCountItem
       
   283 		{
       
   284 	public:
       
   285 		TRefCountItem();
       
   286 		/**
       
   287 		* Returns count before add operation, i.e. zero if new
       
   288 		*/
       
   289 		TInt AddRef( TDesC &aName );
       
   290 		/**
       
   291 		* Returns count after release operation, i.e. zero if now unused
       
   292 		*/
       
   293 		TInt ReleaseL();
       
   294 		
       
   295 		const TName &GetName() const;
       
   296 		TInt GetCount() const;
       
   297 	private:
       
   298 		TName	iName;
       
   299 		TInt	iRefCount;
       
   300 		};
       
   301 	
       
   302 		
       
   303 	// Servers
       
   304 	typedef TFixedArray<RTelServer,KMaxServers> TTelServerArray;
       
   305 	typedef TFixedArray<TSessionStatus,KMaxServers> TTelServerStatusArray;
       
   306 
       
   307 	// Phones
       
   308 	typedef TFixedArray<TFixedArray<RMobilePhone,KMaxPhones>,KMaxServers> 	TPhoneArray;
       
   309 	typedef TFixedArray<TFixedArray<TSessionStatus,KMaxPhones>,KMaxServers> TPhoneStatusArray;
       
   310 
       
   311 	// Lines
       
   312 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileLine,KMaxLines>,KMaxPhones>,KMaxServers> 	TLineArray;
       
   313 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxLines>,KMaxPhones>,KMaxServers> 	TLineStatusArray;
       
   314 	
       
   315 	// Calls
       
   316 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<RMobileCall,KMaxCalls>,KMaxLines>,KMaxPhones>,KMaxServers> 	TCallArray;
       
   317 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxCalls>,KMaxLines>,KMaxPhones>,KMaxServers> 	TCallStatusArray;
       
   318 	typedef TFixedArray<TFixedArray<TRefCountItem,KMaxCalls>,KMaxLines> TCallRefArray;
       
   319 
       
   320 	// Conference call
       
   321 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileConferenceCall,KMaxConferenceCall>,
       
   322 								KMaxPhones>,KMaxServers> 	TConferenceCallArray;
       
   323 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxConferenceCall>,
       
   324 								KMaxPhones>,KMaxServers> 	TConferenceCallStatusArray;
       
   325 	
       
   326 	// Fax
       
   327 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TFixedArray<RFax,KMaxFax>,
       
   328 								KMaxCalls>, KMaxLines>,KMaxPhones>,KMaxServers> 	TFaxArray;
       
   329 								
       
   330 								
       
   331 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxFax>,
       
   332 								KMaxCalls>, KMaxLines>,KMaxPhones>,KMaxServers> 	TFaxStatusArray;	
       
   333 
       
   334 	// PacketService
       
   335 	typedef TFixedArray<TFixedArray<TFixedArray<RPacketService,KMaxPacketService>,KMaxPhones>,KMaxServers> 	TPacketServiceArray;
       
   336 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxPacketService>,KMaxPhones>,KMaxServers> 	TPacketServiceStatusArray;
       
   337 
       
   338 	// PrimaryPacketContext
       
   339 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<RPacketContext, KMaxPrimaryPacketContext>,
       
   340 					KMaxPacketService>,KMaxPhones>,KMaxServers> 	TPrimaryPacketContextArray;
       
   341 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TSessionStatus, KMaxPrimaryPacketContext>,
       
   342 						KMaxPacketService>,KMaxPhones>,KMaxServers> TPrimaryPacketContextStatusArray;						
       
   343 	typedef TFixedArray<TRefCountItem,KMaxPrimaryPacketContext> TPrimaryPacketContextRefs;
       
   344 	
       
   345 	// PrimaryPacketContextQoS
       
   346 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<RPacketQoS, KMaxPrimaryPacketContext>,
       
   347 					KMaxPacketService>,KMaxPhones>,KMaxServers> 	TPrimaryPacketContextQoSArray;
       
   348 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TSessionStatus, KMaxPrimaryPacketContext>,
       
   349 						KMaxPacketService>,KMaxPhones>,KMaxServers> TPrimaryPacketContextQoSStatusArray;
       
   350 	typedef TFixedArray<TRefCountItem,KMaxPrimaryPacketContext> TPrimaryPacketContextQoSRefs;
       
   351 						
       
   352 						
       
   353 	// SecondaryPacketContext
       
   354 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TFixedArray<RPacketContext, KMaxSecondaryPacketContext>,
       
   355 							KMaxPrimaryPacketContext>,KMaxPacketService>,KMaxPhones>,KMaxServers> 	
       
   356 			TSecondaryPacketContextArray;
       
   357 														
       
   358 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxSecondaryPacketContext>,
       
   359 							KMaxPrimaryPacketContext>,KMaxPacketService>,KMaxPhones>,KMaxServers> 
       
   360 			TSecondaryPacketContextStatusArray;						
       
   361 			
       
   362 	typedef TFixedArray<TFixedArray<TRefCountItem,KMaxSecondaryPacketContext>,
       
   363 										KMaxPrimaryPacketContext> TSecondaryPacketContextRefs;
       
   364 										
       
   365 	// SecondaryPacketContextQoS
       
   366 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TFixedArray<RPacketQoS, KMaxSecondaryPacketContext>,
       
   367 							KMaxPrimaryPacketContext>,KMaxPacketService>,KMaxPhones>,KMaxServers> 	
       
   368 			TSecondaryPacketContextQoSArray;
       
   369 														
       
   370 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxSecondaryPacketContext>,
       
   371 							KMaxPrimaryPacketContext>,KMaxPacketService>,KMaxPhones>,KMaxServers> 
       
   372 			TSecondaryPacketContextQoSStatusArray;						
       
   373 
       
   374 	typedef TFixedArray<TFixedArray<TRefCountItem,KMaxSecondaryPacketContext>,
       
   375 								KMaxPrimaryPacketContext> TSecondaryPacketContextQoSRefs;
       
   376 
       
   377 	// ON store
       
   378 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileONStore,KMaxONStore>,KMaxPhones>,KMaxServers> 	TONStoreArray;
       
   379 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxONStore>,KMaxPhones>,KMaxServers> 	TONStoreStatusArray;
       
   380 
       
   381 	// EN Store
       
   382 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileENStore,KMaxENStore>,KMaxPhones>,KMaxServers> 	TENStoreArray;
       
   383 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxENStore>,KMaxPhones>,KMaxServers> 	TENStoreStatusArray;
       
   384 	
       
   385 
       
   386 	// Phone book
       
   387 	typedef TFixedArray<TFixedArray<TFixedArray<RMobilePhoneBookStore,KMaxPhoneBookStore>,KMaxPhones>,KMaxServers> 	TPhoneBookStoreArray;
       
   388 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxPhoneBookStore>,KMaxPhones>,KMaxServers> 	TPhoneBookStoreStatusArray;
       
   389 	
       
   390 	// SMS messaging
       
   391 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileSmsMessaging,KMaxSmsMessaging>,KMaxPhones>,KMaxServers> 	TSmsMessagingArray;
       
   392 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxSmsMessaging>,KMaxPhones>,KMaxServers> 	TSmsMessagingStatusArray;
       
   393 	
       
   394 	// SMS store
       
   395 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray
       
   396 										<RMobileSmsStore,KMaxSmsStore>,KMaxSmsMessaging>, KMaxPhones>,KMaxServers> 	TSmsStoreArray;
       
   397 	typedef TFixedArray<TFixedArray<TFixedArray<TFixedArray
       
   398 										<TSessionStatus,KMaxSmsStore>,KMaxSmsMessaging>, KMaxPhones>,KMaxServers> 	TSmsStoreStatusArray;
       
   399 	
       
   400 	// Broadcast messaging
       
   401 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileBroadcastMessaging,KMaxBroadcastMessaging>,KMaxPhones>,KMaxServers> 	TBroadcastMessagingArray;
       
   402 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxBroadcastMessaging>,KMaxPhones>,KMaxServers> 	TBroadcastMessagingStatusArray;
       
   403 	
       
   404 	// Ussd messaging
       
   405 	typedef TFixedArray<TFixedArray<TFixedArray<RMobileUssdMessaging,KMaxUssdMessaging>,
       
   406 								KMaxPhones>,KMaxServers> 	TUssdMessagingArray;
       
   407 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxUssdMessaging>,KMaxPhones>,KMaxServers> 	TUssdMessagingStatusArray;
       
   408 
       
   409     // Custom API
       
   410     typedef TFixedArray<TFixedArray<TFixedArray<RMmCustomAPI,KMaxCustomApi>,
       
   411 								KMaxPhones>,KMaxServers> 	TCustomApiArray;
       
   412 	typedef TFixedArray<TFixedArray<TFixedArray<TSessionStatus,KMaxCustomApi>,KMaxPhones>,KMaxServers> 	TCustomApiStatusArray;
       
   413 
       
   414 
       
   415 	TTelServerArray 			iTelServers;
       
   416 	TTelServerStatusArray 		iTelServersStatus;
       
   417 	
       
   418 	TPhoneArray					iPhones;
       
   419 	TPhoneStatusArray 			iPhonesStatus;
       
   420 	
       
   421 	TLineArray    				iLines;
       
   422 	TLineStatusArray 			iLinesStatus;
       
   423 
       
   424 	TCallArray    				iCalls;
       
   425 	TCallStatusArray 			iCallsStatus;
       
   426 	TCallRefArray				iCallsRefs;
       
   427 
       
   428 	TConferenceCallArray		iConferenceCalls;
       
   429 	TConferenceCallStatusArray	iConferenceCallsStatus;
       
   430 	
       
   431 	TFaxArray					iFaxes;
       
   432 	TFaxStatusArray				iFaxesStatus;
       
   433 	
       
   434 	TPacketServiceArray			iPacketServices;
       
   435 	TPacketServiceStatusArray	iPacketServicesStatus;
       
   436 	
       
   437 	TPrimaryPacketContextArray			iPrimaryPacketContexts;
       
   438 	TPrimaryPacketContextStatusArray	iPrimaryPacketContextsStatus;
       
   439 	TPrimaryPacketContextRefs			iPrimaryPacketContextRefs;
       
   440 	
       
   441 	TPrimaryPacketContextQoSArray		iPrimaryPacketContextQoSs;
       
   442 	TPrimaryPacketContextQoSStatusArray	iPrimaryPacketContextQoSsStatus;
       
   443 	TPrimaryPacketContextQoSRefs		iPrimaryPacketContextQoSRefs;
       
   444 	
       
   445 	TSecondaryPacketContextArray		iSecondaryPacketContexts;
       
   446 	TSecondaryPacketContextStatusArray	iSecondaryPacketContextsStatus;
       
   447 	TSecondaryPacketContextRefs			iSecondaryPacketContextRefs;
       
   448 	
       
   449 	TSecondaryPacketContextQoSArray			iSecondaryPacketContextQoSs;
       
   450 	TSecondaryPacketContextQoSStatusArray	iSecondaryPacketContextQoSsStatus;
       
   451 	TSecondaryPacketContextQoSRefs			iSecondaryPacketContextQoSRefs;
       
   452 		
       
   453 	TONStoreArray				iONStores;
       
   454 	TONStoreStatusArray			iONStoresStatus;
       
   455 	
       
   456 	TENStoreArray				iENStores;
       
   457 	TENStoreStatusArray			iENStoresStatus;
       
   458 	
       
   459 	TPhoneBookStoreArray		iPhoneBookStores;
       
   460 	TPhoneBookStoreStatusArray	iPhoneBookStoresStatus;
       
   461 	
       
   462 
       
   463 	TFixedArray< TBuf<64>,KMaxPhoneBookStore> iPhoneBookStoreNames;
       
   464 	
       
   465 	TSmsStoreArray			iSmsStores;
       
   466 	TSmsStoreStatusArray	iSmsStoresStatus;
       
   467 	TFixedArray<const TDesC*, KMaxSmsStore> iSmsStoreNames;
       
   468 	
       
   469 	TSmsMessagingArray			iSmsMessagings;
       
   470 	TSmsMessagingStatusArray	iSmsMessagingsStatus;
       
   471 	
       
   472 	TBroadcastMessagingArray		iBroadcastMessagings;
       
   473 	TBroadcastMessagingStatusArray	iBroadcastMessagingsStatus;
       
   474 	
       
   475 	TUssdMessagingArray			iUssdMessagings;
       
   476 	TUssdMessagingStatusArray	iUssdMessagingsStatus;
       
   477 
       
   478     TCustomApiArray         iCustomApis;
       
   479     TCustomApiStatusArray   iCustomApisStatus;
       
   480 		
       
   481 private: // config data
       
   482 	TName& iTsyName;
       
   483 	TName& iPhoneName;
       
   484 	TBool iKeepSessOpen;
       
   485 	TBool iHaveLineNames;
       
   486 	TFixedArray<TName,KMaxLines> iLinesName;
       
   487 	
       
   488 	// Threshold below which sessions are closed by CloseXXXSessL and related methods
       
   489 	TSessionStatus iStatusCloseThresh;
       
   490 
       
   491 private:
       
   492 	CEtelSessionMgr(TName& aTsyName, TName& aPhoneName, TBool aKeepSessOpen);
       
   493 	void ConstructL();
       
   494 		
       
   495 private: 
       
   496 	void DoOpenAutoSessL();
       
   497 	void DoCloseAllSessL(TBool aIncludeAutoOpenedSess);
       
   498 	void ClosePhoneSessL(TServerId aServerId, TPhoneId aPhoneId );
       
   499 	void CloseLineSessL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId );
       
   500 	void CloseCallSessL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId );
       
   501 	void CloseFaxSessL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId );
       
   502 	
       
   503 	void CloseConfCallSessL(TServerId aServerId, TPhoneId aPhoneId,TConferenceCallId aConfCallId );
       
   504 	void ClosePacketServiceSessL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId );
       
   505 
       
   506 	void ClosePacketServiceContextSessL(TServerId aServerId, TPhoneId aPhoneId, 
       
   507 												TPacketServiceId aPacketServiceId, 
       
   508 												TPrimaryPacketContextId aContextId );
       
   509 
       
   510 
       
   511 	void ClosePhoneBookStoreSessL(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookId );
       
   512 	void CloseENStoreSessL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId );
       
   513 	void CloseONStoreSessL(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId );
       
   514 	void CloseSmsMessagingSessL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId );
       
   515 	void CloseSmsStoreSessL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMsgId, TSmsStoreId aSmsStoreId );
       
   516 	void CloseBroadcastMessagingSessL(TServerId aServerId, TPhoneId aPhoneId, 
       
   517 														TBroadcastMessagingId aBcastMessagingId );
       
   518     void CloseUssdMessagingSessL(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId );
       
   519     void CloseCustomApiSessL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId);
       
   520 
       
   521 	void DoCleanup();
       
   522 
       
   523 	void DoOpenServerL(TServerId aServerId);
       
   524 	void DoCloseServerL(TServerId aServerId);
       
   525 
       
   526 	void DoOpenPhoneL(TServerId aServerId, TPhoneId aPhoneId);
       
   527 	void DoClosePhoneL(TServerId aServerId, TPhoneId aPhoneId);
       
   528 
       
   529 	void DoOpenLineL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId);
       
   530 	void DoCloseLineL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId);
       
   531 
       
   532 	void DoOpenCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId);
       
   533 	void DoCloseCallL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId);
       
   534 
       
   535 	void DoOpenFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId);
       
   536 	void DoCloseFaxL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, TFaxId aFaxId);
       
   537 	
       
   538 	void DoOpenConferenceCallL(TServerId aServerId, TPhoneId aPhoneId, TConferenceCallId aConferenceCallId);
       
   539 	void DoCloseConferenceCallL(TServerId aServerId, TPhoneId aPhoneId, TConferenceCallId aConferenceCallId);
       
   540 	
       
   541 	void DoOpenPacketServiceL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId);
       
   542 	void DoClosePacketServiceL(TServerId aServerId, TPhoneId aPhoneId, TPacketServiceId aPacketServiceId);
       
   543 	
       
   544 	void DoOpenPrimaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId, 
       
   545 										TPacketServiceId aPacketServiceId, 
       
   546 										TPrimaryPacketContextId aPrimaryPacketContextId );
       
   547 	void DoClosePrimaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId, 
       
   548 										TPacketServiceId aPacketServiceId, 
       
   549 										TPrimaryPacketContextId aPacketContextId);
       
   550 
       
   551 	void DoOpenPrimaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId, 
       
   552 										TPacketServiceId aPacketServiceId, 
       
   553 										TPrimaryPacketContextId aPrimaryPacketContextId );
       
   554 	void DoClosePrimaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId, 
       
   555 										TPacketServiceId aPacketServiceId, 
       
   556 										TPrimaryPacketContextId aPacketContextId);										
       
   557 											
       
   558 	void DoOpenSecondaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId, 
       
   559 										TPacketServiceId aPacketServiceId, 
       
   560 										TPrimaryPacketContextId aPrimaryPacketContextId,
       
   561 										TSecondaryPacketContextId aSecondaryPacketContextId );
       
   562 	void DoCloseSecondaryPacketContextL(TServerId aServerId, TPhoneId aPhoneId, 
       
   563 										TPacketServiceId aPacketServiceId, 
       
   564 										TPrimaryPacketContextId aPrimaryPacketContextId,
       
   565 										TSecondaryPacketContextId aSecondaryPacketContextId );
       
   566 										
       
   567 
       
   568 	void DoOpenSecondaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId, 
       
   569 										TPacketServiceId aPacketServiceId, 
       
   570 										TPrimaryPacketContextId aPrimaryPacketContextId,
       
   571 										TSecondaryPacketContextId aSecondaryPacketContextId );
       
   572 	void DoCloseSecondaryPacketContextQoSL(TServerId aServerId, TPhoneId aPhoneId, 
       
   573 										TPacketServiceId aPacketServiceId, 
       
   574 										TPrimaryPacketContextId aPrimaryPacketContextId,
       
   575 										TSecondaryPacketContextId aSecondaryPacketContextId );
       
   576 
       
   577 	void DoOpenONStoreL(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId);
       
   578 	void DoCloseONStoreL(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aONStoreId);
       
   579 	
       
   580 	void DoOpenENStoreL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId);
       
   581 	void DoCloseENStoreL(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aENStoreId);
       
   582 	
       
   583 	void DoOpenPhoneBookStoreL(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId);
       
   584 	void DoClosePhoneBookStoreL(TServerId aServerId, TPhoneId aPhoneId, TPhoneBookStoreId aPhoneBookStoreId);
       
   585 
       
   586 	void DoOpenSmsStoreL(TServerId aServerId, TPhoneId aPhoneId, 
       
   587 													TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId);
       
   588 	void DoCloseSmsStoreL(TServerId aServerId, TPhoneId aPhoneId, 
       
   589 													TSmsMessagingId aSmsMessagingId, TSmsStoreId aSmsStoreId);
       
   590 
       
   591 	void DoOpenSmsMessagingL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId);
       
   592 	void DoCloseSmsMessagingL(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMessagingId);
       
   593 	
       
   594 	void DoOpenBroadcastMessagingL(TServerId aServerId, TPhoneId aPhoneId, 
       
   595 										TBroadcastMessagingId aBroadcastMessagingId);
       
   596 	void DoCloseBroadcastMessagingL(TServerId aServerId, TPhoneId aPhoneId, 
       
   597 										TBroadcastMessagingId aBroadcastMessagingId);
       
   598 	
       
   599 	void DoOpenUssdMessagingL(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId);
       
   600 	void DoCloseUssdMessagingL(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMessagingId);
       
   601 
       
   602     void DoOpenCustomApiL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId);
       
   603     void DoCloseCustomApiL(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId);
       
   604 
       
   605 	void DoAssignCallToIncomingL(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId, const TName& aIncomingCallName);
       
   606 		
       
   607 private: // helpers
       
   608 	void DoGetLineNamesL(RPhone& aPhone);
       
   609 
       
   610 	// Generated cleanup methods
       
   611 
       
   612 	static void CleanupMobileBroadcastMessagingNotifyBroadcastIdListChange( 
       
   613 					RMobileBroadcastMessaging& aMobileBroadcastMessaging );
       
   614 
       
   615 	static void CleanupMobileBroadcastMessagingNotifyFilterSettingChange( 
       
   616 					RMobileBroadcastMessaging& aMobileBroadcastMessaging );
       
   617 
       
   618 	static void CleanupMobileBroadcastMessagingNotifyLanguageFilterChange( 
       
   619 					RMobileBroadcastMessaging& aMobileBroadcastMessaging );
       
   620 
       
   621 	static void CleanupMobileLineNotifyMobileLineStatusChange( 
       
   622 					RMobileLine& aMobileLine );
       
   623 
       
   624 	static void CleanupMobilePhoneNotifyALSLineChange( 
       
   625 					RMobilePhone& aMobilePhone );
       
   626 
       
   627 	static void CleanupMobilePhoneNotifyAlternatingCallCapsChange( 
       
   628 					RMobilePhone& aMobilePhone );
       
   629 
       
   630 	static void CleanupMobilePhoneNotifyAlternatingCallModeChange( 
       
   631 					RMobilePhone& aMobilePhone );
       
   632 
       
   633 	static void CleanupMobilePhoneNotifyCCBSRecall( 
       
   634 					RMobilePhone& aMobilePhone );
       
   635 
       
   636 	static void CleanupMobilePhoneNotifyCCBSRecall1( 
       
   637 					RMobilePhone& aMobilePhone );
       
   638 
       
   639 	static void CleanupMobilePhoneNotifyCCBSStatusChange( 
       
   640 					RMobilePhone& aMobilePhone );
       
   641 
       
   642 	static void CleanupMobilePhoneNotifyCallBarringStatusChange( 
       
   643 					RMobilePhone& aMobilePhone );
       
   644 
       
   645 	static void CleanupMobilePhoneNotifyCallForwardingActive( 
       
   646 					RMobilePhone& aMobilePhone );
       
   647 
       
   648 	static void CleanupMobilePhoneNotifyCallForwardingStatusChange( 
       
   649 					RMobilePhone& aMobilePhone );
       
   650 
       
   651 	static void CleanupMobilePhoneNotifyCallServiceCapsChange( 
       
   652 					RMobilePhone& aMobilePhone );
       
   653 
       
   654 	static void CleanupMobilePhoneNotifyCallWaitingStatusChange( 
       
   655 					RMobilePhone& aMobilePhone );
       
   656 
       
   657 	static void CleanupMobilePhoneNotifyCipheringIndicatorStatus( 
       
   658 					RMobilePhone& aMobilePhone );
       
   659 
       
   660 	static void CleanupMobilePhoneNotifyCostCapsChange( 
       
   661 					RMobilePhone& aMobilePhone );
       
   662 
       
   663 	static void CleanupMobilePhoneNotifyDTMFCapsChange( 
       
   664 					RMobilePhone& aMobilePhone );
       
   665 
       
   666 	static void CleanupMobilePhoneNotifyDTMFEvent( 
       
   667 					RMobilePhone& aMobilePhone );
       
   668 
       
   669 	static void CleanupMobilePhoneNotifyFdnStatusChange( 
       
   670 					RMobilePhone& aMobilePhone );
       
   671 
       
   672 	static void CleanupMobilePhoneNotifyIccAccessCapsChange( 
       
   673 					RMobilePhone& aMobilePhone );
       
   674 
       
   675 	static void CleanupMobilePhoneNotifyIdentityServiceStatus( 
       
   676 					RMobilePhone& aMobilePhone );
       
   677 
       
   678 	static void CleanupMobilePhoneNotifyIdentitySuppressionRejected( 
       
   679 					RMobilePhone& aMobilePhone );
       
   680 
       
   681 	static void CleanupMobilePhoneNotifyIncomingCallTypeChange( 
       
   682 					RMobilePhone& aMobilePhone );
       
   683 
       
   684 	static void CleanupMobilePhoneNotifyIndicatorChange( 
       
   685 					RMobilePhone& aMobilePhone );
       
   686 
       
   687 	static void CleanupMobilePhoneNotifyMessageWaiting( 
       
   688 					RMobilePhone& aMobilePhone );
       
   689 
       
   690 	static void CleanupMobilePhoneNotifyModeChange( 
       
   691 					RMobilePhone& aMobilePhone );
       
   692 
       
   693 	static void CleanupMobilePhoneNotifyMulticallIndicatorChange( 
       
   694 					RMobilePhone& aMobilePhone );
       
   695 
       
   696 	static void CleanupMobilePhoneNotifyMulticallParamsChange( 
       
   697 					RMobilePhone& aMobilePhone );
       
   698 
       
   699 	static void CleanupMobilePhoneNotifyMultimediaCallPreferenceChange( 
       
   700 					RMobilePhone& aMobilePhone );
       
   701 
       
   702 	static void CleanupMobilePhoneNotifyNetworkInvScanChange( 
       
   703 					RMobilePhone& aMobilePhone );
       
   704 
       
   705 	static void CleanupMobilePhoneNotifyNetworkInvScanEvent( 
       
   706 					RMobilePhone& aMobilePhone );
       
   707 
       
   708 	static void CleanupMobilePhoneNotifyNetworkRegistrationStatusChange( 
       
   709 					RMobilePhone& aMobilePhone );
       
   710 
       
   711 	static void CleanupMobilePhoneNotifyNetworkSecurityLevelChange( 
       
   712 					RMobilePhone& aMobilePhone );
       
   713 
       
   714 	static void CleanupMobilePhoneNotifySecurityCapsChange( 
       
   715 					RMobilePhone& aMobilePhone );
       
   716 
       
   717 	static void CleanupMobilePhoneNotifySecurityEvent( 
       
   718 					RMobilePhone& aMobilePhone );
       
   719 
       
   720 	static void CleanupMobilePhoneNotifySendNetworkServiceRequest( 
       
   721 					RMobilePhone& aMobilePhone );
       
   722 
       
   723 	static void CleanupMobilePhoneNotifySignalStrengthChange( 
       
   724 					RMobilePhone& aMobilePhone );
       
   725 
       
   726 	static void CleanupMobilePhoneNotifyPreferredNetworksListChange( 
       
   727 					RMobilePhone& aMobilePhone );
       
   728 
       
   729 	static void CleanupMobilePhoneNotifyStopInDTMFString( 
       
   730 					RMobilePhone& aMobilePhone );
       
   731 
       
   732 	static void CleanupMobilePhoneNotifyAirTimeDurationChange( 
       
   733 					RMobilePhone& aMobilePhone );
       
   734 
       
   735 	static void CleanupMobilePhoneNotifyCostInfoChange( 
       
   736 					RMobilePhone& aMobilePhone );
       
   737 
       
   738 	static void CleanupMobilePhoneNotifyCurrentNetworkChange( 
       
   739 					RMobilePhone& aMobilePhone );
       
   740 
       
   741 	static void CleanupMobilePhoneNotifyCurrentNetworkChange1( 
       
   742 					RMobilePhone& aMobilePhone );
       
   743 
       
   744 	static void CleanupMobilePhoneNotifyCurrentNetworkChange2( 
       
   745 					RMobilePhone& aMobilePhone );
       
   746 
       
   747 	static void CleanupMobilePhoneNotifyCurrentNetworkChange3( 
       
   748 					RMobilePhone& aMobilePhone );
       
   749 
       
   750 	static void CleanupMobilePhoneNotifyCurrentNetworkChange4( 
       
   751 					RMobilePhone& aMobilePhone );
       
   752 
       
   753 	static void CleanupMobilePhoneNotifyCurrentNetworkChange5( 
       
   754 					RMobilePhone& aMobilePhone );
       
   755 
       
   756 	static void CleanupMobilePhoneNotifyLockInfoChange( 
       
   757 					RMobilePhone& aMobilePhone );
       
   758 
       
   759 	static void CleanupMobilePhoneNotifyNITZInfoChange( 
       
   760 					RMobilePhone& aMobilePhone );
       
   761 
       
   762 	static void CleanupMobilePhoneNotifyNetworkSelectionSettingChange( 
       
   763 					RMobilePhone& aMobilePhone );
       
   764 
       
   765 	static void CleanupMobilePhoneNotifySecurityCodeInfoChange( 
       
   766 					RMobilePhone& aMobilePhone );
       
   767 
       
   768 	static void CleanupMobilePhoneNotifyUSimApplicationsInfoChange( 
       
   769 					RMobilePhone& aMobilePhone );
       
   770 
       
   771 	static void CleanupMobilePhoneNotifyUSimAppsSelectionModeChange( 
       
   772 					RMobilePhone& aMobilePhone );
       
   773 
       
   774 	static void CleanupMobilePhoneNotifyUUSSettingChange( 
       
   775 					RMobilePhone& aMobilePhone );
       
   776 
       
   777 	static void CleanupMobilePhoneNotifyIccMessageWaitingIndicatorsChange( 
       
   778 					RMobilePhone& aMobilePhone );
       
   779 
       
   780 	static void CleanupMobilePhoneNotifyMmsConfig( 
       
   781 					RMobilePhone& aMobilePhone );
       
   782 
       
   783 	static void CleanupMobilePhoneNotifyMmsUpdate( 
       
   784 					RMobilePhone& aMobilePhone );
       
   785 
       
   786 	static void CleanupMobilePhoneNotifyBatteryInfoChange( 
       
   787 					RMobilePhone& aMobilePhone );
       
   788 
       
   789 	static void CleanupMobilePhoneNotifyImsAuthorizationInfoChange( 
       
   790 					RMobilePhone& aMobilePhone );
       
   791 
       
   792 	static void CleanupMobilePhoneNotifySmartCardApplicationInfoChange( 
       
   793 					RMobilePhone& aMobilePhone );
       
   794 
       
   795 	static void CleanupMobilePhoneNotifyDefaultPrivacyChange( 
       
   796 					RMobilePhone& aMobilePhone );
       
   797 
       
   798 	static void CleanupMobilePhoneNotifyAPNListChanged( 
       
   799 					RMobilePhone& aMobilePhone );
       
   800 
       
   801 	static void CleanupMobilePhoneNotifyAPNControlListServiceStatusChange( 
       
   802 					RMobilePhone& aMobilePhone );
       
   803 
       
   804 	static void CleanupMobilePhoneNotifyMailboxNumbersChange( 
       
   805 					RMobilePhone& aMobilePhone );
       
   806 
       
   807 	static void CleanupPacketQoSNotifyProfileChanged( 
       
   808 					RPacketQoS& aPacketQoS );
       
   809 
       
   810 	static void CleanupPacketQoSNotifyProfileChanged1( 
       
   811 					RPacketQoS& aPacketQoS );
       
   812 
       
   813 	static void CleanupPacketQoSNotifyProfileChanged2( 
       
   814 					RPacketQoS& aPacketQoS );
       
   815 
       
   816 	static void CleanupMobileSmartCardEapNotifyEapMethodAccessStatusChange( 
       
   817 					RMobileSmartCardEap& aMobileSmartCardEap );
       
   818 
       
   819 	static void CleanupMobileSmsMessagingNotifyMoSmsBearerChange( 
       
   820 					RMobileSmsMessaging& aMobileSmsMessaging );
       
   821 
       
   822 	static void CleanupMobileSmsMessagingNotifyReceiveModeChange( 
       
   823 					RMobileSmsMessaging& aMobileSmsMessaging );
       
   824 
       
   825 	static void CleanupMobileSmsMessagingNotifySmspListChange( 
       
   826 					RMobileSmsMessaging& aMobileSmsMessaging );
       
   827 
       
   828 	static void CleanupMobileCallNotifyAlternatingCallSwitch( 
       
   829 					RMobileCall& aMobileCall );
       
   830 
       
   831 	static void CleanupMobileCallNotifyAudioToneEvent( 
       
   832 					RMobileCall& aMobileCall );
       
   833 
       
   834 	static void CleanupMobileCallNotifyCallEvent( 
       
   835 					RMobileCall& aMobileCall );
       
   836 
       
   837 	static void CleanupMobileCallNotifyHscsdInfoChange( 
       
   838 					RMobileCall& aMobileCall );
       
   839 
       
   840 	static void CleanupMobileCallNotifyMobileCallCapsChange( 
       
   841 					RMobileCall& aMobileCall );
       
   842 
       
   843 	static void CleanupMobileCallNotifyMobileCallStatusChange( 
       
   844 					RMobileCall& aMobileCall );
       
   845 
       
   846 	static void CleanupMobileCallNotifyMobileDataCallCapsChange( 
       
   847 					RMobileCall& aMobileCall );
       
   848 
       
   849 	static void CleanupMobileCallNotifyUUSCapsChange( 
       
   850 					RMobileCall& aMobileCall );
       
   851 
       
   852 	static void CleanupMobileCallNotifyVoiceFallback( 
       
   853 					RMobileCall& aMobileCall );
       
   854 
       
   855 	static void CleanupMobileCallNotifyPrivacyConfirmation( 
       
   856 					RMobileCall& aMobileCall );
       
   857 
       
   858 	static void CleanupMobileCallNotifyTrafficChannelConfirmation( 
       
   859 					RMobileCall& aMobileCall );
       
   860 
       
   861 	static void CleanupMobileCallNotifyRemotePartyInfoChange( 
       
   862 					RMobileCall& aMobileCall );
       
   863 
       
   864 	static void CleanupLineNotifyCapsChange( 
       
   865 					RLine& aLine );
       
   866 
       
   867 	static void CleanupLineNotifyCallAdded( 
       
   868 					RLine& aLine );
       
   869 
       
   870 	static void CleanupLineNotifyHookChange( 
       
   871 					RLine& aLine );
       
   872 
       
   873 	static void CleanupLineNotifyStatusChange( 
       
   874 					RLine& aLine );
       
   875 
       
   876 	static void CleanupLineNotifyIncomingCall( 
       
   877 					RLine& aLine );
       
   878 
       
   879 	static void CleanupMobilePhoneStoreNotifyStoreEvent( 
       
   880 					RMobilePhoneStore& aMobilePhoneStore );
       
   881 
       
   882 	static void CleanupMobileConferenceCallNotifyCapsChange( 
       
   883 					RMobileConferenceCall& aMobileConferenceCall );
       
   884 
       
   885 	static void CleanupMobileConferenceCallNotifyConferenceEvent( 
       
   886 					RMobileConferenceCall& aMobileConferenceCall );
       
   887 
       
   888 	static void CleanupMobileConferenceCallNotifyConferenceStatusChange( 
       
   889 					RMobileConferenceCall& aMobileConferenceCall );
       
   890 
       
   891 	static void CleanupPacketContextNotifyConnectionSpeedChange( 
       
   892 					RPacketContext& aPacketContext );
       
   893 
       
   894 	static void CleanupPacketContextNotifyStatusChange( 
       
   895 					RPacketContext& aPacketContext );
       
   896 
       
   897 	static void CleanupPacketContextNotifyConfigChanged( 
       
   898 					RPacketContext& aPacketContext );
       
   899 
       
   900 	static void CleanupPacketContextNotifyConfigChanged1( 
       
   901 					RPacketContext& aPacketContext );
       
   902 
       
   903 	static void CleanupPacketContextNotifyConfigChanged2( 
       
   904 					RPacketContext& aPacketContext );
       
   905 
       
   906 	static void CleanupPacketContextNotifyDataTransferred( 
       
   907 					RPacketContext& aPacketContext );
       
   908 
       
   909 	static void CleanupMobileUssdMessagingNotifyNetworkRelease( 
       
   910 					RMobileUssdMessaging& aMobileUssdMessaging );
       
   911 
       
   912 	static void CleanupPacketServiceNotifyAttachModeChange( 
       
   913 					RPacketService& aPacketService );
       
   914 
       
   915 	static void CleanupPacketServiceNotifyChangeOfNtwkRegStatus( 
       
   916 					RPacketService& aPacketService );
       
   917 
       
   918 	static void CleanupPacketServiceNotifyContextActivationRequested( 
       
   919 					RPacketService& aPacketService );
       
   920 
       
   921 	static void CleanupPacketServiceNotifyContextActivationRequested1( 
       
   922 					RPacketService& aPacketService );
       
   923 
       
   924 	static void CleanupPacketServiceNotifyContextActivationRequested2( 
       
   925 					RPacketService& aPacketService );
       
   926 
       
   927 	static void CleanupPacketServiceNotifyContextAdded( 
       
   928 					RPacketService& aPacketService );
       
   929 
       
   930 	static void CleanupPacketServiceNotifyDynamicCapsChange( 
       
   931 					RPacketService& aPacketService );
       
   932 
       
   933 	static void CleanupPacketServiceNotifyMSClassChange( 
       
   934 					RPacketService& aPacketService );
       
   935 
       
   936 	static void CleanupPacketServiceNotifyReleaseModeChange( 
       
   937 					RPacketService& aPacketService );
       
   938 
       
   939 	static void CleanupPacketServiceNotifyStatusChange( 
       
   940 					RPacketService& aPacketService );
       
   941 
       
   942 	static void CleanupCallNotifyCapsChange( 
       
   943 					RCall& aCall );
       
   944 
       
   945 	static void CleanupCallNotifyCallDurationChange( 
       
   946 					RCall& aCall );
       
   947 
       
   948 	static void CleanupCallNotifyHookChange( 
       
   949 					RCall& aCall );
       
   950 
       
   951 	static void CleanupCallNotifyStatusChange( 
       
   952 					RCall& aCall );
       
   953 
       
   954 	static void CleanupPhoneNotifyCapsChange( 
       
   955 					RPhone& aPhone );
       
   956 
       
   957 	static void CleanupPhoneNotifyModemDetected( 
       
   958 					RPhone& aPhone );
       
   959 
       
   960 	static void CleanupMobileLocationServicesNotifyMtlr( 
       
   961 					RMobileLocationServices& aMobileLocationServices );
       
   962 
       
   963 	static void CleanupMobileLocationServicesNotifyMeasurementControl( 
       
   964 					RMobileLocationServices& aMobileLocationServices );
       
   965 
       
   966 	static void CleanupMmCustomAPINotifyAlsBlockedChanged( 
       
   967 					RMmCustomAPI& aMmCustomAPI );
       
   968 
       
   969 	static void CleanupMmCustomAPINotifyCellInfoChange( 
       
   970 					RMmCustomAPI& aMmCustomAPI );
       
   971 
       
   972 	static void CleanupMmCustomAPINotifyCipheringInfoChange( 
       
   973 					RMmCustomAPI& aMmCustomAPI );
       
   974 
       
   975 	static void CleanupMmCustomAPINotifyDtmfEvent( 
       
   976 					RMmCustomAPI& aMmCustomAPI );
       
   977 
       
   978 	static void CleanupMmCustomAPINotifyEGprsInfoChange( 
       
   979 					RMmCustomAPI& aMmCustomAPI );
       
   980 
       
   981 	static void CleanupMmCustomAPINotifyHSxPAStatus( 
       
   982 					RMmCustomAPI& aMmCustomAPI );
       
   983 
       
   984 	static void CleanupMmCustomAPINotifyIccCallForwardingStatusChange( 
       
   985 					RMmCustomAPI& aMmCustomAPI );
       
   986 
       
   987 	static void CleanupMmCustomAPINotifyNetworkConnectionFailure( 
       
   988 					RMmCustomAPI& aMmCustomAPI );
       
   989 
       
   990 	static void CleanupMmCustomAPINotifyNSPSStatus( 
       
   991 					RMmCustomAPI& aMmCustomAPI );
       
   992 
       
   993 	static void CleanupMmCustomAPINotifyPndCacheReady( 
       
   994 					RMmCustomAPI& aMmCustomAPI );
       
   995 
       
   996 	static void CleanupMmCustomAPINotifyProgrammableOperatorLogoChange( 
       
   997 					RMmCustomAPI& aMmCustomAPI );
       
   998 
       
   999 	static void CleanupMmCustomAPINotifyRauEvent( 
       
  1000 					RMmCustomAPI& aMmCustomAPI );
       
  1001 
       
  1002 	static void CleanupMmCustomAPINotifySimCardStatus( 
       
  1003 					RMmCustomAPI& aMmCustomAPI );
       
  1004 
       
  1005 	static void CleanupMmCustomAPINotifySsNetworkEvent( 
       
  1006 					RMmCustomAPI& aMmCustomAPI );
       
  1007 
       
  1008 	//
       
  1009 	//Session Cleanups 
       
  1010 	//
       
  1011 
       
  1012 	static void CleanupMobileBroadcastMessagingNotifiers( 
       
  1013 					RMobileBroadcastMessaging& aMobileBroadcastMessaging );
       
  1014 
       
  1015 	static void CleanupMobileLineNotifiers( 
       
  1016 					RMobileLine& aMobileLine );
       
  1017 
       
  1018 	static void CleanupMobilePhoneNotifiers( 
       
  1019 					RMobilePhone& aMobilePhone );
       
  1020 
       
  1021 	static void CleanupPacketQoSNotifiers( 
       
  1022 					RPacketQoS& aPacketQoS );
       
  1023 
       
  1024 	static void CleanupMobileSmartCardEapNotifiers( 
       
  1025 					RMobileSmartCardEap& aMobileSmartCardEap );
       
  1026 
       
  1027 	static void CleanupMobileSmsMessagingNotifiers( 
       
  1028 					RMobileSmsMessaging& aMobileSmsMessaging );
       
  1029 
       
  1030 	static void CleanupMobileCallNotifiers( 
       
  1031 					RMobileCall& aMobileCall );
       
  1032 
       
  1033 	static void CleanupLineNotifiers( 
       
  1034 					RLine& aLine );
       
  1035 
       
  1036 	static void CleanupMobilePhoneStoreNotifiers( 
       
  1037 					RMobilePhoneStore& aMobilePhoneStore );
       
  1038 
       
  1039 	static void CleanupMobileConferenceCallNotifiers( 
       
  1040 					RMobileConferenceCall& aMobileConferenceCall );
       
  1041 
       
  1042 	static void CleanupPacketContextNotifiers( 
       
  1043 					RPacketContext& aPacketContext );
       
  1044 
       
  1045 	static void CleanupMobileUssdMessagingNotifiers( 
       
  1046 					RMobileUssdMessaging& aMobileUssdMessaging );
       
  1047 
       
  1048 	static void CleanupPacketServiceNotifiers( 
       
  1049 					RPacketService& aPacketService );
       
  1050 
       
  1051 	static void CleanupCallNotifiers( 
       
  1052 					RCall& aCall );
       
  1053 
       
  1054 	static void CleanupPhoneNotifiers( 
       
  1055 					RPhone& aPhone );
       
  1056 
       
  1057 	static void CleanupMobileLocationServicesNotifiers( 
       
  1058 					RMobileLocationServices& aMobileLocationServices );
       
  1059 
       
  1060 	static void CleanupCustomAPINotifiers( 
       
  1061 					RMmCustomAPI& aMmCustomAPI );
       
  1062 
       
  1063 	// End of generated cleanup methods
       
  1064 	
       
  1065 	void TidyPhoneNotifiers(TServerId aServerId, TPhoneId aPhoneId);
       
  1066 	
       
  1067 	void TidyLineNotifiers(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId );
       
  1068 	
       
  1069 	void TidyCallNotifiers(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, TCallId aCallId );
       
  1070 	
       
  1071 	void TidyFaxNotifiers(TServerId aServerId, TPhoneId aPhoneId, TLineId aLineId, 
       
  1072 											TCallId aCallId, TFaxId aFaxId );
       
  1073 											
       
  1074 	void TidyConfCallNotifiers(TServerId aServerId, TPhoneId aPhoneId, TConferenceCallId aConfCallId );
       
  1075 	
       
  1076 	void TidyPacketServiceNotifiers(TServerId aServerId, TPhoneId aPhoneId, 
       
  1077 												TPacketServiceId aPacketServiceId );
       
  1078 												
       
  1079 	void TidyPacketServiceContextNotifiers(TServerId aServerId, TPhoneId aPhoneId, 
       
  1080 												TPacketServiceId aPacketServiceId, 
       
  1081 												TPrimaryPacketContextId aContextId);
       
  1082 												
       
  1083 	void TidyPhoneBookStoreNotifiers(TServerId aServerId, TPhoneId aPhoneId, 
       
  1084 													TPhoneBookStoreId aPhoneBookId );
       
  1085 													
       
  1086 	void TidyENStoreNotifiers(TServerId aServerId, TPhoneId aPhoneId, TENStoreId aEnStoreId );
       
  1087 	
       
  1088 	void TidyONStoreNotifiers(TServerId aServerId, TPhoneId aPhoneId, TONStoreId aOnStoreId );
       
  1089 	
       
  1090 	void TidySmsMessagingNotifiers(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMsgId );
       
  1091 	
       
  1092 	void TidySmsStoreNotifiers(TServerId aServerId, TPhoneId aPhoneId, TSmsMessagingId aSmsMsgId, 
       
  1093 													TSmsStoreId aSmsStoreId );
       
  1094 	
       
  1095 	void TidyBroadcastMessagingNotifiers(TServerId aServerId, TPhoneId aPhoneId, 
       
  1096 														TBroadcastMessagingId aBcastMsgId );
       
  1097 	
       
  1098 	void TidyUssdMessagingNotifiers(TServerId aServerId, TPhoneId aPhoneId, TUssdMessagingId aUssdMsgId );
       
  1099 
       
  1100     void TidyCustomApiNotifiers(TServerId aServerId, TPhoneId aPhoneId, TCustomApiId aCustomApiId);
       
  1101 
       
  1102 	void CleanupPhoneService();
       
  1103 	void CleanupPacketService();
       
  1104 	
       
  1105 	
       
  1106 	}; // class CEtelSessionMgr
       
  1107 
       
  1108 inline TBool CEtelSessionMgr::HasLine(TLineId aLineId)
       
  1109 	{
       
  1110 	return iLinesName[aLineId].Length() > 0;
       
  1111 	}
       
  1112 
       
  1113 inline TDesC& CEtelSessionMgr::PhoneName()
       
  1114 	{
       
  1115 	return iPhoneName;
       
  1116 	}
       
  1117 
       
  1118 #endif // CETELSESSIONMGR_H