telephonyserver/etelmultimode/DTsy/coretsy.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-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 //
       
    15 
       
    16 #include "coretsy.H"
       
    17 #include "testdef.h"
       
    18 
       
    19 //#include "etelmm.h"
       
    20 
       
    21 #include <et_clsvr.h>
       
    22 
       
    23 void TsyPanic(TTsyPanic aPanic)
       
    24 	{
       
    25 	_LIT(KTsyPanic,"Tsy Panic");
       
    26 	User::Panic(KTsyPanic,aPanic);
       
    27 	}
       
    28 
       
    29 TTsyTimer::TTsyTimer()
       
    30 	{
       
    31 	iPending=EFalse;
       
    32 	}
       
    33 
       
    34 /*******************************************************************/
       
    35 //
       
    36 // CFaxDummyBase & CFaxDmmTsy
       
    37 //
       
    38 /*******************************************************************/
       
    39 
       
    40 //	CFaxDmmTsy
       
    41 
       
    42 CFaxDMmTsy* CFaxDMmTsy::NewL(CPhoneFactoryDummyBase* aFac)
       
    43 	{
       
    44 	CFaxDMmTsy* fax=new(ELeave) CFaxDMmTsy(aFac);
       
    45 	CleanupStack::PushL(fax);
       
    46 	fax->ConstructL();
       
    47 	CleanupStack::Pop();
       
    48 	return fax;
       
    49 	}
       
    50 
       
    51 CFaxDMmTsy::CFaxDMmTsy(CPhoneFactoryDummyBase* aFac)
       
    52 	:CFaxDummyBase(aFac)
       
    53 	{}
       
    54 
       
    55 void CFaxDMmTsy::ConstructL()
       
    56 	{
       
    57 	TInt r = iChunk.CreateGlobal(KNullDesC,sizeof (RFax::TProgress), sizeof (RFax::TProgress),EOwnerProcess); 
       
    58 	if (r == KErrNone)
       
    59 		{
       
    60 		RFax::TProgress* progress = new(iChunk.Base()) RFax::TProgress;
       
    61 		progress->iLastUpdateTime = 0;
       
    62 		progress->iAnswerback.Zero ();
       
    63 		progress->iPhase = ENotYetStarted;
       
    64 		progress->iSpeed = 9600;
       
    65 		progress->iResolution = EFaxNormal;
       
    66 		progress->iCompression = EModifiedHuffman;
       
    67 		progress->iECM = 0;
       
    68  		progress->iPage = 0;
       
    69 		progress->iLines = 0;
       
    70 		}	
       
    71 	else
       
    72 		User::Leave(r);
       
    73 	}
       
    74 
       
    75 CFaxDMmTsy::~CFaxDMmTsy()
       
    76 	{
       
    77 	iChunk.Close();
       
    78 	}
       
    79 RHandleBase* CFaxDMmTsy::GlobalKernelObjectHandle()
       
    80 	{
       
    81 		return &iChunk;
       
    82 		
       
    83 	}
       
    84 
       
    85 
       
    86 TInt CFaxDMmTsy::RegisterNotification(const TInt /*aIpc*/)
       
    87 	{
       
    88 	return KErrNotSupported;
       
    89 	}
       
    90 
       
    91 TInt CFaxDMmTsy::DeregisterNotification(const TInt /*aIpc*/)
       
    92 	{
       
    93 	return KErrNotSupported;
       
    94 	}
       
    95 
       
    96 /*
       
    97 TInt CFaxDMmTsy::NumberOfSlotsL(const TInt)
       
    98 	{
       
    99 	return KErrNotSupported;
       
   100 	}
       
   101 */
       
   102 
       
   103 //	CFaxDummyBase
       
   104 CFaxDummyBase::CFaxDummyBase(CPhoneFactoryDummyBase* aFac)
       
   105 	{
       
   106 	iFac=aFac;
       
   107 	}
       
   108 
       
   109 CFaxDummyBase::~CFaxDummyBase()
       
   110 	{
       
   111 	iFac->RemoveTimer(iRead);
       
   112 	iFac->RemoveTimer(iWrite);
       
   113 	iFac->RemoveTimer(iWaitForEndOfPage);
       
   114 	iFac->RemoveTimer(iProgressNotification);
       
   115 	}
       
   116 
       
   117 CFaxDummyBase* CFaxDummyBase::This(TAny* aPtr)
       
   118 	{
       
   119 	return REINTERPRET_CAST(CFaxDummyBase*,aPtr);
       
   120 	}
       
   121 
       
   122 
       
   123 TInt CFaxDummyBase::WaitForEndOfPageHandler(TAny* aPtr)
       
   124 	{
       
   125 	This(aPtr)->iFac->ResetPending( This(aPtr)->iWaitForEndOfPage);
       
   126 	This(aPtr)->ReqCompleted(This(aPtr)->iWaitForEndOfPage.iTsyReqHandle,KErrNone);
       
   127 	return KErrNone;
       
   128 	}
       
   129 
       
   130 TInt CFaxDummyBase::WaitForEndOfPage(const TTsyReqHandle aTsyReqHandle)
       
   131 	{
       
   132 	iFac->QueueTimer(iWaitForEndOfPage,aTsyReqHandle,DMMTSY_TIMEOUT,CFaxDummyBase::WaitForEndOfPageHandler,this);
       
   133 	return KErrNone;
       
   134 	}
       
   135 
       
   136 TInt CFaxDummyBase::Read(const TTsyReqHandle aTsyReqHandle,TDes8* aDes)
       
   137 	{
       
   138 	iReadParams=aDes;
       
   139 	iFac->QueueTimer(iRead,aTsyReqHandle,DMMTSY_TIMEOUT,CFaxDummyBase::ReadHandler,this);
       
   140 	return KErrNone;
       
   141 	}
       
   142 
       
   143 TInt CFaxDummyBase::ReadHandler(TAny* aPtr)
       
   144 	{
       
   145 	This(aPtr)->iReadParams->Copy(DMMTSY_FAX_DATA);
       
   146 	This(aPtr)->iFac->ResetPending( This(aPtr)->iRead);
       
   147 	This(aPtr)->ReqCompleted(This(aPtr)->iRead.iTsyReqHandle,KErrNone);
       
   148 	return KErrNone;
       
   149 	}
       
   150 
       
   151 TInt CFaxDummyBase::TerminateFaxSession(const TTsyReqHandle aTsyReqHandle)
       
   152 	{
       
   153 	if (iFac->RemoveTimer(iRead))
       
   154 		ReqCompleted(iRead.iTsyReqHandle,KErrCancel);
       
   155 
       
   156 	if (iFac->RemoveTimer(iWrite))
       
   157 		ReqCompleted(iWrite.iTsyReqHandle,KErrCancel);
       
   158 
       
   159 	if (iFac->RemoveTimer(iWaitForEndOfPage))
       
   160 		ReqCompleted(iWaitForEndOfPage.iTsyReqHandle,KErrCancel);
       
   161 
       
   162 	if (iFac->RemoveTimer(iProgressNotification))
       
   163 		ReqCompleted(iProgressNotification.iTsyReqHandle,KErrCancel);
       
   164 
       
   165 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   166 	return KErrNone;
       
   167 	}
       
   168 
       
   169 TInt CFaxDummyBase::Write(const TTsyReqHandle aTsyReqHandle,TDesC8* aDes)
       
   170 	{
       
   171 	if (aDes->Compare(DMMTSY_FAX_DATA)!=KErrNone)
       
   172 		ReqCompleted(aTsyReqHandle,KErrEtelDataCorrupted);
       
   173 	else
       
   174 		iFac->QueueTimer(iWrite,aTsyReqHandle,DMMTSY_TIMEOUT,CFaxDummyBase::WriteHandler,this);
       
   175 	return KErrNone;
       
   176 	}
       
   177 
       
   178 TInt CFaxDummyBase::WriteHandler(TAny* aPtr)
       
   179 	{
       
   180 	This(aPtr)->iFac->ResetPending( This(aPtr)->iWrite);
       
   181 	This(aPtr)->ReqCompleted(This(aPtr)->iWrite.iTsyReqHandle,KErrNone);
       
   182 	return KErrNone;
       
   183 	}
       
   184 
       
   185 TInt CFaxDummyBase::GetProgress(const TTsyReqHandle aTsyReqHandle,RFax::TProgress* aProgress)
       
   186 	{
       
   187 	aProgress->iSpeed=DMMTSY_GET_PROGRESS_SPEED;
       
   188 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   189 	return KErrNone;
       
   190 	}
       
   191 
       
   192 TInt CFaxDummyBase::ProgressNotificationHandler(TAny* aPtr)
       
   193 	{
       
   194 	This(aPtr)->iFac->ResetPending( This(aPtr)->iProgressNotification);
       
   195 	This(aPtr)->ReqCompleted(This(aPtr)->iProgressNotification.iTsyReqHandle,KErrNone);
       
   196 	return KErrNone;
       
   197 	}
       
   198 
       
   199 TInt CFaxDummyBase::ProgressNotification(const TTsyReqHandle aTsyReqHandle, RFax::TProgress* aProgress)
       
   200 	{
       
   201 	iProgressNotificationParams=aProgress;
       
   202 	iFac->QueueTimer(iProgressNotification,aTsyReqHandle,DMMTSY_TIMEOUT,CFaxDummyBase::ProgressNotificationHandler,this);
       
   203 	return KErrNone;
       
   204 	}
       
   205 
       
   206 TInt CFaxDummyBase::ProgressNotificationCancel(const TTsyReqHandle aTsyReqHandle)
       
   207 	{
       
   208 	if(aTsyReqHandle==iProgressNotification.iTsyReqHandle)
       
   209 		{
       
   210 		iFac->RemoveTimer(iProgressNotification);
       
   211 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   212 		return KErrNone;
       
   213 		}
       
   214 	return KErrEtelNotRecognisedCancelHandle;
       
   215 	}
       
   216 
       
   217 /*******************************************************************/
       
   218 //
       
   219 // CCallDummyBase
       
   220 //
       
   221 /*******************************************************************/
       
   222 
       
   223 CCallDummyBase::CCallDummyBase(CPhoneFactoryDummyBase* aFac)
       
   224 	{
       
   225 	iFac=aFac;
       
   226 	}
       
   227 
       
   228 void CCallDummyBase::ConstructL()
       
   229 	{
       
   230 	}
       
   231 
       
   232 CCallDummyBase::~CCallDummyBase()
       
   233 	{
       
   234 	iFac->RemoveTimer(iNotifyStatusChange);
       
   235 	iFac->RemoveTimer(iDial);
       
   236 	iFac->RemoveTimer(iAnswer);
       
   237 	iFac->RemoveTimer(iHangUp);
       
   238 	}
       
   239 
       
   240 CCallDummyBase* CCallDummyBase::This(TAny* aPtr)
       
   241 	{
       
   242 	return REINTERPRET_CAST(CCallDummyBase*,aPtr);
       
   243 	}
       
   244 
       
   245 CPhoneFactoryDummyBase* CCallDummyBase::FacPtr() const
       
   246 	{
       
   247 	return iFac;
       
   248 	}
       
   249 
       
   250 /*******************************************************************/
       
   251 //
       
   252 // Core ETel API call requests - all these must be implemented by TSY
       
   253 // even if just to return KErrNotSupported
       
   254 //
       
   255 /*******************************************************************/
       
   256 
       
   257 TInt CCallDummyBase::RelinquishOwnership()
       
   258 	{
       
   259 	// Request not implemented in this dummy TSY
       
   260 	RelinquishOwnershipCompleted(KErrNone);
       
   261 	return KErrNone;
       
   262 	}
       
   263 
       
   264 TInt CCallDummyBase::TransferOwnership(const TTsyReqHandle aTsyReqHandle)
       
   265 	{
       
   266 	// Request not implemented in this dummy TSY
       
   267 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   268 	return KErrNone;
       
   269 	}
       
   270 
       
   271 TInt CCallDummyBase::AcquireOwnership(const TTsyReqHandle aTsyReqHandle)
       
   272 	{
       
   273 	// Request not implemented in this dummy TSY
       
   274 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   275 	return KErrNone;
       
   276 	}
       
   277 
       
   278 TInt CCallDummyBase::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RCall::TCaps*)
       
   279 	{
       
   280 	iFac->QueueTimer(iNotifyCapsChange,aTsyReqHandle,DMMTSY_TIMEOUT,CCallDummyBase::NotifyCapsChangeHandler,this);
       
   281 	return KErrNone;
       
   282 	}
       
   283 
       
   284 TInt CCallDummyBase::NotifyHookChange(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus* /*aHookStatus*/)
       
   285 	{
       
   286 	// Request not implemented in this dummy TSY
       
   287 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   288 	return KErrNone;
       
   289 	}
       
   290 
       
   291 TInt CCallDummyBase::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
   292 	{
       
   293 	iNotifyStatusChangeParams=aStatus;
       
   294 	iFac->QueueTimer(iNotifyStatusChange,aTsyReqHandle,DMMTSY_TIMEOUT,CCallDummyBase::NotifyStatusChangeHandler,this);
       
   295 	return KErrNone;
       
   296 	}
       
   297 
       
   298 TInt CCallDummyBase::NotifyDurationChange(const TTsyReqHandle aTsyReqHandle,TTimeIntervalSeconds*)
       
   299 	{
       
   300 	iFac->QueueTimer(iNotifyDurationChange,aTsyReqHandle,DMMTSY_TIMEOUT,CCallDummyBase::NotifyDurationChangeHandler,this);
       
   301 	return KErrNone;
       
   302 	}
       
   303 
       
   304 TInt CCallDummyBase::GetInfo(const TTsyReqHandle aTsyReqHandle, RCall::TCallInfo* /*aCallInfo*/)
       
   305 	{
       
   306 	// Request not implemented in this dummy TSY
       
   307 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   308 	return KErrNone;
       
   309 	}
       
   310 
       
   311 TInt CCallDummyBase::GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
   312 	{
       
   313 	*aStatus=DMMTSY_CORE_CALL_STATUS;
       
   314 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   315 	return KErrNone;
       
   316 	}
       
   317 
       
   318 TInt CCallDummyBase::GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps*)
       
   319 	{
       
   320 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   321 	return KErrNone;
       
   322 	}
       
   323 
       
   324 TInt CCallDummyBase::LoanDataPort(const TTsyReqHandle aTsyReqHandle, RCall::TCommPort* /*aCommPort*/)
       
   325 	{
       
   326 	iFac->QueueTimer(iLoanDataPortTimer,aTsyReqHandle,DMMTSY_TIMEOUT,CCallDummyBase::LoanDataPortHandler,this);
       
   327 	return KErrNone;
       
   328 	}
       
   329 
       
   330 TInt CCallDummyBase::RecoverDataPort(const TTsyReqHandle aTsyReqHandle)
       
   331 	{
       
   332 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   333 	return KErrNone;
       
   334 	}
       
   335 
       
   336 TInt CCallDummyBase::RecoverDataPortAndRelinquishOwnership()
       
   337 	{
       
   338 	// Request not implemented in this dummy TSY
       
   339 	RecoverDataPortAndRelinquishOwnershipCompleted(KErrNone);
       
   340 	return KErrNone;
       
   341 	}
       
   342 
       
   343 TInt CCallDummyBase::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8* aCallParams, TDesC* aNumber)
       
   344 	{
       
   345 	TInt error=KErrNone;
       
   346 
       
   347 	if(aNumber->Compare(DMMTSY_PHONE_TEL_NUMBER)!=KErrNone)
       
   348 		error=KErrCorrupt;
       
   349 
       
   350 	RCall::TCallParamsPckg* paramsPckgV1 = (RCall::TCallParamsPckg*)aCallParams;
       
   351 	RCall::TCallParams& paramsV1 = (*paramsPckgV1)();
       
   352 
       
   353 	iDataCallParams.iSpeakerControl = paramsV1.iSpeakerControl;
       
   354 	iDataCallParams.iSpeakerVolume = paramsV1.iSpeakerVolume;
       
   355 	iDataCallParams.iInterval = paramsV1.iInterval;
       
   356 	iDataCallParams.iWaitForDialTone = paramsV1.iWaitForDialTone;
       
   357 	
       
   358 	if (paramsV1.ExtensionId()==RMobileCall::KETelMobileCallParamsV1)
       
   359 		{
       
   360 		if (iMobileCallParams.iInterval != DMMTSY_CALL_INTERVAL)
       
   361 			error=KErrCorrupt;
       
   362 
       
   363 		RMobileCall::TMobileCallParamsV1Pckg* mmParamsPckgV1 = (RMobileCall::TMobileCallParamsV1Pckg*)aCallParams;
       
   364 		RMobileCall::TMobileCallParamsV1& mmParamsV1 = (*mmParamsPckgV1)();
       
   365 
       
   366 		iMobileCallParams.iIdRestrict = mmParamsV1.iIdRestrict;
       
   367 		iMobileCallParams.iCug = mmParamsV1.iCug;
       
   368 		iMobileCallParams.iAutoRedial = mmParamsV1.iAutoRedial;
       
   369 
       
   370 		if ((iMobileCallParams.iIdRestrict != DMMTSY_CALL_CLI_RESTRICT_SETTING1) ||
       
   371 		    (iMobileCallParams.iCug.iExplicitInvoke != DMMTSY_CALL_CUG_INVOKE) ||
       
   372 			(iMobileCallParams.iCug.iCugIndex != DMMTSY_CALL_CUG_INDEX) ||
       
   373 		    (iMobileCallParams.iCug.iSuppressOA != DMMTSY_CALL_CUG_OA) ||
       
   374 		    (iMobileCallParams.iCug.iSuppressPrefCug != DMMTSY_CALL_CUG_PREF) ||
       
   375 			(iMobileCallParams.iAutoRedial != DMMTSY_CALL_AUTO_REDIAL_FLAG))
       
   376 			{
       
   377 			error=KErrCorrupt;
       
   378 			}
       
   379 		}
       
   380 	else if (paramsV1.ExtensionId()==RMobileCall::KETelMobileCallParamsV2)
       
   381 		{
       
   382 		if (iMobileCallParams.iInterval != DMMTSY_CALL_INTERVAL)
       
   383 			error=KErrCorrupt;
       
   384 
       
   385 		RMobileCall::TMobileCallParamsV2Pckg* mmParamsPckgV2 = (RMobileCall::TMobileCallParamsV2Pckg*)aCallParams;
       
   386 		RMobileCall::TMobileCallParamsV2& mmParamsV2 = (*mmParamsPckgV2)();
       
   387 
       
   388 		iMobileCallParams.iIdRestrict = mmParamsV2.iIdRestrict;
       
   389 		iMobileCallParams.iCug = mmParamsV2.iCug;
       
   390 		iMobileCallParams.iAutoRedial = mmParamsV2.iAutoRedial;
       
   391 		iMobileCallParams.iBearerMode = mmParamsV2.iBearerMode;
       
   392 
       
   393 		if ((iMobileCallParams.iIdRestrict != DMMTSY_CALL_CLI_RESTRICT_SETTING1) ||
       
   394 		    (iMobileCallParams.iCug.iExplicitInvoke != DMMTSY_CALL_CUG_INVOKE) ||
       
   395 			(iMobileCallParams.iCug.iCugIndex != DMMTSY_CALL_CUG_INDEX) ||
       
   396 		    (iMobileCallParams.iCug.iSuppressOA != DMMTSY_CALL_CUG_OA) ||
       
   397 		    (iMobileCallParams.iCug.iSuppressPrefCug != DMMTSY_CALL_CUG_PREF) ||
       
   398 			(iMobileCallParams.iAutoRedial != DMMTSY_CALL_AUTO_REDIAL_FLAG) ||
       
   399 			(iMobileCallParams.iBearerMode != DMMTSY_CALL_NEW_BEARER)) 
       
   400 			{
       
   401 			error=KErrCorrupt;
       
   402 			}
       
   403 		}
       
   404 	else if (paramsV1.ExtensionId()==RMobileCall::KETelMobileCallParamsV7)
       
   405 		{
       
   406 		if (iMobileCallParams.iInterval != DMMTSY_CALL_INTERVAL)
       
   407 			{
       
   408 			error=KErrCorrupt;
       
   409 			}
       
   410 		
       
   411 		RMobileCall::TMobileCallParamsV7Pckg* mmParamsPckgV7 = (RMobileCall::TMobileCallParamsV7Pckg*)aCallParams;
       
   412 		RMobileCall::TMobileCallParamsV7& mmParamsV7 = (*mmParamsPckgV7)();
       
   413 
       
   414 		iMobileCallParams.iIdRestrict = mmParamsV7.iIdRestrict;
       
   415 		iMobileCallParams.iCug = mmParamsV7.iCug;
       
   416 		iMobileCallParams.iAutoRedial = mmParamsV7.iAutoRedial;
       
   417 		iMobileCallParams.iBearerMode = mmParamsV7.iBearerMode;
       
   418 		iMobileCallParams.iCallParamOrigin = mmParamsV7.iCallParamOrigin;
       
   419 		iMobileCallParams.iSubAddress = mmParamsV7.iSubAddress;
       
   420 		iMobileCallParams.iBearerCap1 = mmParamsV7.iBearerCap1;
       
   421 		iMobileCallParams.iBearerCap2 = mmParamsV7.iBearerCap2;
       
   422 		iMobileCallParams.iBCRepeatIndicator = mmParamsV7.iBCRepeatIndicator;
       
   423 		iMobileCallParams.iIconId = mmParamsV7.iIconId;
       
   424 		iMobileCallParams.iAlphaId = mmParamsV7.iAlphaId;
       
   425 		
       
   426 		if ((iMobileCallParams.iIdRestrict != DMMTSY_CALL_CLI_RESTRICT_SETTING1) ||
       
   427 		    (iMobileCallParams.iCug.iExplicitInvoke != DMMTSY_CALL_CUG_INVOKE) ||
       
   428 			(iMobileCallParams.iCug.iCugIndex != DMMTSY_CALL_CUG_INDEX) ||
       
   429 		    (iMobileCallParams.iCug.iSuppressOA != DMMTSY_CALL_CUG_OA) ||
       
   430 		    (iMobileCallParams.iCug.iSuppressPrefCug != DMMTSY_CALL_CUG_PREF) ||
       
   431 			(iMobileCallParams.iAutoRedial != DMMTSY_CALL_AUTO_REDIAL_FLAG) ||
       
   432 			(iMobileCallParams.iBearerMode != DMMTSY_CALL_NEW_BEARER) ||
       
   433 			(iMobileCallParams.iCallParamOrigin != DMMTSY_CALL_PARAM_ORIGIN) ||
       
   434 			(iMobileCallParams.iSubAddress != DMMTSY_CALL_SUBADDRESS) ||
       
   435 			(iMobileCallParams.iBearerCap1 != DMMTSY_CALL_BEARER_CAP1) ||
       
   436 			(iMobileCallParams.iBearerCap2 != DMMTSY_CALL_BEARER_CAP2) ||
       
   437 			(iMobileCallParams.iBCRepeatIndicator != DMMTSY_CALL_BC_REPEAT_INDICATOR) ||
       
   438 			(iMobileCallParams.iIconId.iQualifier != DMMTSY_CALL_ICON_ID_QUALIFIER) ||
       
   439 			(iMobileCallParams.iIconId.iIdentifier != DMMTSY_CALL_ICON_ID_IDENTIFIER) ||
       
   440 			(iMobileCallParams.iAlphaId != DMMTSY_CALL_ALPHA_ID)) 
       
   441 			{
       
   442 			error=KErrCorrupt;		
       
   443 			}
       
   444 		}
       
   445 
       
   446 	if ((paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV1)||
       
   447 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV2)||
       
   448 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV8)||
       
   449 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1)||
       
   450 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV2)||
       
   451 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV7)||
       
   452 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   453 		{
       
   454 		RMobileCall::TMobileDataCallParamsV1Pckg* dataParamsPckgV1 = (RMobileCall::TMobileDataCallParamsV1Pckg*)aCallParams;
       
   455 		RMobileCall::TMobileDataCallParamsV1& dataParamsV1 = (*dataParamsPckgV1)();
       
   456 
       
   457 		iDataCallParams.iIdRestrict = dataParamsV1.iIdRestrict;
       
   458 		iDataCallParams.iCug = dataParamsV1.iCug;
       
   459 		iDataCallParams.iAutoRedial = dataParamsV1.iAutoRedial;
       
   460 			
       
   461 		iDataCallParams.iService = dataParamsV1.iService;
       
   462 		iDataCallParams.iSpeed = dataParamsV1.iSpeed;
       
   463 		iDataCallParams.iProtocol = dataParamsV1.iProtocol;
       
   464 		iDataCallParams.iQoS = dataParamsV1.iQoS;
       
   465 		iDataCallParams.iRLPVersion = dataParamsV1.iRLPVersion;
       
   466 		iDataCallParams.iV42bisReq = dataParamsV1.iV42bisReq;
       
   467 		iDataCallParams.iUseEdge = dataParamsV1.iUseEdge;
       
   468 
       
   469 		if ((iDataCallParams.iIdRestrict != DMMTSY_CALL_CLI_RESTRICT_SETTING1) ||
       
   470 			(iDataCallParams.iCug.iExplicitInvoke != DMMTSY_CALL_CUG_INVOKE) ||
       
   471 			(iDataCallParams.iCug.iCugIndex != DMMTSY_CALL_CUG_INDEX) ||
       
   472 			(iDataCallParams.iCug.iSuppressOA != DMMTSY_CALL_CUG_OA) ||
       
   473 			(iDataCallParams.iCug.iSuppressPrefCug != DMMTSY_CALL_CUG_PREF) ||
       
   474 			(iDataCallParams.iAutoRedial != DMMTSY_CALL_AUTO_REDIAL_FLAG) ||
       
   475 			(iDataCallParams.iService != DMMTSY_DATA_CALL_SERVICE) ||
       
   476 		    (iDataCallParams.iSpeed != DMMTSY_DATA_CALL_SPEED) ||
       
   477 		    (iDataCallParams.iProtocol != DMMTSY_DATA_CALL_PROTOCOL) ||
       
   478 			(iDataCallParams.iQoS != DMMTSY_DATA_CALL_QOS) || 
       
   479 			(iDataCallParams.iRLPVersion != DMMTSY_DATA_CALL_RLP) ||
       
   480 			(iDataCallParams.iV42bisReq != DMMTSY_DATA_CALL_V42BIS) ||
       
   481 			(iDataCallParams.iUseEdge != DMMTSY_DATA_CALL_EGPRS_REQUIRED))
       
   482 			
       
   483 			error=KErrCorrupt;
       
   484 		}
       
   485 	
       
   486 	if ((paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV2) ||
       
   487 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV8))
       
   488 		{
       
   489 		RMobileCall::TMobileDataCallParamsV2Pckg* dataParamsPckgV2 = (RMobileCall::TMobileDataCallParamsV2Pckg*)aCallParams;
       
   490 		RMobileCall::TMobileDataCallParamsV2& dataParamsV2 = (*dataParamsPckgV2)();
       
   491 
       
   492 		iDataCallParams.iBearerMode = dataParamsV2.iBearerMode;
       
   493 		if (iDataCallParams.iBearerMode != DMMTSY_PHONE_MULTICALLBEARERMODE_NOTSUPPORTED)
       
   494 							
       
   495 			error=KErrCorrupt;
       
   496 				
       
   497 		}
       
   498 	
       
   499 	if ((paramsV1.ExtensionId()==RMobileCall::KETelMobileDataCallParamsV8))
       
   500 			{
       
   501 			RMobileCall::TMobileDataCallParamsV8Pckg* dataParamsPckgV8 = (RMobileCall::TMobileDataCallParamsV8Pckg*)aCallParams;
       
   502 			RMobileCall::TMobileDataCallParamsV8& dataParamsV8 = (*dataParamsPckgV8)();
       
   503 
       
   504 			iDataCallParams.iCallParamOrigin = dataParamsV8.iCallParamOrigin;
       
   505 			iDataCallParams.iSubAddress = dataParamsV8.iSubAddress;
       
   506 			iDataCallParams.iBearerCap1 = dataParamsV8.iBearerCap1;
       
   507 			iDataCallParams.iBearerCap2 = dataParamsV8.iBearerCap2;
       
   508 			iDataCallParams.iBCRepeatIndicator = dataParamsV8.iBCRepeatIndicator;
       
   509 			iDataCallParams.iIconId.iIdentifier = dataParamsV8.iIconId.iIdentifier;
       
   510 			iDataCallParams.iIconId.iQualifier = dataParamsV8.iIconId.iQualifier;
       
   511 			iDataCallParams.iAlphaId = dataParamsV8.iAlphaId;
       
   512 			
       
   513 			if ((iDataCallParams.iCallParamOrigin != DMMTSY_CALL_PARAM_ORIGIN) ||
       
   514 			    (iDataCallParams.iSubAddress != DMMTSY_CALL_SUBADDRESS) ||
       
   515 			    (iDataCallParams.iBearerCap1 != DMMTSY_CALL_BEARER_CAP1) ||
       
   516 			    (iDataCallParams.iBearerCap2 != DMMTSY_CALL_BEARER_CAP2) || 
       
   517 			    (iDataCallParams.iBCRepeatIndicator != DMMTSY_CALL_BC_REPEAT_INDICATOR)||
       
   518 			    (iDataCallParams.iIconId.iIdentifier != DMMTSY_CALL_ICON_ID_IDENTIFIER) ||
       
   519 			    (iDataCallParams.iIconId.iQualifier != DMMTSY_CALL_ICON_ID_QUALIFIER) ||
       
   520 			    (iDataCallParams.iAlphaId != DMMTSY_CALL_ALPHA_ID))
       
   521 								
       
   522 				error=KErrCorrupt;
       
   523 			
       
   524 			}
       
   525 
       
   526 	if ((paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV1) || 
       
   527 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV2) ||
       
   528 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV7) ||
       
   529 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   530 		{
       
   531 		RMobileCall::TMobileHscsdCallParamsV1Pckg* hscsdParamsPckgV1 = (RMobileCall::TMobileHscsdCallParamsV1Pckg*)aCallParams;
       
   532 		RMobileCall::TMobileHscsdCallParamsV1& hscsdParamsV1 = (*hscsdParamsPckgV1)();
       
   533 
       
   534 		iDataCallParams.iWantedAiur = hscsdParamsV1.iWantedAiur;
       
   535 		iDataCallParams.iWantedRxTimeSlots = hscsdParamsV1.iWantedRxTimeSlots;
       
   536 		iDataCallParams.iMaxTimeSlots = hscsdParamsV1.iMaxTimeSlots;
       
   537 		iDataCallParams.iCodings = hscsdParamsV1.iCodings;
       
   538 		iDataCallParams.iAsymmetry = hscsdParamsV1.iAsymmetry;
       
   539 		iDataCallParams.iUserInitUpgrade = hscsdParamsV1.iUserInitUpgrade;
       
   540 
       
   541 		if ((iDataCallParams.iWantedAiur != DMMTSY_CALL_HCSD_AIUR) ||
       
   542 		    (iDataCallParams.iWantedRxTimeSlots != DMMTSY_CALL_HCSD_TS) ||
       
   543 		    (iDataCallParams.iMaxTimeSlots != DMMTSY_CALL_HCSD_MAXTS) ||
       
   544 		    (iDataCallParams.iCodings != DMMTSY_CALL_HCSD_CODING) ||
       
   545 			(iDataCallParams.iAsymmetry != DMMTSY_CALL_HCSD_ASYMMETRY) ||
       
   546 			(iDataCallParams.iUserInitUpgrade != DMMTSY_CALL_HCSD_USER_IMI))
       
   547 
       
   548 			error=KErrCorrupt;
       
   549 		}
       
   550 
       
   551 	if ((paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV2) ||
       
   552 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV7) ||
       
   553 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   554 		{
       
   555 		RMobileCall::TMobileHscsdCallParamsV2Pckg* hscsdParamsPckgV2 = (RMobileCall::TMobileHscsdCallParamsV2Pckg*)aCallParams;
       
   556 		RMobileCall::TMobileHscsdCallParamsV2& hscsdParamsV2 = (*hscsdParamsPckgV2)();
       
   557 
       
   558 		iDataCallParams.iBearerMode = hscsdParamsV2.iBearerMode;
       
   559 		
       
   560 		if ((iDataCallParams.iBearerMode != DMMTSY_CALL_NEW_BEARER))
       
   561 
       
   562 			error=KErrCorrupt;
       
   563 		}
       
   564 	
       
   565 	if ((paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV7) ||
       
   566 		(paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   567 		{
       
   568 		RMobileCall::TMobileHscsdCallParamsV7Pckg* hscsdParamsPckgV7 = (RMobileCall::TMobileHscsdCallParamsV7Pckg*)aCallParams;
       
   569 		RMobileCall::TMobileHscsdCallParamsV7& hscsdParamsV7 = (*hscsdParamsPckgV7)();
       
   570 
       
   571 		iDataCallParams.iCallParamOrigin = hscsdParamsV7.iCallParamOrigin;
       
   572 		iDataCallParams.iIconId =  hscsdParamsV7.iIconId;
       
   573 		iDataCallParams.iAlphaId = hscsdParamsV7.iAlphaId;
       
   574 			
       
   575 		if ((iDataCallParams.iCallParamOrigin != DMMTSY_CALL_PARAM_ORIGIN) ||
       
   576 			(iDataCallParams.iAlphaId != DMMTSY_CALL_ALPHA_ID))
       
   577 
       
   578 			error=KErrCorrupt;
       
   579 		}
       
   580 
       
   581 	if (paramsV1.ExtensionId()==RMobileCall::KETelMobileHscsdCallParamsV8)
       
   582 		{
       
   583 		RMobileCall::TMobileHscsdCallParamsV8Pckg* hscsdParamsPckgV8 = (RMobileCall::TMobileHscsdCallParamsV8Pckg*)aCallParams;
       
   584 		RMobileCall::TMobileHscsdCallParamsV8& hscsdParamsV8 = (*hscsdParamsPckgV8)();
       
   585 		
       
   586 		iDataCallParams.iBearerMode = hscsdParamsV8.iBearerMode;
       
   587 		iDataCallParams.iCallParamOrigin = hscsdParamsV8.iCallParamOrigin;
       
   588 		iDataCallParams.iIconId.iIdentifier = hscsdParamsV8.iIconId.iIdentifier;
       
   589 		iDataCallParams.iIconId.iQualifier = hscsdParamsV8.iIconId.iQualifier;
       
   590 		iDataCallParams.iAlphaId = hscsdParamsV8.iAlphaId;
       
   591 		iDataCallParams.iSubAddress = hscsdParamsV8.iSubAddress;
       
   592 		iDataCallParams.iBearerCap1 = hscsdParamsV8.iBearerCap1;
       
   593 		iDataCallParams.iBearerCap2 = hscsdParamsV8.iBearerCap2;
       
   594 		iDataCallParams.iBCRepeatIndicator = hscsdParamsV8.iBCRepeatIndicator;
       
   595 					
       
   596 		if ((iDataCallParams.iBearerMode != DMMTSY_CALL_NEW_BEARER) ||
       
   597 			(iDataCallParams.iCallParamOrigin != DMMTSY_CALL_PARAM_ORIGIN) ||
       
   598 			(iDataCallParams.iIconId.iIdentifier != DMMTSY_CALL_ICON_ID_IDENTIFIER) ||
       
   599 			(iDataCallParams.iIconId.iQualifier != DMMTSY_CALL_ICON_ID_QUALIFIER) ||
       
   600 			(iDataCallParams.iAlphaId != DMMTSY_CALL_ALPHA_ID)||
       
   601 			(iDataCallParams.iSubAddress != DMMTSY_CALL_SUBADDRESS) ||
       
   602 			(iDataCallParams.iBearerCap1 != DMMTSY_CALL_BEARER_CAP1) ||
       
   603 			(iDataCallParams.iBearerCap2 != DMMTSY_CALL_BEARER_CAP2) || 
       
   604 			(iDataCallParams.iBCRepeatIndicator != DMMTSY_CALL_BC_REPEAT_INDICATOR))
       
   605 			{
       
   606 			error = KErrCorrupt;
       
   607 			}
       
   608 		}
       
   609 	
       
   610 	if (error != KErrNone)
       
   611 		ReqCompleted(aTsyReqHandle,error);
       
   612 	else
       
   613 		iFac->QueueTimer(iDial,aTsyReqHandle,DMMTSY_TIMEOUT, CCallDummyBase::DialHandler,this);
       
   614 
       
   615 	return KErrNone;
       
   616 	}
       
   617 
       
   618 TInt CCallDummyBase::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8*)
       
   619 	{
       
   620 	// Request not implemented in this dummy TSY
       
   621 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   622 	return KErrNone;
       
   623 	}
       
   624 
       
   625 TInt CCallDummyBase::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8*)
       
   626 	{
       
   627 	iFac->QueueTimer(iAnswer,aTsyReqHandle,DMMTSY_TIMEOUT,CCallDummyBase::AnswerHandler,this);
       
   628 	return KErrNone;
       
   629 	}
       
   630 
       
   631 TInt CCallDummyBase::HangUp(const TTsyReqHandle aTsyReqHandle)
       
   632 	{
       
   633 	// If this is a voice call then any client can hang it up.
       
   634 	// If this is a data or fax call then only the owning client can hang it up
       
   635 	if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedTrue)
       
   636 		{
       
   637 		iFac->QueueTimer(iHangUp,aTsyReqHandle,DMMTSY_TIMEOUT,CCallDummyBase::HangUpHandler,this);
       
   638 		return KErrNone;
       
   639 		}
       
   640 	else
       
   641 		return KErrEtelNotCallOwner;
       
   642 	}
       
   643 
       
   644 TInt CCallDummyBase::GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService* aService)
       
   645 	{
       
   646 	aService->iBearerSpeed=DMMTSY_CALL_BEARER_SPEED;
       
   647 	aService->iBearerCaps=DMMTSY_CALL_BEARER_CAPS;
       
   648 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   649 	return KErrNone;
       
   650 	}
       
   651 
       
   652 TInt CCallDummyBase::GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8* aCallParams)
       
   653 	{
       
   654 	RCall::TCallParamsPckg* paramsPckgV1 = (RCall::TCallParamsPckg*)aCallParams;
       
   655 	RCall::TCallParams& paramsV1 = (*paramsPckgV1)();
       
   656 
       
   657 	TInt ext = paramsV1.ExtensionId();
       
   658 	
       
   659 	switch (ext)
       
   660 		{
       
   661 		case RMobileCall::KETelMobileDataCallParamsV1:
       
   662 		case RMobileCall::KETelMobileHscsdCallParamsV1:
       
   663 		case RMobileCall::KETelMobileDataCallParamsV2:
       
   664 		case RMobileCall::KETelMobileHscsdCallParamsV2:
       
   665 		case RMobileCall::KETelMobileHscsdCallParamsV7:
       
   666 		case RMobileCall::KETelMobileDataCallParamsV8:
       
   667 		case RMobileCall::KETelMobileHscsdCallParamsV8:
       
   668 			{
       
   669 			paramsV1.iSpeakerControl = iDataCallParams.iSpeakerControl;
       
   670 			paramsV1.iSpeakerVolume = iDataCallParams.iSpeakerVolume;
       
   671 			paramsV1.iInterval = iDataCallParams.iInterval;
       
   672 			paramsV1.iWaitForDialTone = iDataCallParams.iWaitForDialTone;
       
   673 			break;
       
   674 			}
       
   675 		case RMobileCall::KETelMobileCallParamsV1:
       
   676 		case RMobileCall::KETelMobileCallParamsV2:
       
   677 		case RMobileCall::KETelMobileCallParamsV7:
       
   678 		default:
       
   679 			{
       
   680 			paramsV1.iSpeakerControl = iMobileCallParams.iSpeakerControl;
       
   681 			paramsV1.iSpeakerVolume = iMobileCallParams.iSpeakerVolume;
       
   682 			paramsV1.iInterval = iMobileCallParams.iInterval;
       
   683 			paramsV1.iWaitForDialTone = iMobileCallParams.iWaitForDialTone;
       
   684 			break;
       
   685 			}
       
   686 		}
       
   687 	
       
   688 	if ((ext==RMobileCall::KETelMobileCallParamsV1) ||
       
   689 	    (ext==RMobileCall::KETelMobileDataCallParamsV1) ||
       
   690 	    (ext==RMobileCall::KETelMobileHscsdCallParamsV1)) 
       
   691 		{
       
   692 		RMobileCall::TMobileCallParamsV1Pckg* mmParamsPckgV1 = (RMobileCall::TMobileCallParamsV1Pckg*)aCallParams;
       
   693 		RMobileCall::TMobileCallParamsV1& mmParamsV1 = (*mmParamsPckgV1)();
       
   694 
       
   695 		mmParamsV1.iIdRestrict = iMobileCallParams.iIdRestrict;
       
   696 		mmParamsV1.iCug = iMobileCallParams.iCug;
       
   697 		mmParamsV1.iAutoRedial = iMobileCallParams.iAutoRedial;
       
   698 		}
       
   699 	else if (ext==RMobileCall::KETelMobileCallParamsV2)
       
   700 		{
       
   701 		RMobileCall::TMobileCallParamsV2Pckg* mmParamsPckgV2 = (RMobileCall::TMobileCallParamsV2Pckg*)aCallParams;
       
   702 		RMobileCall::TMobileCallParamsV2& mmParamsV2 = (*mmParamsPckgV2)();
       
   703 
       
   704 		mmParamsV2.iIdRestrict = iMobileCallParams.iIdRestrict;
       
   705 		mmParamsV2.iCug = iMobileCallParams.iCug;
       
   706 		mmParamsV2.iAutoRedial = iMobileCallParams.iAutoRedial;
       
   707 		mmParamsV2.iBearerMode = iMobileCallParams.iBearerMode;
       
   708 		}
       
   709 	else if ((ext==RMobileCall::KETelMobileDataCallParamsV2) ||
       
   710 	    	 (ext==RMobileCall::KETelMobileHscsdCallParamsV2)||
       
   711 	    	 (ext==RMobileCall::KETelMobileDataCallParamsV8) ||
       
   712 	    	 (ext==RMobileCall::KETelMobileHscsdCallParamsV7)||
       
   713 	    	 (ext==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   714 		{
       
   715 		RMobileCall::TMobileDataCallParamsV2Pckg* mmParamsPckgV2 = (RMobileCall::TMobileDataCallParamsV2Pckg*)aCallParams;
       
   716 		RMobileCall::TMobileDataCallParamsV2& mmParamsV2 = (*mmParamsPckgV2)();
       
   717 
       
   718 		mmParamsV2.iIdRestrict = iDataCallParams.iIdRestrict;
       
   719 		mmParamsV2.iCug = iDataCallParams.iCug;
       
   720 		mmParamsV2.iAutoRedial = iDataCallParams.iAutoRedial;
       
   721 		mmParamsV2.iBearerMode = iDataCallParams.iBearerMode;
       
   722 		}
       
   723 
       
   724 	if ((ext==RMobileCall::KETelMobileDataCallParamsV1) ||
       
   725 	    (ext==RMobileCall::KETelMobileHscsdCallParamsV1) ||
       
   726 		(ext==RMobileCall::KETelMobileDataCallParamsV2) ||
       
   727 	    (ext==RMobileCall::KETelMobileHscsdCallParamsV2)||
       
   728 	    (ext==RMobileCall::KETelMobileDataCallParamsV8) ||
       
   729 	    (ext==RMobileCall::KETelMobileHscsdCallParamsV7) ||
       
   730 	    (ext==RMobileCall::KETelMobileHscsdCallParamsV8)) 
       
   731 		{
       
   732 		RMobileCall::TMobileDataCallParamsV1Pckg* dataParamsPckgV1 = (RMobileCall::TMobileDataCallParamsV1Pckg*)aCallParams;
       
   733 		RMobileCall::TMobileDataCallParamsV1& dataParamsV1 = (*dataParamsPckgV1)();
       
   734 
       
   735 		dataParamsV1.iService = iDataCallParams.iService;
       
   736 		dataParamsV1.iSpeed = iDataCallParams.iSpeed;
       
   737 		dataParamsV1.iProtocol = iDataCallParams.iProtocol;
       
   738 		dataParamsV1.iQoS = iDataCallParams.iQoS;
       
   739 		dataParamsV1.iRLPVersion = iDataCallParams.iRLPVersion;
       
   740 		dataParamsV1.iV42bisReq = iDataCallParams.iV42bisReq;
       
   741 		dataParamsV1.iUseEdge = iDataCallParams.iUseEdge;
       
   742 		}
       
   743 	if ((ext==RMobileCall::KETelMobileDataCallParamsV8))
       
   744 		{
       
   745 		RMobileCall::TMobileDataCallParamsV8Pckg* dataParamsPckgV8 = (RMobileCall::TMobileDataCallParamsV8Pckg*)aCallParams;
       
   746 		RMobileCall::TMobileDataCallParamsV8& dataParamsV8 = (*dataParamsPckgV8)();
       
   747 
       
   748 		dataParamsV8.iCallParamOrigin = iDataCallParams.iCallParamOrigin; 
       
   749 		dataParamsV8.iSubAddress = iDataCallParams.iSubAddress;
       
   750 		dataParamsV8.iBearerCap1 = iDataCallParams.iBearerCap1;
       
   751 		dataParamsV8.iBearerCap2 = iDataCallParams.iBearerCap2;
       
   752 		dataParamsV8.iBCRepeatIndicator = iDataCallParams.iBCRepeatIndicator;
       
   753 		dataParamsV8.iIconId.iIdentifier = iDataCallParams.iIconId.iIdentifier;
       
   754 		dataParamsV8.iIconId.iQualifier = iDataCallParams.iIconId.iQualifier;
       
   755 		dataParamsV8.iAlphaId = iDataCallParams.iAlphaId;
       
   756 		
       
   757 		}
       
   758 	
       
   759 	if ((ext==RMobileCall::KETelMobileHscsdCallParamsV1) ||
       
   760 		(ext==RMobileCall::KETelMobileHscsdCallParamsV2) ||
       
   761 		(ext==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   762 		{
       
   763 		RMobileCall::TMobileHscsdCallParamsV1Pckg* hscsdParamsPckgV1 = (RMobileCall::TMobileHscsdCallParamsV1Pckg*)aCallParams;
       
   764 		RMobileCall::TMobileHscsdCallParamsV1& hscsdParamsV1 = (*hscsdParamsPckgV1)();
       
   765 
       
   766 		hscsdParamsV1.iWantedAiur = iDataCallParams.iWantedAiur;
       
   767 		hscsdParamsV1.iWantedRxTimeSlots = iDataCallParams.iWantedRxTimeSlots;
       
   768 		hscsdParamsV1.iMaxTimeSlots = iDataCallParams.iMaxTimeSlots;
       
   769 		hscsdParamsV1.iCodings = iDataCallParams.iCodings;
       
   770 		hscsdParamsV1.iAsymmetry = iDataCallParams.iAsymmetry;
       
   771 	    hscsdParamsV1.iUserInitUpgrade = iDataCallParams.iUserInitUpgrade;
       
   772 		}
       
   773 	
       
   774 	
       
   775 	if ((ext==RMobileCall::KETelMobileHscsdCallParamsV8))
       
   776 		{
       
   777 		RMobileCall::TMobileHscsdCallParamsV8Pckg* hscsdParamsPckgV8 = (RMobileCall::TMobileHscsdCallParamsV8Pckg*)aCallParams;
       
   778 		RMobileCall::TMobileHscsdCallParamsV8& hscsdParamsV8 = (*hscsdParamsPckgV8)();
       
   779 		
       
   780 		hscsdParamsV8.iSubAddress = iDataCallParams.iSubAddress;
       
   781 		hscsdParamsV8.iBearerCap1 = iDataCallParams.iBearerCap1;
       
   782 		hscsdParamsV8.iBearerCap2 = iDataCallParams.iBearerCap2;
       
   783 		hscsdParamsV8.iBCRepeatIndicator = iDataCallParams.iBCRepeatIndicator;
       
   784 					
       
   785 		}
       
   786 
       
   787 
       
   788 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   789 	return KErrNone;
       
   790 	}
       
   791 
       
   792 TInt CCallDummyBase::GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime)
       
   793 	{
       
   794 	*aTime = DMMTSY_CALL_DURATION1;
       
   795 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   796 	return KErrNone;
       
   797 	}
       
   798 
       
   799 TInt CCallDummyBase::GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings)
       
   800 	{
       
   801 	aSettings->iFaxId=DMMTSY_MYFAX;
       
   802 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   803 	return KErrNone;
       
   804 	}
       
   805 
       
   806 TInt CCallDummyBase::SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings)
       
   807 	{
       
   808 	if (aSettings->iFaxId.Compare(DMMTSY_MYFAX)!=KErrNone)
       
   809 		ReqCompleted(aTsyReqHandle,KErrEtelDataCorrupted);
       
   810 	else
       
   811 		ReqCompleted(aTsyReqHandle,KErrNone);
       
   812 	return KErrNone;
       
   813 	}
       
   814 
       
   815 
       
   816 /*******************************************************************/
       
   817 //
       
   818 // Cancellation functions for call requests
       
   819 //
       
   820 /*******************************************************************/
       
   821 
       
   822 TInt CCallDummyBase::AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle)
       
   823 	{
       
   824 	// Request not implemented in this dummy TSY
       
   825 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   826 	return KErrNone;
       
   827 	}
       
   828 
       
   829 TInt CCallDummyBase::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   830 	{
       
   831 	if (aTsyReqHandle==iNotifyCapsChange.iTsyReqHandle)
       
   832 		{
       
   833 		iFac->RemoveTimer(iNotifyCapsChange);
       
   834 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   835 		return KErrNone;
       
   836 		}
       
   837 	return KErrEtelNotRecognisedCancelHandle;
       
   838 	}
       
   839 
       
   840 TInt CCallDummyBase::NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   841 	{
       
   842 	// Request not implemented in this dummy TSY
       
   843 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   844 	return KErrNone;
       
   845 	}
       
   846 
       
   847 TInt CCallDummyBase::NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   848 	{
       
   849 	if (aTsyReqHandle==iNotifyStatusChange.iTsyReqHandle)
       
   850 		{
       
   851 		iFac->RemoveTimer(iNotifyStatusChange);
       
   852 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   853 		return KErrNone;
       
   854 		}
       
   855 	return KErrEtelNotRecognisedCancelHandle;
       
   856 	}
       
   857 
       
   858 TInt CCallDummyBase::NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   859 	{
       
   860 	if (aTsyReqHandle==iNotifyDurationChange.iTsyReqHandle)
       
   861 		{
       
   862 		iFac->RemoveTimer(iNotifyDurationChange);
       
   863 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   864 		return KErrNone;
       
   865 		}
       
   866 	return KErrEtelNotRecognisedCancelHandle;
       
   867 	}
       
   868 
       
   869 TInt CCallDummyBase::LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle)
       
   870 	{
       
   871 	if (aTsyReqHandle==iLoanDataPortTimer.iTsyReqHandle)
       
   872 		{
       
   873 		iFac->RemoveTimer(iLoanDataPortTimer);
       
   874 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   875 		return KErrNone;
       
   876 		}
       
   877 	return KErrEtelNotRecognisedCancelHandle;
       
   878 	}
       
   879 
       
   880 TInt CCallDummyBase::DialCancel(const TTsyReqHandle aTsyReqHandle)
       
   881 	{
       
   882 	if (aTsyReqHandle==iDial.iTsyReqHandle)
       
   883 		{
       
   884 		iFac->RemoveTimer(iDial);
       
   885 		SetUnowned();
       
   886 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   887 		return KErrNone;
       
   888 		}
       
   889 	return KErrEtelNotRecognisedCancelHandle;
       
   890 	}
       
   891 
       
   892 TInt CCallDummyBase::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
       
   893 	{
       
   894 	// Request not implemented in this dummy TSY
       
   895 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   896 	return KErrNone;
       
   897 	}
       
   898 
       
   899 TInt CCallDummyBase::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
       
   900 	{
       
   901 	if (aTsyReqHandle==iAnswer.iTsyReqHandle)
       
   902 		{
       
   903 		iFac->RemoveTimer(iAnswer);
       
   904 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   905 		return KErrNone;
       
   906 		}
       
   907 	return KErrEtelNotRecognisedCancelHandle;
       
   908 	}
       
   909 
       
   910 TInt CCallDummyBase::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
       
   911 	{
       
   912 	if (aTsyReqHandle==iHangUp.iTsyReqHandle)
       
   913 		{
       
   914 		iFac->RemoveTimer(iHangUp);
       
   915 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   916 		return KErrNone;
       
   917 		}
       
   918 	return KErrEtelNotRecognisedCancelHandle;
       
   919 	}
       
   920 
       
   921 
       
   922 /*******************************************************************/
       
   923 //
       
   924 // Asynchronous handler functions - called after a timeout
       
   925 //
       
   926 /*******************************************************************/
       
   927 
       
   928 TInt CCallDummyBase::NotifyCapsChangeHandler(TAny* aPtr)
       
   929 	{
       
   930 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCapsChange);
       
   931 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCapsChange.iTsyReqHandle,KErrNone);
       
   932 	return KErrNone;
       
   933 	}
       
   934 
       
   935 TInt CCallDummyBase::NotifyStatusChangeHandler(TAny* aPtr)
       
   936 	{
       
   937 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyStatusChange);
       
   938 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyStatusChange.iTsyReqHandle,KErrNone);
       
   939 	return KErrNone;
       
   940 	}
       
   941 
       
   942 TInt CCallDummyBase::NotifyDurationChangeHandler(TAny* aPtr)
       
   943 	{
       
   944 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyDurationChange);
       
   945 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyDurationChange.iTsyReqHandle,KErrNone);
       
   946 	return KErrNone;
       
   947 	}
       
   948 
       
   949 TInt CCallDummyBase::DialHandler(TAny* aPtr)
       
   950 	{
       
   951 	This(aPtr)->iFac->ResetPending( This(aPtr)->iDial);
       
   952 	This(aPtr)->ReqCompleted(This(aPtr)->iDial.iTsyReqHandle,KErrNone);
       
   953 	return KErrNone;
       
   954 	}
       
   955 
       
   956 TInt CCallDummyBase::AnswerHandler(TAny* aPtr)
       
   957 	{
       
   958 	This(aPtr)->iFac->ResetPending( This(aPtr)->iAnswer);
       
   959 	This(aPtr)->ReqCompleted(This(aPtr)->iAnswer.iTsyReqHandle,KErrNone);
       
   960 	return KErrNone;
       
   961 	}
       
   962 
       
   963 TInt CCallDummyBase::HangUpHandler(TAny* aPtr)
       
   964 	{
       
   965 	This(aPtr)->SetUnowned();
       
   966 	This(aPtr)->iFac->ResetPending( This(aPtr)->iHangUp);
       
   967 	This(aPtr)->ReqCompleted(This(aPtr)->iHangUp.iTsyReqHandle,KErrNone);
       
   968 	return KErrNone;
       
   969 	}
       
   970 
       
   971 TInt CCallDummyBase::LoanDataPortHandler(TAny* aPtr)
       
   972 	{
       
   973 	This(aPtr)->iFac->ResetPending( This(aPtr)->iLoanDataPortTimer);
       
   974 	This(aPtr)->ReqCompleted(This(aPtr)->iLoanDataPortTimer.iTsyReqHandle,KErrNone);
       
   975 	return KErrNone;
       
   976 	}
       
   977 
       
   978 /*******************************************************************/
       
   979 //
       
   980 // CLineDummyBase
       
   981 //
       
   982 /*******************************************************************/
       
   983 
       
   984 CLineDummyBase::CLineDummyBase(CPhoneFactoryDummyBase* aFac)
       
   985 	{
       
   986 	iFac=aFac;
       
   987 	}
       
   988 
       
   989 void CLineDummyBase::ConstructL()
       
   990 	{
       
   991 	}
       
   992 
       
   993 CLineDummyBase::~CLineDummyBase()
       
   994 	{
       
   995 	iFac->RemoveTimer(iNotifyIncomingCall);
       
   996 	iFac->RemoveTimer(iNotifyStatusChange);
       
   997 	}
       
   998 
       
   999 CLineDummyBase* CLineDummyBase::This(TAny* aPtr)
       
  1000 	{
       
  1001 	return REINTERPRET_CAST(CLineDummyBase*,aPtr);
       
  1002 	}
       
  1003 
       
  1004 CPhoneFactoryDummyBase* CLineDummyBase::FacPtr() const
       
  1005 	{
       
  1006 	return iFac;
       
  1007 	}
       
  1008 
       
  1009 /*******************************************************************/
       
  1010 //
       
  1011 // Core ETel API line requests - all these must be implemented by TSY
       
  1012 // even if just to return KErrNotSupported
       
  1013 //
       
  1014 /*******************************************************************/
       
  1015 
       
  1016 TInt CLineDummyBase::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RLine::TCaps* aCaps)
       
  1017 	{
       
  1018 	iCapsParams=aCaps;
       
  1019 	iFac->QueueTimer(iNotifyCapsChange,aTsyReqHandle,DMMTSY_TIMEOUT,CLineDummyBase::NotifyCapsChangeHandler,this);
       
  1020 	return KErrNone;
       
  1021 	}
       
  1022 
       
  1023 TInt CLineDummyBase::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
  1024 	{
       
  1025 	iStatusParams=aStatus;
       
  1026 	iFac->QueueTimer(iNotifyStatusChange,aTsyReqHandle,DMMTSY_TIMEOUT,CLineDummyBase::NotifyStatusChangeHandler,this);
       
  1027 	return KErrNone;
       
  1028 	}
       
  1029 
       
  1030 TInt CLineDummyBase::NotifyIncomingCall(const TTsyReqHandle aTsyReqHandle, TName* aName)
       
  1031 	{
       
  1032 	iNameParams=aName;
       
  1033 	iFac->QueueTimer(iNotifyIncomingCall,aTsyReqHandle,DMMTSY_TIMEOUT,CLineDummyBase::NotifyIncomingCallHandler,this);
       
  1034 	return KErrNone;
       
  1035 	}
       
  1036 
       
  1037 TInt CLineDummyBase::NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* /*aHookStatus*/)
       
  1038 	{
       
  1039 	// Request not implemented in this dummy TSY
       
  1040 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1041 	return KErrNone;
       
  1042 	}
       
  1043 
       
  1044 TInt CLineDummyBase::NotifyCallAdded(const TTsyReqHandle aTsyReqHandle, TName* /*aName*/)
       
  1045 	{
       
  1046 	iFac->QueueTimer(iNotifyCallAdded,aTsyReqHandle,DMMTSY_TIMEOUT,CLineDummyBase::NotifyCallAddedHandler,this);
       
  1047 	return KErrNone;
       
  1048 	}
       
  1049 
       
  1050 TInt CLineDummyBase::GetCaps(const TTsyReqHandle aTsyReqHandle,RLine::TCaps*)
       
  1051 	{
       
  1052 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1053 	return KErrNone;
       
  1054 	}
       
  1055 
       
  1056 TInt CLineDummyBase::GetInfo(const TTsyReqHandle aTsyReqHandle, RLine::TLineInfo* /*aLineInfo*/)
       
  1057 	{
       
  1058 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1059 	return KErrNone;
       
  1060 	}
       
  1061 
       
  1062 TInt CLineDummyBase::GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
  1063 	{
       
  1064 	*aStatus=DMMTSY_CORE_LINE_STATUS;
       
  1065 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1066 	return KErrNone;
       
  1067 	}
       
  1068 
       
  1069 TInt CLineDummyBase::GetHookStatus(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus*)
       
  1070 	{
       
  1071 	// Request not implemented in this dummy TSY
       
  1072 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1073 	return KErrNone;
       
  1074 	}
       
  1075 
       
  1076 TInt CLineDummyBase::EnumerateCall(const TTsyReqHandle aTsyReqHandle, TInt*)
       
  1077 	{
       
  1078 	// Request not implemented in this dummy TSY
       
  1079 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1080 	return KErrNone;
       
  1081 	}
       
  1082 
       
  1083 TInt CLineDummyBase::GetCallInfo(const TTsyReqHandle aTsyReqHandle,TCallInfoIndex*)
       
  1084 	{
       
  1085 	// Request not implemented in this dummy TSY
       
  1086 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1087 	return KErrNone;
       
  1088 	}
       
  1089 
       
  1090 
       
  1091 /*******************************************************************/
       
  1092 //
       
  1093 // Cancellation functions for line requests
       
  1094 //
       
  1095 /*******************************************************************/
       
  1096 
       
  1097 TInt CLineDummyBase::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
  1098 	{
       
  1099 	if (aTsyReqHandle==iNotifyCapsChange.iTsyReqHandle)
       
  1100 		{
       
  1101 		iFac->RemoveTimer(iNotifyCapsChange);
       
  1102 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1103 		return KErrNone;
       
  1104 		}
       
  1105 	return KErrEtelNotRecognisedCancelHandle;
       
  1106 	}
       
  1107 
       
  1108 TInt CLineDummyBase::NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
  1109 	{
       
  1110 	if (aTsyReqHandle==iNotifyStatusChange.iTsyReqHandle)
       
  1111 		{
       
  1112 		iFac->RemoveTimer(iNotifyStatusChange);
       
  1113 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1114 		return KErrNone;
       
  1115 		}
       
  1116 	return KErrEtelNotRecognisedCancelHandle;
       
  1117 	}
       
  1118 
       
  1119 TInt CLineDummyBase::NotifyIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
       
  1120 	{
       
  1121 	if (aTsyReqHandle==iNotifyIncomingCall.iTsyReqHandle)
       
  1122 		{
       
  1123 		iFac->RemoveTimer(iNotifyIncomingCall);
       
  1124 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1125 		return KErrNone;
       
  1126 		}
       
  1127 	return KErrEtelNotRecognisedCancelHandle;
       
  1128 	}
       
  1129 
       
  1130 TInt CLineDummyBase::NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
  1131 	{
       
  1132 	// Request not implemented in this dummy TSY
       
  1133 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1134 	return KErrNone;
       
  1135 	}
       
  1136 
       
  1137 TInt CLineDummyBase::NotifyCallAddedCancel(const TTsyReqHandle aTsyReqHandle)
       
  1138 	{
       
  1139 	if (aTsyReqHandle==iNotifyCallAdded.iTsyReqHandle)
       
  1140 		{
       
  1141 		iFac->RemoveTimer(iNotifyCallAdded);
       
  1142 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1143 		return KErrNone;
       
  1144 		}
       
  1145 	return KErrEtelNotRecognisedCancelHandle;
       
  1146 	}
       
  1147 
       
  1148 /*******************************************************************/
       
  1149 //
       
  1150 // Asynchronous handler functions - called after a timeout
       
  1151 //
       
  1152 /*******************************************************************/
       
  1153 
       
  1154 TInt CLineDummyBase::NotifyCapsChangeHandler(TAny* aPtr)
       
  1155 	{
       
  1156 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCapsChange);
       
  1157 	This(aPtr)->iCapsParams->iFlags=DMMTSY_CORE_LINE_CAPS;
       
  1158 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCapsChange.iTsyReqHandle,KErrNone);
       
  1159 	return KErrNone;
       
  1160 	}
       
  1161 
       
  1162 TInt CLineDummyBase::NotifyStatusChangeHandler(TAny* aPtr)
       
  1163 	{
       
  1164 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyStatusChange);
       
  1165 	*(This(aPtr)->iStatusParams)=DMMTSY_CORE_LINE_STATUS2;
       
  1166 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyStatusChange.iTsyReqHandle,KErrNone);
       
  1167 	return KErrNone;
       
  1168 	}
       
  1169 
       
  1170 TInt CLineDummyBase::NotifyIncomingCallHandler(TAny* aPtr)
       
  1171 	{
       
  1172 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyIncomingCall);
       
  1173 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyIncomingCall.iTsyReqHandle,KErrNone);
       
  1174 	return KErrNone;
       
  1175 	}
       
  1176 
       
  1177 TInt CLineDummyBase::NotifyCallAddedHandler(TAny* aPtr)
       
  1178 	{
       
  1179 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCallAdded);
       
  1180 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCallAdded.iTsyReqHandle,KErrNone);
       
  1181 	return KErrNone;
       
  1182 	}
       
  1183 
       
  1184 
       
  1185 /*******************************************************************/
       
  1186 //
       
  1187 // CPhoneDummyBase
       
  1188 //
       
  1189 /*******************************************************************/
       
  1190 
       
  1191 CPhoneDummyBase::CPhoneDummyBase(CPhoneFactoryDummyBase* aFac)
       
  1192 	{
       
  1193 	iFac=aFac;
       
  1194 	}
       
  1195 
       
  1196 void CPhoneDummyBase::ConstructL()
       
  1197 	{
       
  1198 	}
       
  1199 
       
  1200 CPhoneDummyBase::~CPhoneDummyBase()
       
  1201 	{
       
  1202 	iFac->RemoveTimer(iNotifyPhoneDetected);
       
  1203 	iFac->RemoveTimer(iNotifyCapsChange);
       
  1204 	}
       
  1205 
       
  1206 CPhoneDummyBase* CPhoneDummyBase::This(TAny* aPtr)
       
  1207 	{
       
  1208 	return REINTERPRET_CAST(CPhoneDummyBase*,aPtr);
       
  1209 	}
       
  1210 
       
  1211 CPhoneFactoryDummyBase* CPhoneDummyBase::FacPtr() const
       
  1212 	{
       
  1213 	return iFac;
       
  1214 	}
       
  1215 
       
  1216 /*******************************************************************/
       
  1217 //
       
  1218 // Core ETel API phone requests - all these must be implemented by TSY
       
  1219 // even if just to return KErrNotSupported
       
  1220 //
       
  1221 /*******************************************************************/
       
  1222 
       
  1223 TInt CPhoneDummyBase::ControlledInitialisation(const TTsyReqHandle aTsyReqHandle)
       
  1224 	{
       
  1225 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1226 	return KErrNone;
       
  1227 	}
       
  1228 
       
  1229 TInt CPhoneDummyBase::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RPhone::TCaps*)
       
  1230 	{
       
  1231 	iFac->QueueTimer(iNotifyCapsChange,aTsyReqHandle,DMMTSY_TIMEOUT,CPhoneDummyBase::NotifyCapsChangeHandler,this);
       
  1232 	return KErrNone;
       
  1233 	}
       
  1234 
       
  1235 TInt CPhoneDummyBase::NotifyModemDetected(const TTsyReqHandle aTsyReqHandle,RPhone::TModemDetection* aDetection)
       
  1236 	{
       
  1237 	iDetectionParams=aDetection;
       
  1238 	iFac->QueueTimer(iNotifyPhoneDetected,aTsyReqHandle,DMMTSY_TIMEOUT,CPhoneDummyBase::NotifyPhoneDetectedHandler,this);
       
  1239 	return KErrNone;
       
  1240 	}
       
  1241 
       
  1242 TInt CPhoneDummyBase::GetInfo(const TTsyReqHandle aTsyReqHandle, RPhone::TPhoneInfo* /*aPhoneInfo*/)
       
  1243 	{
       
  1244 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1245 	return KErrNone;
       
  1246 	}
       
  1247 
       
  1248 TInt CPhoneDummyBase::GetStatus(const TTsyReqHandle aTsyReqHandle,RPhone::TStatus* aPhoneStat)
       
  1249 	{
       
  1250 	aPhoneStat->iModemDetected=DMMTSY_CORE_PHONE_STATUS;
       
  1251 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1252 	return KErrNone;
       
  1253 	}
       
  1254 
       
  1255 TInt CPhoneDummyBase::GetCaps(const TTsyReqHandle aTsyReqHandle,RPhone::TCaps*)
       
  1256 	{
       
  1257 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1258 	return KErrNone;
       
  1259 	}
       
  1260 
       
  1261 TInt CPhoneDummyBase::EnumerateLines(const TTsyReqHandle aTsyReqHandle, TInt*)
       
  1262 	{
       
  1263 	// Request not implemented in this dummy TSY
       
  1264 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1265 	return KErrNone;
       
  1266 	}
       
  1267 
       
  1268 TInt CPhoneDummyBase::GetLineInfo(const TTsyReqHandle aTsyReqHandle, TLineInfoIndex* /*aLineInfo*/)
       
  1269 	{
       
  1270 	// Request not implemented in this dummy TSY
       
  1271 	ReqCompleted(aTsyReqHandle,KErrNone);
       
  1272 	return KErrNone;
       
  1273 	}
       
  1274 
       
  1275 
       
  1276 /*******************************************************************/
       
  1277 //
       
  1278 // Cancellation functions for line requests
       
  1279 //
       
  1280 /*******************************************************************/
       
  1281 
       
  1282 TInt CPhoneDummyBase::ControlledInitialisationCancel(const TTsyReqHandle aTsyReqHandle)
       
  1283 	{
       
  1284 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1285 	return KErrNone;
       
  1286 	}
       
  1287 
       
  1288 TInt CPhoneDummyBase::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
  1289 	{
       
  1290 	if (aTsyReqHandle==iNotifyCapsChange.iTsyReqHandle)
       
  1291 		{
       
  1292 		iFac->RemoveTimer(iNotifyCapsChange);
       
  1293 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1294 		return KErrNone;
       
  1295 		}
       
  1296 	return KErrEtelNotRecognisedCancelHandle;
       
  1297 	}
       
  1298 
       
  1299 TInt CPhoneDummyBase::NotifyModemDetectedCancel(const TTsyReqHandle aTsyReqHandle)
       
  1300 	{
       
  1301 	if (aTsyReqHandle==iNotifyPhoneDetected.iTsyReqHandle)
       
  1302 		{
       
  1303 		iFac->RemoveTimer(iNotifyPhoneDetected);
       
  1304 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
  1305 		return KErrNone;
       
  1306 		}
       
  1307 	return KErrEtelNotRecognisedCancelHandle;
       
  1308 	}
       
  1309 
       
  1310 /*******************************************************************/
       
  1311 //
       
  1312 // Asynchronous handler functions - called after a timeout
       
  1313 //
       
  1314 /*******************************************************************/
       
  1315 
       
  1316 TInt CPhoneDummyBase::NotifyCapsChangeHandler(TAny* aPtr)
       
  1317 	{
       
  1318 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCapsChange);
       
  1319 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCapsChange.iTsyReqHandle,KErrNone);
       
  1320 	return KErrNone;
       
  1321 	}
       
  1322 
       
  1323 TInt CPhoneDummyBase::NotifyPhoneDetectedHandler(TAny* aPtr)
       
  1324 	{
       
  1325 	This(aPtr)->iFac->ResetPending(This(aPtr)->iNotifyPhoneDetected);
       
  1326 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyPhoneDetected.iTsyReqHandle,KErrNone);
       
  1327 	return KErrNone;
       
  1328 	}
       
  1329 
       
  1330 
       
  1331 /*******************************************************************/
       
  1332 //
       
  1333 // CPhoneFactoryDummyBase
       
  1334 //
       
  1335 /*******************************************************************/
       
  1336 
       
  1337 CPhoneFactoryDummyBase::CPhoneFactoryDummyBase()
       
  1338 	{
       
  1339 	
       
  1340 	}
       
  1341 
       
  1342 void CPhoneFactoryDummyBase::ConstructL()
       
  1343 	{
       
  1344 	iTimer=CDeltaTimer::NewL(CActive::EPriorityHigh,KEtelTimerGranularity);
       
  1345 	}
       
  1346 
       
  1347 CPhoneFactoryDummyBase::~CPhoneFactoryDummyBase()
       
  1348 	{
       
  1349 	delete iTimer;
       
  1350 	}
       
  1351 
       
  1352 void CPhoneFactoryDummyBase::QueueTimer(TTsyTimer& aTsyTimer, const TTsyReqHandle aTsyReqHandle,TTimeIntervalMicroSeconds32 aTimeInMicroSeconds,
       
  1353 										TInt (*aFunction)(TAny *aPtr), TAny* aPtr)
       
  1354 	{
       
  1355 	TCallBack callBackFn(aFunction,aPtr);
       
  1356  	
       
  1357 	aTsyTimer.iEntry.Set(callBackFn);
       
  1358 	aTsyTimer.iPending=ETrue;
       
  1359 	aTsyTimer.iTsyReqHandle=aTsyReqHandle;
       
  1360 
       
  1361 	aTimeInMicroSeconds=aTimeInMicroSeconds.Int()+(KEtelTimerGranularity>>2);
       
  1362 	if(aTimeInMicroSeconds.Int()<100000)
       
  1363 		aTimeInMicroSeconds=aTimeInMicroSeconds.Int()+KEtelTimerGranularity;
       
  1364 	
       
  1365 	iTimer->Queue(aTimeInMicroSeconds,aTsyTimer.iEntry);
       
  1366 	}
       
  1367 
       
  1368 TBool CPhoneFactoryDummyBase::RemoveTimer(TTsyTimer& aTsyTimer)
       
  1369 	{
       
  1370 	if (aTsyTimer.iPending)
       
  1371 		{
       
  1372 		aTsyTimer.iPending=EFalse;
       
  1373 		iTimer->Remove(aTsyTimer.iEntry);
       
  1374 		return ETrue;
       
  1375 		}
       
  1376 	return EFalse;
       
  1377 	}
       
  1378 
       
  1379 void CPhoneFactoryDummyBase::ResetPending(TTsyTimer& aTsyTimer)
       
  1380 	{
       
  1381 	aTsyTimer.iPending=EFalse;
       
  1382 	}
       
  1383 
       
  1384 TInt CPhoneFactoryDummyBase::GetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aInfo)
       
  1385 	{
       
  1386 	if (aIndex==0)
       
  1387 		{
       
  1388 		aInfo.iNetworkType=DMMTSY_NETWORK_TYPE;
       
  1389 		aInfo.iName=DMMTSY_PHONE_NAME;
       
  1390 		aInfo.iNumberOfLines=DMMTSY_NUMBER_OF_LINES;
       
  1391 		return KErrNone;
       
  1392 		}
       
  1393 	else if (aIndex==1)
       
  1394 		{
       
  1395 		aInfo.iNetworkType=DMMTSY_NETWORK_TYPE;
       
  1396 		aInfo.iName=DMMTSY_PHONE_NAMEAUTH1;
       
  1397 		aInfo.iNumberOfLines=DMMTSY_NUMBER_OF_LINES;
       
  1398 		return KErrNone;
       
  1399 		}
       
  1400 	else if (aIndex==2)
       
  1401 		{
       
  1402 		aInfo.iNetworkType=DMMTSY_NETWORK_TYPE;
       
  1403 		aInfo.iName=DMMTSY_PHONE_NAMEAUTH2;
       
  1404 		aInfo.iNumberOfLines=DMMTSY_NUMBER_OF_LINES;
       
  1405 		return KErrNone;
       
  1406 		}
       
  1407 	else if (aIndex==3)
       
  1408 		{
       
  1409 		aInfo.iNetworkType=DMMTSY_NETWORK_TYPE;
       
  1410 		aInfo.iName=DMMTSY_PHONE_NAMEAUTH3;
       
  1411 		aInfo.iNumberOfLines=DMMTSY_NUMBER_OF_LINES;
       
  1412 		return KErrNone;
       
  1413 		}
       
  1414 	else
       
  1415 		return KErrNotFound;
       
  1416 	}
       
  1417 
       
  1418 TInt CPhoneFactoryDummyBase::EnumeratePhones()
       
  1419 	{
       
  1420 	return (DMMTSY_NUMBER_OF_PHONES);
       
  1421 	}
       
  1422 
       
  1423 /*******************************************************************/
       
  1424 //
       
  1425 // CSubSessionExtDummyBase
       
  1426 //
       
  1427 /*******************************************************************/
       
  1428 
       
  1429 CSubSessionExtDummyBase::CSubSessionExtDummyBase(CPhoneFactoryDummyBase* aFac)
       
  1430 	{
       
  1431 	iFac=aFac;
       
  1432 	}
       
  1433 
       
  1434 CSubSessionExtDummyBase::~CSubSessionExtDummyBase()
       
  1435 	{}
       
  1436 
       
  1437 CPhoneFactoryDummyBase* CSubSessionExtDummyBase::FacPtr() const
       
  1438 	{
       
  1439 	return iFac;
       
  1440 	}
       
  1441