cbsref/telephonyrefplugins/atltsy/atcommand/callcontrol/src/atchld.cpp
branchRCL_3
changeset 65 630d2f34d719
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
       
     1 // Copyright (c) 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 // @file atchld.cpp
       
    15 // This contains CATChld which hold, resume, release, swap one call.
       
    16 // 
       
    17 
       
    18 
       
    19 //sysmtem include
       
    20 
       
    21 //user include
       
    22 #include "atchld.h"
       
    23 #include "ltsycallinformationmanager.h"
       
    24 #include "athangupcommandrecords.h"
       
    25 #include "mslogger.h"
       
    26 
       
    27 //const define
       
    28 const TInt KLtsyCHLDReadTimeout = 3;
       
    29 const TInt KLtsyCHLDWaitForModemTime = 1000*250; // 0.25 seconds
       
    30 _LIT8(KLtsyCHLDCommandFormat1, "AT+CHLD=%d\r");
       
    31 _LIT8(KLtsyCHLDCommandFormat2, "AT+CHLD=%d%d\r");
       
    32 _LIT8(KLtsyReleaseOutgoingCommand, "ATH1\r");    //Hang up outging call
       
    33 
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // CATChld::NewL
       
    37 // other items were commented in a header
       
    38 // ---------------------------------------------------------------------------
       
    39 CATChld* CATChld::NewL(CGlobalPhonemanager& aGloblePhone,
       
    40 		               CCtsyDispatcherCallback& aCtsyDispatcherCallback)
       
    41 	{
       
    42 	CATChld* self = CATChld::NewLC(aGloblePhone, aCtsyDispatcherCallback);
       
    43 	CleanupStack::Pop(self);
       
    44 	return self;
       
    45 	}
       
    46 
       
    47 // ---------------------------------------------------------------------------
       
    48 // CATChld::NewLC
       
    49 // other items were commented in a header
       
    50 // ---------------------------------------------------------------------------
       
    51 CATChld* CATChld::NewLC(CGlobalPhonemanager& aGloblePhone,
       
    52 		               CCtsyDispatcherCallback& aCtsyDispatcherCallback)
       
    53 	{
       
    54 	CATChld* self = new (ELeave) CATChld(aGloblePhone, aCtsyDispatcherCallback);
       
    55 	CleanupStack::PushL(self);
       
    56 	self->ConstructL();
       
    57 	return self;
       
    58 	}
       
    59 
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CATChld::~CATChld
       
    63 // other items were commented in a header
       
    64 // ---------------------------------------------------------------------------
       
    65 CATChld::~CATChld()
       
    66 	{
       
    67 	}
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CATChld::CATChld
       
    71 // other items were commented in a header
       
    72 // ---------------------------------------------------------------------------
       
    73 CATChld::CATChld(CGlobalPhonemanager& aGloblePhone,
       
    74 		         CCtsyDispatcherCallback& aCtsyDispatcherCallback)
       
    75 				 : CAtCommandBase(aGloblePhone, aCtsyDispatcherCallback)
       
    76 	{
       
    77 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::CATChld()"));
       
    78 	
       
    79 	//Set At type
       
    80 	iAtType = ELtsyAT_Call_CHLD;
       
    81 	
       
    82 	//Init variable
       
    83 	InitVariable();
       
    84 	}
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CATChld::InitVariable
       
    88 // other items were commented in a header
       
    89 // ---------------------------------------------------------------------------
       
    90 void CATChld::InitVariable()
       
    91 	{
       
    92 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::InitVariable()"));
       
    93 	
       
    94 	iIOStatus = KErrNone;
       
    95 	iATResult = KErrNone;
       
    96 	iATStep = EATNotInProgress;
       
    97 	iIpcType = ELtsyReqCallHangup;
       
    98 	iChldType = ERleaseSpecificCall;
       
    99 	iCallId = KLtsyErrorCallId;
       
   100 	iConnectedCallId = KLtsyErrorCallId;
       
   101 	iHangupCause = -1;
       
   102 	}
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // CATChld::IsHoldCall
       
   106 // other items were commented in a header
       
   107 // ---------------------------------------------------------------------------
       
   108 TBool CATChld::IsHoldCall(TInt aHoldCallId)
       
   109 	{
       
   110 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::IsHoldCall()"));
       
   111 	if (aHoldCallId >= KLtsyMinCallId && aHoldCallId <= KLtsyMaxCallId)
       
   112 		{
       
   113 		const TLtsyCallInformation& tCallInfo = iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(aHoldCallId);
       
   114 		if (TLtsyCallInformation::EUsed == tCallInfo.GetCallIdIsUsedInfo() &&
       
   115 			TLtsyCallInformation::EHeldCall == tCallInfo.GetCallState())
       
   116 			{
       
   117 			return ETrue;
       
   118 			}		
       
   119 		}
       
   120 	return EFalse;
       
   121 	}
       
   122 
       
   123 // ---------------------------------------------------------------------------
       
   124 // CATChld::IsActiveCall
       
   125 // other items were commented in a header
       
   126 // ---------------------------------------------------------------------------
       
   127 TBool CATChld::IsActiveCall(TInt aActiveCallId)
       
   128 	{
       
   129 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::IsActiveCall()"));
       
   130 	
       
   131 	if (aActiveCallId >= KLtsyMinCallId && aActiveCallId <= KLtsyMaxCallId)
       
   132 		{
       
   133 		const TLtsyCallInformation& tCallInfo = iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(aActiveCallId);
       
   134 		if (TLtsyCallInformation::EUsed == tCallInfo.GetCallIdIsUsedInfo() &&
       
   135 			TLtsyCallInformation::EActiveCall == tCallInfo.GetCallState())
       
   136 			{
       
   137 			return ETrue;
       
   138 			}		
       
   139 		}	
       
   140 	
       
   141 	return EFalse;
       
   142 	}
       
   143 
       
   144 // ---------------------------------------------------------------------------
       
   145 // CATChld::ConstructL
       
   146 // other items were commented in a header
       
   147 // ---------------------------------------------------------------------------
       
   148 void CATChld::ConstructL()
       
   149 	{
       
   150 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::ConstructL()"));
       
   151 	
       
   152 	//Invoke base class function
       
   153 	CAtCommandBase::ConstructL();
       
   154 	
       
   155 	//Set read and write timeout
       
   156 	SetTimeOut(KLtsyDefaultWriteTimeOut, KLtsyCHLDReadTimeout);	
       
   157 	}
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // CATChld::ExecuteCommand
       
   161 // other items were commented in a header
       
   162 // ---------------------------------------------------------------------------
       
   163 void CATChld::ExecuteCommand()
       
   164 	{
       
   165 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::ExecuteCommand()"));
       
   166 	
       
   167 	if (iChldType == EReleaseAllHeldCallOrUDUB ||
       
   168 		iChldType == EReleaseAllActiveCallAndAcceptHeldWaiting ||
       
   169 		iChldType == EHeldAllActiveCallAndAcceptHeldWaiting ||
       
   170 		iChldType == EAddHeldCallToConversation ||
       
   171 		iChldType == ECallTranster)
       
   172 		{
       
   173 		iTxBuffer.Format(KLtsyCHLDCommandFormat1, iChldType);
       
   174 		}
       
   175 	else
       
   176 		{
       
   177 		if (iChldType == ERleaseSpecificCall) //Release one call
       
   178 			{
       
   179 			
       
   180 			const TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(iCallId));
       
   181 			
       
   182 			if (TLtsyCallInformation::EDialingCall == tCallInfo.GetCallState() ||
       
   183 				TLtsyCallInformation::EAlertingCall == 	tCallInfo.GetCallState())
       
   184 				{
       
   185 				//Hang up dialing or Alerting call(Outgoing call)
       
   186 				iTxBuffer.Copy(KLtsyReleaseOutgoingCommand);
       
   187 				}
       
   188 			else //Other call
       
   189 				{
       
   190 				iTxBuffer.Format(KLtsyCHLDCommandFormat2, EReleaseAllActiveCallAndAcceptHeldWaiting, iCallId);
       
   191 				}
       
   192 			}
       
   193 		else
       
   194 			{
       
   195 			iTxBuffer.Format(KLtsyCHLDCommandFormat2, EHeldAllActiveCallAndAcceptHeldWaiting, iCallId);
       
   196 			}
       
   197 		}
       
   198 	
       
   199 	LOGTEXT2(_L8("[Ltsy CallControl] CHLD Command = %S"), &iTxBuffer);
       
   200 	
       
   201 	//Setting waiting for modem time, when Command is too fast, Modem response error
       
   202 	if (iIpcType == ELtsyReqCallHold || 
       
   203 		iIpcType == ELtsyReqCallResume ||
       
   204 		iIpcType == ELtsyReqCallSwap)
       
   205 		{
       
   206 		User::After(KLtsyCHLDWaitForModemTime);
       
   207 		}
       
   208 	
       
   209 	Write();
       
   210 	iATStep = EATWaitForWriteComplete;
       
   211 	}
       
   212 
       
   213 // ---------------------------------------------------------------------------
       
   214 // CATChld::StartRequest
       
   215 // other items were commented in a header
       
   216 // ---------------------------------------------------------------------------
       
   217 void CATChld::StartRequest()
       
   218 	{
       
   219 	ExecuteCommand();
       
   220 	}
       
   221 
       
   222 // ---------------------------------------------------------------------------
       
   223 // CATChld::SetIpcType
       
   224 // other items were commented in a header
       
   225 // ---------------------------------------------------------------------------
       
   226 void CATChld::SetIpcType(TIpcType aIpcType)
       
   227 	{
       
   228 	iIpcType = aIpcType;
       
   229 	}
       
   230 
       
   231 // ---------------------------------------------------------------------------
       
   232 // CATChld::SetChldType
       
   233 // other items were commented in a header
       
   234 // ---------------------------------------------------------------------------
       
   235 void CATChld::SetChldType(TChldType aChldType)
       
   236 	{
       
   237 	iChldType = aChldType;
       
   238 	}
       
   239 
       
   240 // ---------------------------------------------------------------------------
       
   241 // CATChld::SetCallId
       
   242 // other items were commented in a header
       
   243 // ---------------------------------------------------------------------------
       
   244 void CATChld::SetCallId(TInt aCallId)
       
   245 	{
       
   246 	iCallId = aCallId;
       
   247 	}
       
   248 
       
   249 // ---------------------------------------------------------------------------
       
   250 // CATChld::SetConnectedCallId
       
   251 // other items were commented in a header
       
   252 // ---------------------------------------------------------------------------
       
   253 void CATChld::SetConnectedCallId(TInt aConnectedCallId)
       
   254 	{
       
   255 	iConnectedCallId = aConnectedCallId;
       
   256 	}
       
   257 
       
   258 // ---------------------------------------------------------------------------
       
   259 // CATChld::SetHangupCase
       
   260 // other items were commented in a header
       
   261 // ---------------------------------------------------------------------------
       
   262 void CATChld::SetHangupCase(TInt aHangupCase)
       
   263 	{
       
   264 	iHangupCause = aHangupCase;
       
   265 	}
       
   266 
       
   267 // ---------------------------------------------------------------------------
       
   268 // CATChld::ParseResponseL
       
   269 // other items were commented in a header
       
   270 // ---------------------------------------------------------------------------
       
   271 void CATChld::ParseResponseL(const TDesC8& aResponseBuf)
       
   272 	{
       
   273 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::ParseResponseL()"));
       
   274 	
       
   275 	if (aResponseBuf.Match(KLtsyOkString) == 0)
       
   276 		{
       
   277 		iATResult = KErrNone;
       
   278 		}
       
   279 	else if (aResponseBuf.Match(KLtsyErrorString) == 0)
       
   280 		{
       
   281 		iATResult = KErrArgument;
       
   282 		}
       
   283 	}
       
   284 
       
   285 // ---------------------------------------------------------------------------
       
   286 // CATChld::HandleIOError
       
   287 // other items were commented in a header
       
   288 // ---------------------------------------------------------------------------
       
   289 void CATChld::HandleIOError()
       
   290 	{
       
   291 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleIOError()"));
       
   292 	
       
   293 	//Hangup
       
   294 	if (iIpcType == ELtsyReqCallHangup)
       
   295 		{
       
   296 		iCtsyDispatcherCallback.CallbackCallControlHangUpComp(iIOStatus, iCallId);
       
   297 		}
       
   298 	else if (iIpcType == ELtsyReqCallHold) //Hold call
       
   299 		{
       
   300 		iCtsyDispatcherCallback.CallbackCallControlHoldComp(iIOStatus, iCallId);
       
   301 		}
       
   302 	else if (iIpcType == ELtsyReqCallResume) //Resume call
       
   303 		{
       
   304 		iCtsyDispatcherCallback.CallbackCallControlResumeComp(iIOStatus, iCallId);
       
   305 		}
       
   306 	else if (iIpcType == ELtsyReqCallSwap) //Swap call
       
   307 		{
       
   308 		iCtsyDispatcherCallback.CallbackCallControlSwapComp(iIOStatus);
       
   309 		}		
       
   310 	}
       
   311 
       
   312 // ---------------------------------------------------------------------------
       
   313 // CATChld::HandleResponseError
       
   314 // other items were commented in a header
       
   315 // ---------------------------------------------------------------------------
       
   316 void CATChld::HandleResponseError()
       
   317 	{
       
   318 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleResponseError()"));
       
   319 	
       
   320 	//Hangup
       
   321 	if (iIpcType == ELtsyReqCallHangup)
       
   322 		{
       
   323 		iCtsyDispatcherCallback.CallbackCallControlHangUpComp(iATResult, iCallId);
       
   324 		}
       
   325 	else if (iIpcType == ELtsyReqCallHold) //Hold call
       
   326 		{
       
   327 		iCtsyDispatcherCallback.CallbackCallControlHoldComp(iATResult, iCallId);
       
   328 		}
       
   329 	else if (iIpcType == ELtsyReqCallResume) //Resume call
       
   330 		{
       
   331 		iCtsyDispatcherCallback.CallbackCallControlResumeComp(iATResult, iCallId);
       
   332 		}
       
   333 	else if (iIpcType == ELtsyReqCallSwap) //Swap call
       
   334 		{
       
   335 		iCtsyDispatcherCallback.CallbackCallControlSwapComp(iATResult);
       
   336 		}
       
   337 	}
       
   338 
       
   339 // ---------------------------------------------------------------------------
       
   340 // CATChld::HandleCHLDComplete
       
   341 // other items were commented in a header
       
   342 // ---------------------------------------------------------------------------
       
   343 void CATChld::HandleCHLDComplete()
       
   344 	{
       
   345 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleCHLDComplete()"));
       
   346 	
       
   347 	//Hangup
       
   348 	if (iIpcType == ELtsyReqCallHangup)
       
   349 		{
       
   350 		HandleHangupComplete();
       
   351 		}
       
   352 	else if (iIpcType == ELtsyReqCallHold) //Hold call
       
   353 		{
       
   354 		HandleHoldComplete();
       
   355 		}
       
   356 	else if (iIpcType == ELtsyReqCallResume) //Resume call
       
   357 		{
       
   358 		HandleResumeComplete();
       
   359 		}
       
   360 	else if (iIpcType == ELtsyReqCallSwap) //Swap call
       
   361 		{
       
   362 		HandleSwapComplete();
       
   363 		}
       
   364 	}
       
   365 
       
   366 // ---------------------------------------------------------------------------
       
   367 // CATChld::HandleHangupComplete
       
   368 // other items were commented in a header
       
   369 // ---------------------------------------------------------------------------
       
   370 void CATChld::HandleHangupComplete()
       
   371 	{
       
   372 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleHangupComplete()"));
       
   373 	
       
   374 	const TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(iCallId));
       
   375 	
       
   376 	if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed)
       
   377 		{
       
   378 		if (tCallInfo.GetCallState() == TLtsyCallInformation::EInComingCall ||
       
   379 			tCallInfo.GetCallState() == TLtsyCallInformation::EWaitingCall	)
       
   380 			{
       
   381 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrGsmCCCallRejected, 
       
   382 					                                                             iCallId, 
       
   383 					                                                             RMobileCall::EStatusDisconnecting);
       
   384 			
       
   385 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrGsmCCCallRejected, 
       
   386 					                                                             iCallId, 
       
   387 					                                                             RMobileCall::EStatusIdle);			
       
   388 			}
       
   389 		else
       
   390 			{
       
   391 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrGsmCCNormalCallClearing, 
       
   392 					                                                             iCallId, 
       
   393 					                                                             RMobileCall::EStatusDisconnecting);
       
   394 			
       
   395 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrGsmCCNormalCallClearing, 
       
   396 					                                                             iCallId, 
       
   397 					                                                             RMobileCall::EStatusIdle);			
       
   398 			}
       
   399 		}
       
   400 	
       
   401 	//Call back
       
   402 	iCtsyDispatcherCallback.CallbackCallControlHangUpComp(KErrNone, iCallId);
       
   403 	//Setting all call id state unused
       
   404 	iPhoneGlobals.GetCallInfoManager().ResetCallInformationByCallId(iCallId);
       
   405 	}
       
   406 
       
   407 
       
   408 // ---------------------------------------------------------------------------
       
   409 // CATChld::HandleHoldComplete
       
   410 // other items were commented in a header
       
   411 // ---------------------------------------------------------------------------
       
   412 void CATChld::HandleHoldComplete()
       
   413 	{
       
   414 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleHoldComplete()"));
       
   415 	
       
   416 	iCtsyDispatcherCallback.CallbackCallControlHoldComp(KErrNone, iCallId);
       
   417 	iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   418 			                                                             iCallId, 
       
   419 			                                                             RMobileCall::EStatusHold);
       
   420 	
       
   421 	//Notify CTSY Call id Idel
       
   422 	for (TInt n = KLtsyMinCallId; n <= KLtsyMaxCallId; n++)
       
   423 		{
       
   424 		TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(n));
       
   425 		if (n == iCallId)
       
   426 			{
       
   427 			if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed)
       
   428 				{
       
   429 				//Setting my call state active
       
   430 				tCallInfo.SetCallState(TLtsyCallInformation::EHeldCall);				
       
   431 				}
       
   432 			}
       
   433 		else
       
   434 			{
       
   435 			if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed)
       
   436 				{
       
   437 				//Setting my call state active
       
   438 				tCallInfo.SetCallState(TLtsyCallInformation::EActiveCall);
       
   439 				
       
   440 				//Notify CTSY call state change
       
   441 				iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   442 																					 n,
       
   443 																                     RMobileCall::EStatusConnected);
       
   444 				}
       
   445 			}
       
   446 		}	
       
   447 	}
       
   448 
       
   449 // ---------------------------------------------------------------------------
       
   450 // CATChld::HandleResumeComplete
       
   451 // other items were commented in a header
       
   452 // ---------------------------------------------------------------------------
       
   453 void CATChld::HandleResumeComplete()
       
   454 	{
       
   455 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleResumeComplete()"));
       
   456 	
       
   457 	iCtsyDispatcherCallback.CallbackCallControlResumeComp(KErrNone, iCallId);
       
   458 	iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   459 			                                                             iCallId, 
       
   460 			                                                             RMobileCall::EStatusConnected);
       
   461 
       
   462 	//Notify CTSY Call id Idel
       
   463 	for (TInt n = KLtsyMinCallId; n <= KLtsyMaxCallId; n++)
       
   464 		{
       
   465 		TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(n));
       
   466 		if (n == iCallId)
       
   467 			{
       
   468 			if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed)
       
   469 				{
       
   470 				//Setting my call state active
       
   471 				tCallInfo.SetCallState(TLtsyCallInformation::EActiveCall);				
       
   472 				}			
       
   473 			}
       
   474 		else
       
   475 			{
       
   476 			if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed)
       
   477 				{
       
   478 				//Setting my call state active
       
   479 				tCallInfo.SetCallState(TLtsyCallInformation::EHeldCall);
       
   480 				
       
   481 				//Notify CTSY call state change
       
   482 				iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   483 																					 n,
       
   484 																                     RMobileCall::EStatusHold);
       
   485 				}			
       
   486 			}
       
   487 		}
       
   488 	}
       
   489 
       
   490 // ---------------------------------------------------------------------------
       
   491 // CATChld::HandleSwapComplete
       
   492 // other items were commented in a header
       
   493 // ---------------------------------------------------------------------------
       
   494 void CATChld::HandleSwapComplete()
       
   495 	{
       
   496 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::HandleSwapComplete()"));
       
   497 	
       
   498 	iCtsyDispatcherCallback.CallbackCallControlSwapComp(KErrNone);
       
   499 	
       
   500 	//One call or two calls situation
       
   501 	for (TInt n = KLtsyMinCallId; n <= KLtsyMaxCallId; n++)
       
   502 		{
       
   503 		TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(n));
       
   504 		
       
   505 		if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed &&
       
   506 			tCallInfo.GetCallState() == TLtsyCallInformation::EActiveCall)
       
   507 			{
       
   508 			tCallInfo.SetCallState(TLtsyCallInformation::EHeldCall);
       
   509 			//Notify CTSY call state change
       
   510 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   511 																				 n,
       
   512 															                     RMobileCall::EStatusHold);			
       
   513 			}
       
   514 		else if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed &&
       
   515 				((tCallInfo.GetCallState() == TLtsyCallInformation::EHeldCall) || 
       
   516 				 (tCallInfo.GetCallState() == TLtsyCallInformation::EWaitingCall) ||
       
   517 				 (tCallInfo.GetCallState() == TLtsyCallInformation::EInComingCall))) //????
       
   518 			{
       
   519 			tCallInfo.SetCallState(TLtsyCallInformation::EActiveCall);
       
   520 			//Notify CTSY call state change
       
   521 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   522 																				 n,
       
   523 															                     RMobileCall::EStatusConnected);			
       
   524 			}		
       
   525 		}
       
   526 	}
       
   527 
       
   528 // ---------------------------------------------------------------------------
       
   529 // CATChld::Complete
       
   530 // other items were commented in a header
       
   531 // ---------------------------------------------------------------------------
       
   532 void CATChld::Complete()
       
   533 	{
       
   534 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::Complete()"));
       
   535 	
       
   536 	//Check Hang up arrray
       
   537 	if ((iIpcType == ELtsyReqCallHangup) && iPhoneGlobals.GetCallInfoManager().GetHangupCommandRecords().IsHaveRecords())
       
   538 		{
       
   539 		InitVariable();
       
   540 		
       
   541 		TATHanupCommandInfo tHangupInfo;
       
   542 		iPhoneGlobals.GetCallInfoManager().GetHangupCommandRecords().GetFirstHangupCommandInfoAndRemoveIt(tHangupInfo);
       
   543 		
       
   544 		//Set hang up info
       
   545 		SetCallId(tHangupInfo.iCallId);
       
   546 		SetHangupCase(tHangupInfo.iHangupCause);
       
   547 		SetIpcType(CATChld::ELtsyReqCallHangup);
       
   548 		SetChldType(CATChld::ERleaseSpecificCall);
       
   549 		StartRequest();
       
   550 		return;
       
   551 		}
       
   552 	
       
   553 	//Invoke base class complete
       
   554 	CAtCommandBase::Complete();
       
   555 	
       
   556 	//Set hang up active
       
   557 	iPhoneGlobals.GetCallInfoManager().GetHangupCommandRecords().SetHangupActiveFlag(EFalse);
       
   558 	
       
   559 	//Let other command can use I/O port
       
   560 	iPhoneGlobals.iEventSignalActive = EFalse;
       
   561 	}
       
   562 
       
   563 // ---------------------------------------------------------------------------
       
   564 // CATChld::EventSignal
       
   565 // other items were commented in a header
       
   566 // ---------------------------------------------------------------------------
       
   567 void CATChld::EventSignal(TAtEventSource aEventSource, TInt aStatus)
       
   568 	{
       
   569 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATChld::EventSignal()"));
       
   570 	if(aEventSource == EReadCompletion)
       
   571 	    {
       
   572 	    LOGTEXT(_L8("[Ltsy CallControl] The EventSource = EReadCompletion"));
       
   573 	    }
       
   574 	else if(aEventSource == EWriteCompletion)
       
   575 	    {
       
   576 	    LOGTEXT(_L8("[Ltsy CallControl] The EventSource = EWriteCompletion"));
       
   577 	    }
       
   578 	else if(aEventSource == ETimeoutCompletion)
       
   579 	    {
       
   580 	    LOGTEXT(_L8("[Ltsy CallControl] The EventSource = ETimeoutCompletion"));
       
   581 	    }
       
   582 	else
       
   583 	    {
       
   584 	    LOGTEXT(_L8("[Ltsy CallControl] The EventSource = Unknown"));
       
   585 	    }
       
   586 	    
       
   587 	LOGTEXT2(_L8("[Ltsy CallControl]aStatus = %d"),aStatus);
       
   588 
       
   589 	iIOStatus = aStatus;
       
   590 	
       
   591 	if (iIOStatus != KErrNone)
       
   592 		{
       
   593 		HandleIOError();
       
   594 		Complete();
       
   595 		return;
       
   596 		}
       
   597 	
       
   598 	switch (iATStep)
       
   599 		{
       
   600 		case EATWaitForWriteComplete:
       
   601 			iATStep = EATReadComplete;
       
   602 			break;
       
   603 			
       
   604 		case EATReadComplete:
       
   605 			ClearCurrentLine();
       
   606 			if (iATResult == KErrNone)
       
   607 				{
       
   608 				HandleCHLDComplete();
       
   609 				}
       
   610 			else
       
   611 				{
       
   612 				HandleResponseError();
       
   613 				}
       
   614 			Complete();
       
   615 			break;
       
   616 			
       
   617 		default:
       
   618 			break;
       
   619 		}
       
   620 	}
       
   621 
       
   622 //End of file