telephonyserverplugins/multimodetsy/hayes/ATANSWER.CPP
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
   479 void CATAnswerData::Complete(TInt aError,TEventSource aSource)
   479 void CATAnswerData::Complete(TInt aError,TEventSource aSource)
   480 	{
   480 	{
   481 	CATDataCallConnectCommands::Complete(aError,aSource);
   481 	CATDataCallConnectCommands::Complete(aError,aSource);
   482 	}
   482 	}
   483 
   483 
       
   484 //
       
   485 //	CATAnswerFax
       
   486 //
       
   487 
       
   488 CATAnswerFax* CATAnswerFax::NewL(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
       
   489 	{
       
   490 	CATAnswerFax* answer=new(ELeave) CATAnswerFax(aIo, aTelObject, aInit,aPhoneGlobals);
       
   491 	CleanupStack::PushL(answer);
       
   492 	answer->ConstructL();
       
   493 	CleanupStack::Pop();
       
   494 	return answer;
       
   495 	}
       
   496 
       
   497 CATAnswerFax::CATAnswerFax(CATIO* aIo, CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals)
       
   498 											: CATFaxCallConnectCommands(aIo,aTelObject,aInit,aPhoneGlobals)
       
   499 	{}
       
   500 
       
   501 CATAnswerFax::~CATAnswerFax()
       
   502 	{}
       
   503 
       
   504 void CATAnswerFax::Start(TTsyReqHandle aTsyReqHandle, TAny* /*aParams*/)
       
   505 	{
       
   506 	LOGTEXT(_L8("Starting Answer fax call"));
       
   507 //	CATFaxCallConnectCommands::Start(aTsyReqHandle,aParams);	
       
   508 
       
   509 	//-- the change made by Dmitry Lyokhin. PIA-586KGE defect fix
       
   510 	//-- CATFaxCallConnectCommands::Start(); starts answering a fax call from sending 
       
   511 	//-- init strings to the modem that occassionally causes a collision with incoming "+CRING".
       
   512 	//-- now state machine starts with EATCallInitCompleted state that does nothing.
       
   513 
       
   514 	iReqHandle=aTsyReqHandle;
       
   515 	__ASSERT_ALWAYS(iIo->AddExpectString(this,KNotifyMeIfErrorString) != NULL, Panic(EGeneral));
       
   516 	
       
   517 	iPreConnectState=CATCallConnectCommands::EATCallInitCompleted; 
       
   518 
       
   519 	LOGTEXT2(_L8("-CATAnswerFax::Start, iPreConnectState=%d"), iPreConnectState);
       
   520 
       
   521 	EventSignal(EReadCompletion);	// EReadCompletion is a dummy enum here
       
   522 	}
       
   523 
       
   524 void CATAnswerFax::Stop(TTsyReqHandle aTsyReqHandle)
       
   525 //
       
   526 //	If still doing pre-answer command, cancel that, otherwise tell the fax server to cancel
       
   527 //
       
   528 	{
       
   529 	LOGTEXT(_L8("Cancelling Answer Fax Call Command"));
       
   530 	CATFaxCallConnectCommands::Stop(aTsyReqHandle);
       
   531 	}
       
   532 
       
   533 void CATAnswerFax::EventSignal(TEventSource aSource)
       
   534 	{
       
   535 	if((aSource==ETimeOutCompletion)
       
   536 		&&(iPreConnectState!=EATWaitForATCheckOK))
       
   537 		{
       
   538 		LOGTEXT(_L8("Timeout Error during Answer"));
       
   539 		Complete(KErrTimedOut,aSource);
       
   540 		return;
       
   541 		}
       
   542 	if (iPreConnectState!=CATCallConnectCommands::EATInitCompleted
       
   543 		&& iPreConnectState!=CATCallConnectCommands::ENotInProgress)
       
   544 		{
       
   545 		CATCallConnectCommands::PreConnectEventSignal(aSource);
       
   546 		}
       
   547 	}
       
   548 
       
   549 void CATAnswerFax::CompleteSuccessfully()
       
   550 	{
       
   551 	REINTERPRET_CAST(CCallMobileFax*,iTelObject)->FaxAnswer(iReqHandle);	
       
   552 	}