telephonyserver/etelpacketdata/dtsy/coretsy.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
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 <et_clsvr.h>
       
    20 
       
    21 void TsyPanic(TTsyPanic aPanic)
       
    22 	{
       
    23 	_LIT(KTsyPanic,"Tsy Panic");
       
    24 	User::Panic(KTsyPanic,aPanic);
       
    25 	}
       
    26 
       
    27 TTsyTimer::TTsyTimer()
       
    28 	{
       
    29 	iPending=EFalse;
       
    30 	}
       
    31 
       
    32 /*******************************************************************/
       
    33 //
       
    34 // CFaxDummyBase & CFaxDGprsTsy
       
    35 //
       
    36 /*******************************************************************/
       
    37 
       
    38 //	CFaxDGprsTsy
       
    39 
       
    40 CFaxDGprsTsy* CFaxDGprsTsy::NewL(CPhoneFactoryDummyBase* aFac)
       
    41 /**
       
    42  * NewL method - 2 phase construction
       
    43  */
       
    44 	{
       
    45 	CFaxDGprsTsy* fax=new(ELeave) CFaxDGprsTsy(aFac);
       
    46 	CleanupStack::PushL(fax);
       
    47 	fax->ConstructL();
       
    48 	CleanupStack::Pop();
       
    49 	return fax;
       
    50 	}
       
    51 
       
    52 CFaxDGprsTsy::CFaxDGprsTsy(CPhoneFactoryDummyBase* aFac)
       
    53 	:CFaxDummyBase(aFac)
       
    54 	{}
       
    55 
       
    56 void CFaxDGprsTsy::ConstructL()
       
    57 	{
       
    58 	TInt r = iChunk.CreateGlobal(KNullDesC,sizeof (RFax::TProgress), sizeof (RFax::TProgress),EOwnerProcess); 
       
    59 	if (r == KErrNone)
       
    60 		{
       
    61 		RFax::TProgress* progress = new(iChunk.Base()) RFax::TProgress;
       
    62 		progress->iLastUpdateTime = 0;
       
    63 		progress->iAnswerback.Zero ();
       
    64 		progress->iPhase = ENotYetStarted;
       
    65 		progress->iSpeed = 9600;
       
    66 		progress->iResolution = EFaxNormal;
       
    67 		progress->iCompression = EModifiedHuffman;
       
    68 		progress->iECM = 0;
       
    69  		progress->iPage = 0;
       
    70 		progress->iLines = 0;
       
    71 		}	
       
    72 	else
       
    73 		User::Leave(r);
       
    74 	}
       
    75 
       
    76 RHandleBase* CFaxDGprsTsy::GlobalKernelObjectHandle()
       
    77 	{
       
    78 		return &iChunk;
       
    79 	}
       
    80 
       
    81 CFaxDGprsTsy::~CFaxDGprsTsy()
       
    82 	{
       
    83 	iChunk.Close();
       
    84 	}
       
    85 
       
    86 TInt CFaxDGprsTsy::RegisterNotification(const TInt /*aIpc*/)
       
    87 /**
       
    88  * RegisterNotification - Not Supported
       
    89  */
       
    90 	{
       
    91 	return KErrNotSupported;
       
    92 	}
       
    93 
       
    94 TInt CFaxDGprsTsy::DeregisterNotification(const TInt /*aIpc*/)
       
    95 /**
       
    96  * DeRegisterNotification - Not Supported
       
    97  */
       
    98 	{
       
    99 	return KErrNotSupported;
       
   100 	}
       
   101 
       
   102 //	CFaxDummyBase
       
   103 CFaxDummyBase::CFaxDummyBase(CPhoneFactoryDummyBase* aFac)
       
   104 	{
       
   105 	iFac=aFac;
       
   106 	}
       
   107 
       
   108 CFaxDummyBase::~CFaxDummyBase()
       
   109 /**
       
   110  * Destructor
       
   111  */
       
   112 	{
       
   113 	iFac->RemoveTimer(iRead);
       
   114 	iFac->RemoveTimer(iWrite);
       
   115 	iFac->RemoveTimer(iWaitForEndOfPage);
       
   116 	iFac->RemoveTimer(iProgressNotification);
       
   117 	}
       
   118 
       
   119 CFaxDummyBase* CFaxDummyBase::This(TAny* aPtr)
       
   120 	{
       
   121 	return REINTERPRET_CAST(CFaxDummyBase*,aPtr);
       
   122 	}
       
   123 
       
   124 
       
   125 TInt CFaxDummyBase::WaitForEndOfPageHandler(TAny* aPtr)
       
   126 	{
       
   127 	This(aPtr)->iFac->ResetPending( This(aPtr)->iWaitForEndOfPage);
       
   128 	This(aPtr)->ReqCompleted(This(aPtr)->iWaitForEndOfPage.iTsyReqHandle,KErrNone);
       
   129 	return KErrNone;
       
   130 	}
       
   131 
       
   132 TInt CFaxDummyBase::WaitForEndOfPage(const TTsyReqHandle aTsyReqHandle)
       
   133 	{
       
   134 	iFac->QueueTimer(iWaitForEndOfPage,aTsyReqHandle,DPCKTTSY_TIMEOUT,CFaxDummyBase::WaitForEndOfPageHandler,this);
       
   135 	return KErrNone;
       
   136 	}
       
   137 
       
   138 TInt CFaxDummyBase::Read(const TTsyReqHandle aTsyReqHandle,TDes8* aDes)
       
   139 	{
       
   140 	iReadParams=aDes;
       
   141 	iFac->QueueTimer(iRead,aTsyReqHandle,DPCKTTSY_TIMEOUT,CFaxDummyBase::ReadHandler,this);
       
   142 	return KErrNone;
       
   143 	}
       
   144 
       
   145 TInt CFaxDummyBase::ReadHandler(TAny* aPtr)
       
   146 	{
       
   147 	This(aPtr)->iReadParams->Copy(DPCKTTSY_FAX_DATA);
       
   148 	This(aPtr)->iFac->ResetPending( This(aPtr)->iRead);
       
   149 	This(aPtr)->ReqCompleted(This(aPtr)->iRead.iTsyReqHandle,KErrNone);
       
   150 	return KErrNone;
       
   151 	}
       
   152 
       
   153 TInt CFaxDummyBase::TerminateFaxSession(const TTsyReqHandle aTsyReqHandle)
       
   154 	{
       
   155 	if (iFac->RemoveTimer(iRead))
       
   156 		ReqCompleted(iRead.iTsyReqHandle,KErrCancel);
       
   157 
       
   158 	if (iFac->RemoveTimer(iWrite))
       
   159 		ReqCompleted(iWrite.iTsyReqHandle,KErrCancel);
       
   160 
       
   161 	if (iFac->RemoveTimer(iWaitForEndOfPage))
       
   162 		ReqCompleted(iWaitForEndOfPage.iTsyReqHandle,KErrCancel);
       
   163 
       
   164 	if (iFac->RemoveTimer(iProgressNotification))
       
   165 		ReqCompleted(iProgressNotification.iTsyReqHandle,KErrCancel);
       
   166 
       
   167 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   168 	return KErrNone;
       
   169 	}
       
   170 
       
   171 TInt CFaxDummyBase::Write(const TTsyReqHandle aTsyReqHandle,TDesC8* aDes)
       
   172 	{
       
   173 	if (aDes->Compare(DPCKTTSY_FAX_DATA)!=KErrNone)
       
   174 		return KErrEtelDataCorrupted;
       
   175 	iFac->QueueTimer(iWrite,aTsyReqHandle,DPCKTTSY_TIMEOUT,CFaxDummyBase::WriteHandler,this);
       
   176 	return KErrNone;
       
   177 	}
       
   178 
       
   179 TInt CFaxDummyBase::WriteHandler(TAny* aPtr)
       
   180 	{
       
   181 	This(aPtr)->iFac->ResetPending( This(aPtr)->iWrite);
       
   182 	This(aPtr)->ReqCompleted(This(aPtr)->iWrite.iTsyReqHandle,KErrNone);
       
   183 	return KErrNone;
       
   184 	}
       
   185 
       
   186 TInt CFaxDummyBase::GetProgress(const TTsyReqHandle aTsyReqHandle,RFax::TProgress* aProgress)
       
   187 	{
       
   188 	aProgress->iSpeed=DPCKTTSY_GET_PROGRESS_SPEED;
       
   189 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   190 	return KErrNone;
       
   191 	}
       
   192 
       
   193 TInt CFaxDummyBase::ProgressNotificationHandler(TAny* aPtr)
       
   194 	{
       
   195 	This(aPtr)->iFac->ResetPending( This(aPtr)->iProgressNotification);
       
   196 	This(aPtr)->ReqCompleted(This(aPtr)->iProgressNotification.iTsyReqHandle,KErrNone);
       
   197 	return KErrNone;
       
   198 	}
       
   199 
       
   200 TInt CFaxDummyBase::ProgressNotification(const TTsyReqHandle aTsyReqHandle, RFax::TProgress* aProgress)
       
   201 	{
       
   202 	iProgressNotificationParams=aProgress;
       
   203 	iFac->QueueTimer(iProgressNotification,aTsyReqHandle,DPCKTTSY_TIMEOUT,CFaxDummyBase::ProgressNotificationHandler,this);
       
   204 	return KErrNone;
       
   205 	}
       
   206 
       
   207 TInt CFaxDummyBase::ProgressNotificationCancel(const TTsyReqHandle aTsyReqHandle)
       
   208 	{
       
   209 	if(aTsyReqHandle==iProgressNotification.iTsyReqHandle)
       
   210 		{
       
   211 		iFac->RemoveTimer(iProgressNotification);
       
   212 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   213 		return KErrNone;
       
   214 		}
       
   215 	return KErrEtelNotRecognisedCancelHandle;
       
   216 	}
       
   217 
       
   218 /*******************************************************************/
       
   219 //
       
   220 // CCallDummyBase
       
   221 //
       
   222 /*******************************************************************/
       
   223 
       
   224 CCallDummyBase::CCallDummyBase(CPhoneFactoryDummyBase* aFac)
       
   225 	{
       
   226 	iFac=aFac;
       
   227 	}
       
   228 
       
   229 void CCallDummyBase::ConstructL()
       
   230 	{
       
   231 	}
       
   232 
       
   233 CCallDummyBase::~CCallDummyBase()
       
   234 /** 
       
   235  * Destructor
       
   236  */
       
   237 	{
       
   238 	iFac->RemoveTimer(iNotifyStatusChange);
       
   239 	iFac->RemoveTimer(iDial);
       
   240 	iFac->RemoveTimer(iAnswer);
       
   241 	iFac->RemoveTimer(iHangUp);
       
   242 	}
       
   243 
       
   244 CCallDummyBase* CCallDummyBase::This(TAny* aPtr)
       
   245 	{
       
   246 	return REINTERPRET_CAST(CCallDummyBase*,aPtr);
       
   247 	}
       
   248 
       
   249 CPhoneFactoryDummyBase* CCallDummyBase::FacPtr() const
       
   250 	{
       
   251 	return iFac;
       
   252 	}
       
   253 
       
   254 /*******************************************************************/
       
   255 //
       
   256 // Core ETel API call requests - all these must be implemented by TSY
       
   257 // even if just to return KErrNotSupported
       
   258 //
       
   259 /*******************************************************************/
       
   260 
       
   261 TInt CCallDummyBase::RelinquishOwnership()
       
   262 /**
       
   263  * RelinquishOwnership - Request not implemented in this dummy TSY
       
   264  */
       
   265 	{
       
   266 	RelinquishOwnershipCompleted(KErrNone);
       
   267 	return KErrNone;
       
   268 	}
       
   269 
       
   270 TInt CCallDummyBase::TransferOwnership(const TTsyReqHandle aTsyReqHandle)
       
   271 /**
       
   272  * TransferOwnership - Request not implemented in this dummy TSY
       
   273  */
       
   274 	{
       
   275 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   276 	return KErrNone;
       
   277 	}
       
   278 
       
   279 TInt CCallDummyBase::AcquireOwnership(const TTsyReqHandle aTsyReqHandle)
       
   280 /**
       
   281  * AcquireOwnership - Request not implemented in this dummy TSY
       
   282  */
       
   283 	{
       
   284 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   285 	return KErrNone;
       
   286 	}
       
   287 
       
   288 TInt CCallDummyBase::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RCall::TCaps*)
       
   289 	{
       
   290 	iFac->QueueTimer(iNotifyCapsChange,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::NotifyCapsChangeHandler,this);
       
   291 	return KErrNone;
       
   292 	}
       
   293 
       
   294 TInt CCallDummyBase::NotifyHookChange(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus* /*aHookStatus*/)
       
   295 /**
       
   296  * NotifyHookChange - Request not implemented in this dummy TSY
       
   297  */
       
   298 	{
       
   299 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   300 	return KErrNone;
       
   301 	}
       
   302 
       
   303 TInt CCallDummyBase::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
   304 	{
       
   305 	iNotifyStatusChangeParams=aStatus;
       
   306 	iFac->QueueTimer(iNotifyStatusChange,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::NotifyStatusChangeHandler,this);
       
   307 	return KErrNone;
       
   308 	}
       
   309 
       
   310 TInt CCallDummyBase::NotifyDurationChange(const TTsyReqHandle aTsyReqHandle,TTimeIntervalSeconds*)
       
   311 	{
       
   312 	iFac->QueueTimer(iNotifyDurationChange,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::NotifyDurationChangeHandler,this);
       
   313 	return KErrNone;
       
   314 	}
       
   315 
       
   316 TInt CCallDummyBase::GetInfo(const TTsyReqHandle aTsyReqHandle, RCall::TCallInfo* /*aCallInfo*/)
       
   317 /**
       
   318  * GetInfo - Request not implemented in this dummy TSY
       
   319  */
       
   320 	{
       
   321 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   322 	return KErrNone;
       
   323 	}
       
   324 
       
   325 TInt CCallDummyBase::GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
   326 	{
       
   327 	*aStatus=DPCKTTSY_CORE_CALL_STATUS;
       
   328 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   329 	return KErrNone;
       
   330 	}
       
   331 
       
   332 TInt CCallDummyBase::GetCaps(const TTsyReqHandle aTsyReqHandle,RCall::TCaps*)
       
   333 	{
       
   334 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   335 	return KErrNone;
       
   336 	}
       
   337 
       
   338 TInt CCallDummyBase::LoanDataPort(const TTsyReqHandle aTsyReqHandle, RCall::TCommPort* /*aCommPort*/)
       
   339 	{
       
   340 	iFac->QueueTimer(iLoanDataPortTimer,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::LoanDataPortHandler,this);
       
   341 	return KErrNone;
       
   342 	}
       
   343 
       
   344 TInt CCallDummyBase::RecoverDataPort(const TTsyReqHandle aTsyReqHandle)
       
   345 	{
       
   346 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   347 	return KErrNone;
       
   348 	}
       
   349 
       
   350 TInt CCallDummyBase::RecoverDataPortAndRelinquishOwnership()
       
   351 /**
       
   352  * RecoverDataPortAndRelinquishOwnership - Request not implemented in this dummy TSY
       
   353  */
       
   354 	{
       
   355 	RecoverDataPortAndRelinquishOwnershipCompleted(KErrNone);
       
   356 	return KErrNone;
       
   357 	}
       
   358 
       
   359 TInt CCallDummyBase::Dial(const TTsyReqHandle aTsyReqHandle,const TDesC8*, TDesC*)
       
   360 	{
       
   361 	iFac->QueueTimer(iDial,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::DialHandler,this);
       
   362 	return KErrNone;
       
   363 	}
       
   364 
       
   365 TInt CCallDummyBase::Connect(const TTsyReqHandle aTsyReqHandle,const TDesC8*)
       
   366 /**
       
   367  * Connect - Request not implemented in this dummy TSY
       
   368  */
       
   369 	{
       
   370 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   371 	return KErrNone;
       
   372 	}
       
   373 
       
   374 TInt CCallDummyBase::AnswerIncomingCall(const TTsyReqHandle aTsyReqHandle,const TDesC8*)
       
   375 	{
       
   376 	iFac->QueueTimer(iAnswer,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::AnswerHandler,this);
       
   377 	return KErrNone;
       
   378 	}
       
   379 
       
   380 TInt CCallDummyBase::HangUp(const TTsyReqHandle aTsyReqHandle)
       
   381 /**
       
   382  * HangUp method
       
   383  * If this is a voice call then any client can hang it up.
       
   384  * If this is a data or fax call then only the owning client can hang it up.
       
   385  */
       
   386 
       
   387 	{
       
   388 	if (CheckOwnership(aTsyReqHandle)==CCallBase::EOwnedTrue)
       
   389 		{
       
   390 		iFac->QueueTimer(iHangUp,aTsyReqHandle,DPCKTTSY_TIMEOUT,CCallDummyBase::HangUpHandler,this);
       
   391 		return KErrNone;
       
   392 		}
       
   393 	else
       
   394 		return KErrEtelNotCallOwner;
       
   395 	}
       
   396 
       
   397 TInt CCallDummyBase::GetBearerServiceInfo(const TTsyReqHandle aTsyReqHandle,RCall::TBearerService* aService)
       
   398 	{
       
   399 	aService->iBearerSpeed=DPCKTTSY_CALL_BEARER_SPEED;
       
   400 	aService->iBearerCaps=DPCKTTSY_CALL_BEARER_CAPS;
       
   401 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   402 	return KErrNone;
       
   403 	}
       
   404 
       
   405 TInt CCallDummyBase::GetCallParams(const TTsyReqHandle aTsyReqHandle, TDes8*)
       
   406 	{
       
   407 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   408 	return KErrNone;
       
   409 	}
       
   410 
       
   411 TInt CCallDummyBase::GetCallDuration(const TTsyReqHandle aTsyReqHandle, TTimeIntervalSeconds* aTime)
       
   412 	{
       
   413 	*aTime = DPCKTTSY_CALL_DURATION1;
       
   414 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   415 	return KErrNone;
       
   416 	}
       
   417 
       
   418 TInt CCallDummyBase::GetFaxSettings(const TTsyReqHandle aTsyReqHandle,RCall::TFaxSessionSettings* aSettings)
       
   419 	{
       
   420 	aSettings->iFaxId=DPCKTTSY_MYFAX;
       
   421 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   422 	return KErrNone;
       
   423 	}
       
   424 
       
   425 TInt CCallDummyBase::SetFaxSettings(const TTsyReqHandle aTsyReqHandle,const RCall::TFaxSessionSettings* aSettings)
       
   426 	{
       
   427 	if (aSettings->iFaxId.Compare(DPCKTTSY_MYFAX)!=KErrNone)
       
   428 		return (KErrEtelDataCorrupted);
       
   429 
       
   430 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   431 	return KErrNone;
       
   432 	}
       
   433 
       
   434 
       
   435 /*******************************************************************/
       
   436 //
       
   437 // Cancellation functions for call requests
       
   438 //
       
   439 /*******************************************************************/
       
   440 
       
   441 TInt CCallDummyBase::AcquireOwnershipCancel(const TTsyReqHandle aTsyReqHandle)
       
   442 /**
       
   443  * AcquireOwnershipCancel - Request not implemented in this dummy TSY
       
   444  */
       
   445 	{
       
   446 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   447 	return KErrNone;
       
   448 	}
       
   449 
       
   450 TInt CCallDummyBase::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   451 	{
       
   452 	if (aTsyReqHandle==iNotifyCapsChange.iTsyReqHandle)
       
   453 		{
       
   454 		iFac->RemoveTimer(iNotifyCapsChange);
       
   455 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   456 		return KErrNone;
       
   457 		}
       
   458 	return KErrEtelNotRecognisedCancelHandle;
       
   459 	}
       
   460 
       
   461 TInt CCallDummyBase::NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   462 /**
       
   463  * NotifyHookChangeCancel - Request not implemented in this dummy TSY
       
   464  */
       
   465 	{
       
   466 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   467 	return KErrNone;
       
   468 	}
       
   469 
       
   470 TInt CCallDummyBase::NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   471 	{
       
   472 	if (aTsyReqHandle==iNotifyStatusChange.iTsyReqHandle)
       
   473 		{
       
   474 		iFac->RemoveTimer(iNotifyStatusChange);
       
   475 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   476 		return KErrNone;
       
   477 		}
       
   478 	return KErrEtelNotRecognisedCancelHandle;
       
   479 	}
       
   480 
       
   481 TInt CCallDummyBase::NotifyDurationChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   482 	{
       
   483 	if (aTsyReqHandle==iNotifyDurationChange.iTsyReqHandle)
       
   484 		{
       
   485 		iFac->RemoveTimer(iNotifyDurationChange);
       
   486 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   487 		return KErrNone;
       
   488 		}
       
   489 	return KErrEtelNotRecognisedCancelHandle;
       
   490 	}
       
   491 
       
   492 TInt CCallDummyBase::LoanDataPortCancel(const TTsyReqHandle aTsyReqHandle)
       
   493 	{
       
   494 	if (aTsyReqHandle==iLoanDataPortTimer.iTsyReqHandle)
       
   495 		{
       
   496 		iFac->RemoveTimer(iLoanDataPortTimer);
       
   497 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   498 		return KErrNone;
       
   499 		}
       
   500 	return KErrEtelNotRecognisedCancelHandle;
       
   501 	}
       
   502 
       
   503 TInt CCallDummyBase::DialCancel(const TTsyReqHandle aTsyReqHandle)
       
   504 	{
       
   505 	if (aTsyReqHandle==iDial.iTsyReqHandle)
       
   506 		{
       
   507 		iFac->RemoveTimer(iDial);
       
   508 		SetUnowned();
       
   509 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   510 		return KErrNone;
       
   511 		}
       
   512 	return KErrEtelNotRecognisedCancelHandle;
       
   513 	}
       
   514 
       
   515 TInt CCallDummyBase::ConnectCancel(const TTsyReqHandle aTsyReqHandle)
       
   516 /**
       
   517  * ConnectCancel - Request not implemented in this dummy TSY
       
   518  */
       
   519 	{
       
   520 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   521 	return KErrNone;
       
   522 	}
       
   523 
       
   524 TInt CCallDummyBase::AnswerIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
       
   525 	{
       
   526 	if (aTsyReqHandle==iAnswer.iTsyReqHandle)
       
   527 		{
       
   528 		iFac->RemoveTimer(iAnswer);
       
   529 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   530 		return KErrNone;
       
   531 		}
       
   532 	return KErrEtelNotRecognisedCancelHandle;
       
   533 	}
       
   534 
       
   535 TInt CCallDummyBase::HangUpCancel(const TTsyReqHandle aTsyReqHandle)
       
   536 	{
       
   537 	if (aTsyReqHandle==iHangUp.iTsyReqHandle)
       
   538 		{
       
   539 		iFac->RemoveTimer(iHangUp);
       
   540 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   541 		return KErrNone;
       
   542 		}
       
   543 	return KErrEtelNotRecognisedCancelHandle;
       
   544 	}
       
   545 
       
   546 
       
   547 /*******************************************************************/
       
   548 //
       
   549 // Asynchronous handler functions - called after a timeout
       
   550 //
       
   551 /*******************************************************************/
       
   552 
       
   553 TInt CCallDummyBase::NotifyCapsChangeHandler(TAny* aPtr)
       
   554 	{
       
   555 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCapsChange);
       
   556 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCapsChange.iTsyReqHandle,KErrNone);
       
   557 	return KErrNone;
       
   558 	}
       
   559 
       
   560 TInt CCallDummyBase::NotifyStatusChangeHandler(TAny* aPtr)
       
   561 	{
       
   562 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyStatusChange);
       
   563 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyStatusChange.iTsyReqHandle,KErrNone);
       
   564 	return KErrNone;
       
   565 	}
       
   566 
       
   567 TInt CCallDummyBase::NotifyDurationChangeHandler(TAny* aPtr)
       
   568 	{
       
   569 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyDurationChange);
       
   570 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyDurationChange.iTsyReqHandle,KErrNone);
       
   571 	return KErrNone;
       
   572 	}
       
   573 
       
   574 TInt CCallDummyBase::DialHandler(TAny* aPtr)
       
   575 	{
       
   576 	This(aPtr)->iFac->ResetPending( This(aPtr)->iDial);
       
   577 	This(aPtr)->ReqCompleted(This(aPtr)->iDial.iTsyReqHandle,KErrNone);
       
   578 	return KErrNone;
       
   579 	}
       
   580 
       
   581 TInt CCallDummyBase::AnswerHandler(TAny* aPtr)
       
   582 	{
       
   583 	This(aPtr)->iFac->ResetPending( This(aPtr)->iAnswer);
       
   584 	This(aPtr)->ReqCompleted(This(aPtr)->iAnswer.iTsyReqHandle,KErrNone);
       
   585 	return KErrNone;
       
   586 	}
       
   587 
       
   588 TInt CCallDummyBase::HangUpHandler(TAny* aPtr)
       
   589 	{
       
   590 	This(aPtr)->SetUnowned();
       
   591 	This(aPtr)->iFac->ResetPending( This(aPtr)->iHangUp);
       
   592 	This(aPtr)->ReqCompleted(This(aPtr)->iHangUp.iTsyReqHandle,KErrNone);
       
   593 	return KErrNone;
       
   594 	}
       
   595 
       
   596 TInt CCallDummyBase::LoanDataPortHandler(TAny* aPtr)
       
   597 	{
       
   598 	This(aPtr)->iFac->ResetPending( This(aPtr)->iLoanDataPortTimer);
       
   599 	This(aPtr)->ReqCompleted(This(aPtr)->iLoanDataPortTimer.iTsyReqHandle,KErrNone);
       
   600 	return KErrNone;
       
   601 	}
       
   602 
       
   603 /*******************************************************************/
       
   604 //
       
   605 // CLineDummyBase
       
   606 //
       
   607 /*******************************************************************/
       
   608 
       
   609 CLineDummyBase::CLineDummyBase(CPhoneFactoryDummyBase* aFac)
       
   610 	{
       
   611 	iFac=aFac;
       
   612 	}
       
   613 
       
   614 void CLineDummyBase::ConstructL()
       
   615 	{
       
   616 	}
       
   617 
       
   618 CLineDummyBase::~CLineDummyBase()
       
   619 	{
       
   620 	iFac->RemoveTimer(iNotifyIncomingCall);
       
   621 	iFac->RemoveTimer(iNotifyStatusChange);
       
   622 	}
       
   623 
       
   624 CLineDummyBase* CLineDummyBase::This(TAny* aPtr)
       
   625 	{
       
   626 	return REINTERPRET_CAST(CLineDummyBase*,aPtr);
       
   627 	}
       
   628 
       
   629 CPhoneFactoryDummyBase* CLineDummyBase::FacPtr() const
       
   630 	{
       
   631 	return iFac;
       
   632 	}
       
   633 
       
   634 /*******************************************************************/
       
   635 //
       
   636 // Core ETel API line requests - all these must be implemented by TSY
       
   637 // even if just to return KErrNotSupported
       
   638 //
       
   639 /*******************************************************************/
       
   640 
       
   641 TInt CLineDummyBase::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RLine::TCaps* aCaps)
       
   642 	{
       
   643 	iCapsParams=aCaps;
       
   644 	iFac->QueueTimer(iNotifyCapsChange,aTsyReqHandle,DPCKTTSY_TIMEOUT,CLineDummyBase::NotifyCapsChangeHandler,this);
       
   645 	return KErrNone;
       
   646 	}
       
   647 
       
   648 TInt CLineDummyBase::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
   649 	{
       
   650 	iStatusParams=aStatus;
       
   651 	iFac->QueueTimer(iNotifyStatusChange,aTsyReqHandle,DPCKTTSY_TIMEOUT,CLineDummyBase::NotifyStatusChangeHandler,this);
       
   652 	return KErrNone;
       
   653 	}
       
   654 
       
   655 TInt CLineDummyBase::NotifyIncomingCall(const TTsyReqHandle aTsyReqHandle, TName* aName)
       
   656 	{
       
   657 	iNameParams=aName;
       
   658 	iFac->QueueTimer(iNotifyIncomingCall,aTsyReqHandle,DPCKTTSY_TIMEOUT,CLineDummyBase::NotifyIncomingCallHandler,this);
       
   659 	return KErrNone;
       
   660 	}
       
   661 
       
   662 TInt CLineDummyBase::NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* /*aHookStatus*/)
       
   663 /**
       
   664  * NotifyHookChange - Request not implemented in this dummy TSY
       
   665  */
       
   666 	{
       
   667 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   668 	return KErrNone;
       
   669 	}
       
   670 
       
   671 TInt CLineDummyBase::NotifyCallAdded(const TTsyReqHandle aTsyReqHandle, TName* /*aName*/)
       
   672 	{
       
   673 	iFac->QueueTimer(iNotifyCallAdded,aTsyReqHandle,DPCKTTSY_TIMEOUT,CLineDummyBase::NotifyCallAddedHandler,this);
       
   674 	return KErrNone;
       
   675 	}
       
   676 
       
   677 TInt CLineDummyBase::GetCaps(const TTsyReqHandle aTsyReqHandle,RLine::TCaps*)
       
   678 	{
       
   679 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   680 	return KErrNone;
       
   681 	}
       
   682 
       
   683 TInt CLineDummyBase::GetInfo(const TTsyReqHandle aTsyReqHandle, RLine::TLineInfo* /*aLineInfo*/)
       
   684 	{
       
   685 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   686 	return KErrNone;
       
   687 	}
       
   688 
       
   689 TInt CLineDummyBase::GetStatus(const TTsyReqHandle aTsyReqHandle,RCall::TStatus* aStatus)
       
   690 	{
       
   691 	*aStatus=DPCKTTSY_CORE_LINE_STATUS;
       
   692 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   693 	return KErrNone;
       
   694 	}
       
   695 
       
   696 TInt CLineDummyBase::GetHookStatus(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus*)
       
   697 /**
       
   698  * GetHookStatus - Request not implemented in this dummy TSY
       
   699  */
       
   700 	{
       
   701 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   702 	return KErrNone;
       
   703 	}
       
   704 
       
   705 TInt CLineDummyBase::EnumerateCall(const TTsyReqHandle aTsyReqHandle, TInt*)
       
   706 /**
       
   707  * EnumerateCall - Request not implemented in this dummy TSY
       
   708  */
       
   709 	{
       
   710 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   711 	return KErrNone;
       
   712 	}
       
   713 
       
   714 TInt CLineDummyBase::GetCallInfo(const TTsyReqHandle aTsyReqHandle,TCallInfoIndex*)
       
   715 /**
       
   716  * GetCallInfo - Request not implemented in this dummy TSY
       
   717  */
       
   718 	{
       
   719 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   720 	return KErrNone;
       
   721 	}
       
   722 
       
   723 
       
   724 /*******************************************************************/
       
   725 //
       
   726 // Cancellation functions for line requests
       
   727 //
       
   728 /*******************************************************************/
       
   729 
       
   730 TInt CLineDummyBase::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   731 	{
       
   732 	if (aTsyReqHandle==iNotifyCapsChange.iTsyReqHandle)
       
   733 		{
       
   734 		iFac->RemoveTimer(iNotifyCapsChange);
       
   735 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   736 		return KErrNone;
       
   737 		}
       
   738 	return KErrEtelNotRecognisedCancelHandle;
       
   739 	}
       
   740 
       
   741 TInt CLineDummyBase::NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   742 	{
       
   743 	if (aTsyReqHandle==iNotifyStatusChange.iTsyReqHandle)
       
   744 		{
       
   745 		iFac->RemoveTimer(iNotifyStatusChange);
       
   746 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   747 		return KErrNone;
       
   748 		}
       
   749 	return KErrEtelNotRecognisedCancelHandle;
       
   750 	}
       
   751 
       
   752 TInt CLineDummyBase::NotifyIncomingCallCancel(const TTsyReqHandle aTsyReqHandle)
       
   753 	{
       
   754 	if (aTsyReqHandle==iNotifyIncomingCall.iTsyReqHandle)
       
   755 		{
       
   756 		iFac->RemoveTimer(iNotifyIncomingCall);
       
   757 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   758 		return KErrNone;
       
   759 		}
       
   760 	return KErrEtelNotRecognisedCancelHandle;
       
   761 	}
       
   762 
       
   763 TInt CLineDummyBase::NotifyHookChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   764 /**
       
   765  * NotifyHookChangeCancel - Request not implemented in this dummy TSY
       
   766  */
       
   767 	{
       
   768 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   769 	return KErrNone;
       
   770 	}
       
   771 
       
   772 TInt CLineDummyBase::NotifyCallAddedCancel(const TTsyReqHandle aTsyReqHandle)
       
   773 	{
       
   774 	if (aTsyReqHandle==iNotifyCallAdded.iTsyReqHandle)
       
   775 		{
       
   776 		iFac->RemoveTimer(iNotifyCallAdded);
       
   777 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   778 		return KErrNone;
       
   779 		}
       
   780 	return KErrEtelNotRecognisedCancelHandle;
       
   781 	}
       
   782 
       
   783 /*******************************************************************/
       
   784 //
       
   785 // Asynchronous handler functions - called after a timeout
       
   786 //
       
   787 /*******************************************************************/
       
   788 
       
   789 TInt CLineDummyBase::NotifyCapsChangeHandler(TAny* aPtr)
       
   790 	{
       
   791 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCapsChange);
       
   792 	This(aPtr)->iCapsParams->iFlags=DPCKTTSY_CORE_LINE_CAPS;
       
   793 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCapsChange.iTsyReqHandle,KErrNone);
       
   794 	return KErrNone;
       
   795 	}
       
   796 
       
   797 TInt CLineDummyBase::NotifyStatusChangeHandler(TAny* aPtr)
       
   798 	{
       
   799 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyStatusChange);
       
   800 	*(This(aPtr)->iStatusParams)=DPCKTTSY_CORE_LINE_STATUS2;
       
   801 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyStatusChange.iTsyReqHandle,KErrNone);
       
   802 	return KErrNone;
       
   803 	}
       
   804 
       
   805 TInt CLineDummyBase::NotifyIncomingCallHandler(TAny* aPtr)
       
   806 	{
       
   807 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyIncomingCall);
       
   808 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyIncomingCall.iTsyReqHandle,KErrNone);
       
   809 	return KErrNone;
       
   810 	}
       
   811 
       
   812 TInt CLineDummyBase::NotifyCallAddedHandler(TAny* aPtr)
       
   813 	{
       
   814 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCallAdded);
       
   815 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCallAdded.iTsyReqHandle,KErrNone);
       
   816 	return KErrNone;
       
   817 	}
       
   818 
       
   819 
       
   820 /*******************************************************************/
       
   821 //
       
   822 // CPhoneDummyBase
       
   823 //
       
   824 /*******************************************************************/
       
   825 
       
   826 CPhoneDummyBase::CPhoneDummyBase(CPhoneFactoryDummyBase* aFac)
       
   827 	{
       
   828 	iFac=aFac;
       
   829 	}
       
   830 
       
   831 void CPhoneDummyBase::ConstructL()
       
   832 	{
       
   833 	}
       
   834 
       
   835 CPhoneDummyBase::~CPhoneDummyBase()
       
   836 	{
       
   837 	iFac->RemoveTimer(iNotifyPhoneDetected);
       
   838 	iFac->RemoveTimer(iNotifyCapsChange);
       
   839 	}
       
   840 
       
   841 CPhoneDummyBase* CPhoneDummyBase::This(TAny* aPtr)
       
   842 	{
       
   843 	return REINTERPRET_CAST(CPhoneDummyBase*,aPtr);
       
   844 	}
       
   845 
       
   846 CPhoneFactoryDummyBase* CPhoneDummyBase::FacPtr() const
       
   847 	{
       
   848 	return iFac;
       
   849 	}
       
   850 
       
   851 /*******************************************************************/
       
   852 //
       
   853 // Core ETel API phone requests - all these must be implemented by TSY
       
   854 // even if just to return KErrNotSupported
       
   855 //
       
   856 /*******************************************************************/
       
   857 
       
   858 TInt CPhoneDummyBase::ControlledInitialisation(const TTsyReqHandle aTsyReqHandle)
       
   859 	{
       
   860 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   861 	return KErrNone;
       
   862 	}
       
   863 
       
   864 TInt CPhoneDummyBase::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle,RPhone::TCaps*)
       
   865 	{
       
   866 	iFac->QueueTimer(iNotifyCapsChange,aTsyReqHandle,DPCKTTSY_TIMEOUT,CPhoneDummyBase::NotifyCapsChangeHandler,this);
       
   867 	return KErrNone;
       
   868 	}
       
   869 
       
   870 TInt CPhoneDummyBase::NotifyModemDetected(const TTsyReqHandle aTsyReqHandle,RPhone::TModemDetection* aDetection)
       
   871 	{
       
   872 	iDetectionParams=aDetection;
       
   873 	iFac->QueueTimer(iNotifyPhoneDetected,aTsyReqHandle,DPCKTTSY_TIMEOUT,CPhoneDummyBase::NotifyPhoneDetectedHandler,this);
       
   874 	return KErrNone;
       
   875 	}
       
   876 
       
   877 TInt CPhoneDummyBase::GetInfo(const TTsyReqHandle aTsyReqHandle, RPhone::TPhoneInfo* /*aPhoneInfo*/)
       
   878 	{
       
   879 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   880 	return KErrNone;
       
   881 	}
       
   882 
       
   883 TInt CPhoneDummyBase::GetStatus(const TTsyReqHandle aTsyReqHandle,RPhone::TStatus* aPhoneStat)
       
   884 	{
       
   885 	aPhoneStat->iModemDetected=DPCKTTSY_CORE_PHONE_STATUS;
       
   886 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   887 	return KErrNone;
       
   888 	}
       
   889 
       
   890 TInt CPhoneDummyBase::GetCaps(const TTsyReqHandle aTsyReqHandle,RPhone::TCaps*)
       
   891 	{
       
   892 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   893 	return KErrNone;
       
   894 	}
       
   895 
       
   896 TInt CPhoneDummyBase::EnumerateLines(const TTsyReqHandle aTsyReqHandle, TInt*)
       
   897 /**
       
   898  * EnumerateLines - Request not implemented in this dummy TSY
       
   899  */
       
   900 	{
       
   901 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   902 	return KErrNone;
       
   903 	}
       
   904 
       
   905 TInt CPhoneDummyBase::GetLineInfo(const TTsyReqHandle aTsyReqHandle, TLineInfoIndex* /*aLineInfo*/)
       
   906 /**
       
   907  * GetLineInfo - Request not implemented in this dummy TSY
       
   908  */
       
   909 	{
       
   910 	ReqCompleted(aTsyReqHandle,KErrNone);
       
   911 	return KErrNone;
       
   912 	}
       
   913 
       
   914 
       
   915 /*******************************************************************/
       
   916 //
       
   917 // Cancellation functions for line requests
       
   918 //
       
   919 /*******************************************************************/
       
   920 
       
   921 TInt CPhoneDummyBase::ControlledInitialisationCancel(const TTsyReqHandle aTsyReqHandle)
       
   922 	{
       
   923 	ReqCompleted(aTsyReqHandle,KErrCancel);
       
   924 	return KErrNone;
       
   925 	}
       
   926 
       
   927 TInt CPhoneDummyBase::NotifyCapsChangeCancel(const TTsyReqHandle aTsyReqHandle)
       
   928 	{
       
   929 	if (aTsyReqHandle==iNotifyCapsChange.iTsyReqHandle)
       
   930 		{
       
   931 		iFac->RemoveTimer(iNotifyCapsChange);
       
   932 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   933 		return KErrNone;
       
   934 		}
       
   935 	return KErrEtelNotRecognisedCancelHandle;
       
   936 	}
       
   937 
       
   938 TInt CPhoneDummyBase::NotifyModemDetectedCancel(const TTsyReqHandle aTsyReqHandle)
       
   939 	{
       
   940 	if (aTsyReqHandle==iNotifyPhoneDetected.iTsyReqHandle)
       
   941 		{
       
   942 		iFac->RemoveTimer(iNotifyPhoneDetected);
       
   943 		ReqCompleted(aTsyReqHandle,KErrCancel);
       
   944 		return KErrNone;
       
   945 		}
       
   946 	return KErrEtelNotRecognisedCancelHandle;
       
   947 	}
       
   948 
       
   949 /*******************************************************************/
       
   950 //
       
   951 // Asynchronous handler functions - called after a timeout
       
   952 //
       
   953 /*******************************************************************/
       
   954 
       
   955 TInt CPhoneDummyBase::NotifyCapsChangeHandler(TAny* aPtr)
       
   956 	{
       
   957 	This(aPtr)->iFac->ResetPending( This(aPtr)->iNotifyCapsChange);
       
   958 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyCapsChange.iTsyReqHandle,KErrNone);
       
   959 	return KErrNone;
       
   960 	}
       
   961 
       
   962 TInt CPhoneDummyBase::NotifyPhoneDetectedHandler(TAny* aPtr)
       
   963 	{
       
   964 	This(aPtr)->iFac->ResetPending(This(aPtr)->iNotifyPhoneDetected);
       
   965 	This(aPtr)->ReqCompleted(This(aPtr)->iNotifyPhoneDetected.iTsyReqHandle,KErrNone);
       
   966 	return KErrNone;
       
   967 	}
       
   968 
       
   969 
       
   970 /*******************************************************************/
       
   971 //
       
   972 // CPhoneFactoryDummyBase
       
   973 //
       
   974 /*******************************************************************/
       
   975 
       
   976 CPhoneFactoryDummyBase::CPhoneFactoryDummyBase()
       
   977 	{
       
   978 	TRAP_IGNORE(iTimer=CDeltaTimer::NewL(CActive::EPriorityHigh,KEtelTimerGranularity));
       
   979 	}
       
   980 
       
   981 CPhoneFactoryDummyBase::~CPhoneFactoryDummyBase()
       
   982 	{
       
   983 	delete iTimer;
       
   984 	}
       
   985 
       
   986 void CPhoneFactoryDummyBase::QueueTimer(TTsyTimer& aTsyTimer, const TTsyReqHandle aTsyReqHandle,TTimeIntervalMicroSeconds32 aTimeInMicroSeconds,
       
   987 										TInt (*aFunction)(TAny *aPtr), TAny* aPtr)
       
   988 	{
       
   989 	TCallBack callBackFn(aFunction,aPtr);
       
   990  	
       
   991 	aTsyTimer.iEntry.Set(callBackFn);
       
   992 	aTsyTimer.iPending=ETrue;
       
   993 	aTsyTimer.iTsyReqHandle=aTsyReqHandle;
       
   994 
       
   995 	aTimeInMicroSeconds=aTimeInMicroSeconds.Int()+(KEtelTimerGranularity>>2);
       
   996 	if(aTimeInMicroSeconds.Int()<100000)
       
   997 		aTimeInMicroSeconds=aTimeInMicroSeconds.Int()+KEtelTimerGranularity;
       
   998 	
       
   999 	iTimer->Queue(aTimeInMicroSeconds,aTsyTimer.iEntry);
       
  1000 	}
       
  1001 
       
  1002 TBool CPhoneFactoryDummyBase::RemoveTimer(TTsyTimer& aTsyTimer)
       
  1003 	{
       
  1004 	if (aTsyTimer.iPending)
       
  1005 		{
       
  1006 		aTsyTimer.iPending=EFalse;
       
  1007 		iTimer->Remove(aTsyTimer.iEntry);
       
  1008 		return ETrue;
       
  1009 		}
       
  1010 	return EFalse;
       
  1011 	}
       
  1012 
       
  1013 void CPhoneFactoryDummyBase::ResetPending(TTsyTimer& aTsyTimer)
       
  1014 	{
       
  1015 	aTsyTimer.iPending=EFalse;
       
  1016 	}
       
  1017 
       
  1018 TInt CPhoneFactoryDummyBase::GetPhoneInfo(const TInt aIndex, RTelServer::TPhoneInfo& aInfo)
       
  1019 	{
       
  1020 	if (aIndex==0)
       
  1021 		{
       
  1022 		aInfo.iNetworkType=DPCKTTSY_NETWORK_TYPE;
       
  1023 		aInfo.iName=DPCKTTSY_PHONE_NAME;
       
  1024 		aInfo.iNumberOfLines=DPCKTTSY_NUMBER_OF_LINES;
       
  1025 		return KErrNone;
       
  1026 		}
       
  1027 	else
       
  1028 		return KErrNotFound;
       
  1029 	}
       
  1030 
       
  1031 TInt CPhoneFactoryDummyBase::EnumeratePhones()
       
  1032 	{
       
  1033 	return (DPCKTTSY_NUMBER_OF_PHONES);
       
  1034 	}
       
  1035 
       
  1036 /*******************************************************************/
       
  1037 //
       
  1038 // CSubSessionExtDummyBase
       
  1039 //
       
  1040 /*******************************************************************/
       
  1041 
       
  1042 CSubSessionExtDummyBase::CSubSessionExtDummyBase(CPhoneFactoryDummyBase* aFac)
       
  1043 	{
       
  1044 	iFac=aFac;
       
  1045 	}
       
  1046 
       
  1047 CSubSessionExtDummyBase::~CSubSessionExtDummyBase()
       
  1048 	{}
       
  1049 
       
  1050 CPhoneFactoryDummyBase* CSubSessionExtDummyBase::FacPtr() const
       
  1051 	{
       
  1052 	return iFac;
       
  1053 	}
       
  1054