telephonyserverplugins/attestltsy/atcommand/callcontrol/src/atdialvoice.cpp
branchAT_Test_LTSY
changeset 1 4047d69ee0e4
child 3 70f1e1f5dabe
equal deleted inserted replaced
0:3553901f7fa8 1:4047d69ee0e4
       
     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 atdialvoice.cpp
       
    15 // This contains CATDialVoice which dial a voice call.
       
    16 //
       
    17 
       
    18 //user include
       
    19 #include "atdialvoice.h"
       
    20 #include "ltsycommondefine.h"
       
    21 #include <ctsy/ltsy/cctsydispatchercallback.h>
       
    22 #include "globalphonemanager.h"
       
    23 #include "activecommandstore.h"
       
    24 #include "atmanager.h"
       
    25 #include "ltsycallinformationmanager.h"
       
    26 #include "mslogger.h"
       
    27 
       
    28 //const define 
       
    29 const TInt KLtsyWaitForConnect = 60;
       
    30 _LIT8(KLtsyDialVoiceCommandFormat,"ATD%S;\r");
       
    31 _LIT8(KLtsyBusyString, "BUSY");
       
    32 _LIT8(KLtsyNoAnswerString, "NO ANSWER");
       
    33 _LIT8(KLtsyUnsolicitedCallCreated, "+WIND: 5*");
       
    34 _LIT8(KLtsyUnsolicitedCallingAltert, "+WIND: 2");
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // CATDialVoice::NewL
       
    38 // other items were commented in a header
       
    39 // ---------------------------------------------------------------------------
       
    40 CATDialVoice* CATDialVoice::NewL(CGlobalPhonemanager& aGloblePhone,
       
    41 		                         CCtsyDispatcherCallback& aCtsyDispatcherCallback)
       
    42 	{
       
    43 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::NewL()"));
       
    44 	
       
    45 	CATDialVoice* self = CATDialVoice::NewLC(aGloblePhone, aCtsyDispatcherCallback);
       
    46 	CleanupStack::Pop(self);
       
    47 	return self;
       
    48 	}
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // CATDialVoice::NewLC
       
    52 // other items were commented in a header
       
    53 // ---------------------------------------------------------------------------
       
    54 CATDialVoice* CATDialVoice::NewLC(CGlobalPhonemanager& aGloblePhone,
       
    55 		                          CCtsyDispatcherCallback& aCtsyDispatcherCallback)
       
    56 	{
       
    57 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::NewLC()"));
       
    58 	
       
    59 	CATDialVoice* self = new (ELeave) CATDialVoice(aGloblePhone, aCtsyDispatcherCallback);
       
    60 	CleanupStack::PushL(self);
       
    61 	self->ConstructL();
       
    62 	return self;
       
    63 	}
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CATDialVoice::~CATDialVoice
       
    67 // other items were commented in a header
       
    68 // ---------------------------------------------------------------------------
       
    69 CATDialVoice::~CATDialVoice()
       
    70 	{
       
    71 	delete iATH;
       
    72 	}
       
    73 
       
    74 // ---------------------------------------------------------------------------
       
    75 // CATDialVoice::CATDialVoice
       
    76 // other items were commented in a header
       
    77 // ---------------------------------------------------------------------------
       
    78 CATDialVoice::CATDialVoice(CGlobalPhonemanager& aGloblePhone, 
       
    79 		                   CCtsyDispatcherCallback& aCtsyDispatcherCallback)
       
    80 				           :CAtCommandBase(aGloblePhone, aCtsyDispatcherCallback)	
       
    81 	{
       
    82 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::CATDialVoice()"));
       
    83 	
       
    84 	iAtType = ELtsyAT_Call_ATD;
       
    85 	iResult = KErrNone;
       
    86 	iOKFounded = EFalse;
       
    87 	iCallId = KLtsyErrorCallId;
       
    88 	iStatus = KErrNone;
       
    89 	iDialStep = EATDialNotInProgress;
       
    90 	iIsEmergencyCall = EFalse;
       
    91 	}
       
    92 
       
    93 // ---------------------------------------------------------------------------
       
    94 // CATDialVoice::ConstructL
       
    95 // other items were commented in a header
       
    96 // ---------------------------------------------------------------------------
       
    97 void CATDialVoice::ConstructL()
       
    98 	{
       
    99 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::ConstructL()"));
       
   100 	
       
   101 	//Invoke base class function
       
   102 	CAtCommandBase::ConstructL();
       
   103 	
       
   104 	//Set read and write timeout
       
   105 	SetTimeOut(KLtsyDefaultWriteTimeOut, KLtsyWaitForConnect);
       
   106 	
       
   107 	//Add expecting string
       
   108 	AddExpectStringL(KLtsyUnsolicitedCallCreated);
       
   109 	AddExpectStringL(KLtsyUnsolicitedCallingAltert);
       
   110 	AddExpectStringL(KLtsyBusyString);
       
   111 	AddExpectStringL(KLtsyNoAnswerString);
       
   112 	AddExpectStringL(KLtsyNoCarrierString);
       
   113 	
       
   114 	//Create Hang up call
       
   115 	iATH = CATHangUp::NewL(iPhoneGlobals, iCtsyDispatcherCallback);
       
   116 	
       
   117 	//Add Observer
       
   118 	iATH->AddAllCallReleaseObserver(this);
       
   119 	}
       
   120 
       
   121 // ---------------------------------------------------------------------------
       
   122 // CATDialVoice::SetEmergnecyCallFlag
       
   123 // other items were commented in a header
       
   124 // ---------------------------------------------------------------------------
       
   125 void CATDialVoice::InitVariable()
       
   126 	{
       
   127 	iAtType = ELtsyAT_Call_ATD;
       
   128 	iResult = KErrNone;
       
   129 	iOKFounded = EFalse;
       
   130 	iCallId = KLtsyErrorCallId;
       
   131 	iStatus = KErrNone;
       
   132 	iDialStep = EATDialNotInProgress;
       
   133 	}
       
   134 
       
   135 // ---------------------------------------------------------------------------
       
   136 // CATDialVoice::ReleaseAllCallComplete
       
   137 // other items were commented in a header
       
   138 // ---------------------------------------------------------------------------
       
   139 void CATDialVoice::ReleaseAllCallComplete(TInt /*aError*/)
       
   140 	{
       
   141 	//if aError equal KErrNone or other dial Emergency call
       
   142 	ExecuteCommand();
       
   143 	}
       
   144 
       
   145 // ---------------------------------------------------------------------------
       
   146 // CATDialVoice::SetEmergnecyCallFlag
       
   147 // other items were commented in a header
       
   148 // ---------------------------------------------------------------------------
       
   149 void CATDialVoice::SetEmergnecyCallFlag(TBool aIsEmergencyCall)
       
   150 	{
       
   151 	iIsEmergencyCall = aIsEmergencyCall;
       
   152 	}
       
   153 
       
   154 // ---------------------------------------------------------------------------
       
   155 // CATDialVoice::SetTelephoneNumber
       
   156 // other items were commented in a header
       
   157 // ---------------------------------------------------------------------------
       
   158 void CATDialVoice::SetTelephoneNumber(const TDesC8& aTelNum)
       
   159 	{
       
   160 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::SetTelephoneNumber()"));
       
   161 	
       
   162 	iTelNum.Copy(aTelNum.Left(iTelNum.MaxLength()));
       
   163 	}
       
   164 
       
   165 // ---------------------------------------------------------------------------
       
   166 // CATDialVoice::ExecuteCommand
       
   167 // other items were commented in a header
       
   168 // ---------------------------------------------------------------------------
       
   169 void CATDialVoice::ExecuteCommand()
       
   170 	{
       
   171 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::ExecuteCommand()"));
       
   172 	LOGTEXT2(_L8("[Ltsy CallControl] Telephone number = %S"), &iTelNum);
       
   173 	
       
   174 	iOKFounded = EFalse;
       
   175 	iTxBuffer.Format(KLtsyDialVoiceCommandFormat, &iTelNum);
       
   176 	Write(); 
       
   177 	iDialStep = EATWaitForWriteComplete;
       
   178 	}
       
   179 
       
   180 // ---------------------------------------------------------------------------
       
   181 // CATDialVoice::StartRequest
       
   182 // other items were commented in a header
       
   183 // ---------------------------------------------------------------------------
       
   184 void CATDialVoice::StartRequest()
       
   185 	{
       
   186 	if (iIsEmergencyCall && iPhoneGlobals.GetCallInfoManager().IsHaveUsedCallId())
       
   187 		{
       
   188 		iATH->InitVariable();
       
   189 		iATH->StartRequest();
       
   190 		}
       
   191 	else
       
   192 		{
       
   193 		ExecuteCommand();
       
   194 		}
       
   195 	}
       
   196 
       
   197 // ---------------------------------------------------------------------------
       
   198 // CATDialVoice::ParseUnsolicitedCommandBufL
       
   199 // other items were commented in a header
       
   200 // ---------------------------------------------------------------------------
       
   201 TInt CATDialVoice::ParseUnsolicitedCommandBufL(TUnsolicitedParams& aParams, const TDesC8& aCommandBuf)
       
   202 	{
       
   203 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::ParseUnsolicitedCommandBufL()"));
       
   204 	
       
   205 	RArray<TPtrC8> rArray;
       
   206 	CleanupClosePushL(rArray);
       
   207 	
       
   208 	iParser->ParseRespondedBuffer(rArray, aCommandBuf);
       
   209 	aParams.InitParams();
       
   210 	
       
   211 	TInt nCount = rArray.Count();
       
   212 	if (nCount <= 1)
       
   213 		{
       
   214 		CleanupStack::PopAndDestroy(1);
       
   215 		return KErrGeneral;
       
   216 		}
       
   217 
       
   218 	for(TInt index =1; index < nCount; index++)
       
   219 		{
       
   220 		if(index == 1)
       
   221 			{
       
   222 			TInt tVal(0);
       
   223 			TLex8 tLex(rArray[index]);
       
   224 			TInt nRes = tLex.Val(tVal);
       
   225 			if (nRes == KErrNone)
       
   226 				{
       
   227 				aParams.iEvent = tVal;
       
   228 				}
       
   229 			else
       
   230 				{
       
   231 				CleanupStack::PopAndDestroy(1);
       
   232 				return nRes;
       
   233 				}
       
   234 			}
       
   235 		
       
   236 		if(index == 2)
       
   237 			{
       
   238 			TInt tVal(0);
       
   239 			TLex8 tLex(rArray[index]);
       
   240 			TInt nRes = tLex.Val(tVal);
       
   241 			if (nRes == KErrNone)
       
   242 				{
       
   243 				aParams.iIdx = tVal;
       
   244 				}
       
   245 			else
       
   246 				{
       
   247 				CleanupStack::PopAndDestroy(1);	
       
   248 				return nRes;
       
   249 				}
       
   250 			}
       
   251 		}
       
   252 	
       
   253 	CleanupStack::Pop(1);
       
   254 	
       
   255 	return KErrNone;
       
   256 	}
       
   257 
       
   258 // ---------------------------------------------------------------------------
       
   259 // CATDialVoice::ProcessUnsolicitedCallCreated
       
   260 // other items were commented in a header
       
   261 // ---------------------------------------------------------------------------
       
   262 TInt CATDialVoice::ProcessUnsolicitedCallCreated(const TUnsolicitedParams& aParams)
       
   263 	{
       
   264 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::ProcessUnsolicitedCallCreated()"));
       
   265 	
       
   266 	if (aParams.iEvent !=  KLtsyUnsolicitedEvent05)
       
   267 		{
       
   268 		return KErrGeneral;
       
   269 		}
       
   270 	
       
   271 	TInt nCallId = aParams.iIdx;
       
   272 	if ((nCallId < KLtsyMinCallId) || (nCallId > KLtsyMaxCallId))
       
   273 		{
       
   274 		nCallId = iPhoneGlobals.GetCallInfoManager().FindUnUesedCallId();
       
   275 		if (KErrNotFound == nCallId)
       
   276 			{
       
   277 			return KErrNotFound;
       
   278 			}
       
   279 		}
       
   280 	
       
   281 	iCallId = nCallId;
       
   282 	return KErrNone;
       
   283 	}
       
   284 
       
   285 // ---------------------------------------------------------------------------
       
   286 // CATDialVoice::ParseResponseL
       
   287 // other items were commented in a header
       
   288 // ---------------------------------------------------------------------------
       
   289 void CATDialVoice::ParseResponseL(const TDesC8& aResponseBuf)
       
   290 	{
       
   291 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::ParseResponseL()"));
       
   292 	
       
   293 	if (aResponseBuf.Match(KLtsyUnsolicitedCallCreated) == 0)
       
   294 		{
       
   295 		LOGTEXT2(_L8("[Ltsy CallControl] iDialStep = %d"),iDialStep);
       
   296 		ASSERT(iDialStep == EATWaitForDiallingComplete);
       
   297 		
       
   298 		TUnsolicitedParams aParams;
       
   299 		iResult = ParseUnsolicitedCommandBufL(aParams, aResponseBuf);
       
   300 		if (iResult == KErrNone)
       
   301 			{
       
   302 			iResult = ProcessUnsolicitedCallCreated(aParams);
       
   303 			}
       
   304 		}
       
   305 	else if (aResponseBuf.Match(KLtsyUnsolicitedCallingAltert) == 0)
       
   306 		{
       
   307 		LOGTEXT2(_L8("[Ltsy CallControl] iDialStep = %d"),iDialStep);
       
   308 		ASSERT(iDialStep == EATWaitForConnectingComplete);
       
   309 		iResult = KErrNone;
       
   310 		}
       
   311 	else if (aResponseBuf.Match(KLtsyOkString) == 0)
       
   312 		{
       
   313 		LOGTEXT2(_L8("[Ltsy CallControl] iDialStep = %d"),iDialStep);
       
   314 		LOGTEXT(_L8("[Ltsy CallControl] The call was connected successfully"));
       
   315 		
       
   316 		// if no KLtsyUnsolicitedCallingAltert string was received before we receive "OK"
       
   317 		// it aslo means the call has been connected even though such KLtsyUnsolicitedCallingAltert
       
   318 		// was not received
       
   319 		if(iDialStep == EATWaitForConnectingComplete)
       
   320 		    {
       
   321 		    LOGTEXT(_L8("[Ltsy CallControl] No alert string [+WIND: 2] received before we receive string [ok]"));
       
   322 		    
       
   323 		    HandleConnectingComplete();
       
   324 		    iDialStep = EATWaitForConnectedComplete;
       
   325 		    }
       
   326 		
       
   327 		iResult = KErrNone;
       
   328 		}
       
   329 	else if (aResponseBuf.Match(KLtsyBusyString) == 0)
       
   330 		{
       
   331 		//iResult = KErrEtelBusyDetected;
       
   332 		iResult = KErrGsmCCUserBusy;
       
   333 		}
       
   334 	else if (aResponseBuf.Match(KLtsyNoAnswerString) == 0)
       
   335 		{
       
   336 		//iResult = KErrEtelNoAnswer;
       
   337 		iResult = KErrGsmCCUserAlertingNoAnswer;
       
   338 		}
       
   339 	else if (aResponseBuf.Match(KLtsyNoCarrierString) == 0)
       
   340 		{
       
   341 		// that could be the problem of the client, when there were two ongoing call, but a new call is coming up. As
       
   342 		// GSM only support two ongoing calls
       
   343 		if(iCallId == KLtsyErrorCallId)
       
   344 		    {
       
   345 		    iResult = KErrEtelNoCarrier;
       
   346 		    return;
       
   347 		    }
       
   348 		        
       
   349 		const TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(iCallId));		
       
   350 		if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed)
       
   351 			{
       
   352 			if (tCallInfo.GetCallState() == TLtsyCallInformation::EDialingCall)
       
   353 				{
       
   354 				iResult = KErrEtelNoCarrier;
       
   355 				}
       
   356 			else
       
   357 				{
       
   358 				iResult = KErrGsmCCNormalCallClearing;
       
   359 				}
       
   360 			}
       
   361 		}
       
   362 	else if (aResponseBuf.Match(KLtsyErrorString) == 0)
       
   363 		{
       
   364 		iResult = KErrArgument;
       
   365 		}
       
   366 	else
       
   367 		{
       
   368 		iResult = KErrGeneral;
       
   369 		}
       
   370 	}
       
   371 
       
   372 // ---------------------------------------------------------------------------
       
   373 // CATDialVoice::Complete
       
   374 // other items were commented in a header
       
   375 // ---------------------------------------------------------------------------
       
   376 void CATDialVoice::Complete()
       
   377 	{
       
   378 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::Complete()"));
       
   379 	LOGTEXT2(_L8("[Ltsy CallControl] iStatus = %d"), iStatus);
       
   380 	LOGTEXT2(_L8("[Ltsy CallControl] iResult = %d"), iResult);
       
   381 	//Remove Active Command and Stop timer
       
   382 	CAtCommandBase::Complete();
       
   383 		
       
   384 	//Let other command can use I/O port
       
   385 	iPhoneGlobals.iEventSignalActive = EFalse;
       
   386 	}
       
   387 
       
   388 // ---------------------------------------------------------------------------
       
   389 // CATDialVoice::HandleIOErrorL
       
   390 // other items were commented in a header
       
   391 // ---------------------------------------------------------------------------
       
   392 void CATDialVoice::HandleIOError()
       
   393 	{
       
   394 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::HandleIOError()"));
       
   395 	
       
   396 	if (iDialStep == EATWaitForWriteComplete)
       
   397 		{
       
   398 		if (iIsEmergencyCall)
       
   399 			{
       
   400 			iCtsyDispatcherCallback.CallbackCallControlDialEmergencyComp(iStatus, KLtsyErrorCallId);
       
   401 			}
       
   402 		else
       
   403 			{
       
   404 			iCtsyDispatcherCallback.CallbackCallControlDialVoiceComp(iStatus, KLtsyErrorCallId);
       
   405 			}
       
   406 		}
       
   407 	else
       
   408 		{
       
   409 		//Call id has not be allocated
       
   410 		if (KLtsyErrorCallId == iCallId)
       
   411 			{
       
   412 			if (iIsEmergencyCall)
       
   413 				{
       
   414 				iCtsyDispatcherCallback.CallbackCallControlDialEmergencyComp(iStatus, iCallId);
       
   415 				}
       
   416 			else
       
   417 				{
       
   418 				iCtsyDispatcherCallback.CallbackCallControlDialVoiceComp(iStatus, iCallId);
       
   419 				}
       
   420 			}
       
   421 		else
       
   422 			{
       
   423 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(iStatus, 
       
   424 					                                                             iCallId, 
       
   425 																		         RMobileCall::EStatusDisconnecting);
       
   426 			
       
   427 			iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(iStatus, 
       
   428 					                                                             iCallId, 
       
   429 																		         RMobileCall::EStatusIdle);
       
   430 			//Setting ltsy call information
       
   431 			iPhoneGlobals.GetCallInfoManager().ResetCallInformationByCallId(iCallId);
       
   432 			}
       
   433 		}
       
   434 	}
       
   435 
       
   436 // ---------------------------------------------------------------------------
       
   437 // CATDialVoice::HandleResponseError
       
   438 // other items were commented in a header
       
   439 // ---------------------------------------------------------------------------
       
   440 void CATDialVoice::HandleResponseError()
       
   441 	{
       
   442 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::HandleResponseError()"));
       
   443 	
       
   444 	//Call id has not be allocated
       
   445 	if (KLtsyErrorCallId == iCallId)
       
   446 		{
       
   447 		if (iIsEmergencyCall)
       
   448 			{
       
   449 			iCtsyDispatcherCallback.CallbackCallControlDialEmergencyComp(iResult, iCallId);
       
   450 			}
       
   451 		else
       
   452 			{
       
   453 			iCtsyDispatcherCallback.CallbackCallControlDialVoiceComp(iResult, iCallId);
       
   454 			}
       
   455 		}
       
   456 	else
       
   457 		{
       
   458 		iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(iResult, 
       
   459 																			 iCallId, 
       
   460 																			 RMobileCall::EStatusDisconnecting);
       
   461 		
       
   462 		iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(iResult, 
       
   463 																			 iCallId, 
       
   464 																			 RMobileCall::EStatusIdle);
       
   465 		//Setting ltsy call information
       
   466 		iPhoneGlobals.GetCallInfoManager().ResetCallInformationByCallId(iCallId);
       
   467 		}
       
   468 	}
       
   469 
       
   470 // ---------------------------------------------------------------------------
       
   471 // CATDialVoice::HandleDiallingCompleteL
       
   472 // other items were commented in a header
       
   473 // ---------------------------------------------------------------------------
       
   474 void CATDialVoice::HandleDiallingComplete()
       
   475 	{
       
   476 	LOGTEXT(_L8("[Ltsy CallControl] Starting CATDialVoice::HandleDiallingComplete()"));
       
   477 	LOGTEXT2(_L8("[Ltsy CallControl] Call id = %d"), iCallId);
       
   478 	
       
   479 	if (iIsEmergencyCall)
       
   480 		{
       
   481 		iCtsyDispatcherCallback.CallbackCallControlDialEmergencyComp(KErrNone, iCallId);
       
   482 		}
       
   483 	else
       
   484 		{
       
   485 		iCtsyDispatcherCallback.CallbackCallControlDialVoiceComp(KErrNone, iCallId);
       
   486 		}
       
   487 	
       
   488 	LOGTEXT(_L8("[Ltsy CallControl] Call status = RMobileCall::EStatusDialling"));
       
   489 	iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   490 																		 iCallId, 
       
   491 													 RMobileCall::EStatusDialling);
       
   492 	
       
   493 	//Setting ltsy call information
       
   494 	TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(iCallId));
       
   495 	tCallInfo.SetCallId(iCallId);
       
   496 	tCallInfo.SetCallIdIsUsedInfo(TLtsyCallInformation::EUsed);
       
   497 	tCallInfo.SetCallDirection(TLtsyCallInformation::EMoCall);
       
   498 	tCallInfo.SetCallState(TLtsyCallInformation::EDialingCall);
       
   499 	tCallInfo.SetCallMode(TLtsyCallInformation::EVoiceCall);
       
   500 	tCallInfo.SetConferenceCall(TLtsyCallInformation::ENotConference);
       
   501 	//Emergency call flag
       
   502 	if (iIsEmergencyCall)
       
   503 		{
       
   504 		tCallInfo.SetEmergencyCallFlag(ETrue);
       
   505 		}
       
   506 	
       
   507 	
       
   508 	//If have another and it's state is not hold so setting hold
       
   509 	for (TInt n = KLtsyMinCallId; n <= KLtsyMaxCallId; n++)
       
   510 		{
       
   511 		if (n != iCallId)
       
   512 			{
       
   513 			TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(n));
       
   514 			if (tCallInfo.GetCallIdIsUsedInfo() == TLtsyCallInformation::EUsed && 
       
   515 				tCallInfo.GetCallState() != TLtsyCallInformation::EHeldCall)
       
   516 				{
       
   517 				//Setting ltsy call state
       
   518 				tCallInfo.SetCallState(TLtsyCallInformation::EHeldCall);
       
   519 				
       
   520 				//Notify CTSY state change
       
   521 				iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   522 																					 n, 
       
   523 																      RMobileCall::EStatusHold);				
       
   524 				}
       
   525 			}
       
   526 		}
       
   527 	}
       
   528 
       
   529 // ---------------------------------------------------------------------------
       
   530 // CATDialVoice::HandleConnectingCompleteL
       
   531 // other items were commented in a header
       
   532 // ---------------------------------------------------------------------------
       
   533 void CATDialVoice::HandleConnectingComplete()
       
   534 	{
       
   535 	LOGTEXT(_L8("[Ltsy CallControl] Call status = RMobileCall::EStatusConnecting"));
       
   536 	
       
   537 	iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   538 																		 iCallId, 
       
   539 													 RMobileCall::EStatusConnecting);	
       
   540 	
       
   541 	//Setting ltsy call information
       
   542 	TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(iCallId));
       
   543 	tCallInfo.SetCallState(TLtsyCallInformation::EAlertingCall);
       
   544 	}
       
   545 
       
   546 // ---------------------------------------------------------------------------
       
   547 // CATDialVoice::HandleConnectedCompleteL
       
   548 // other items were commented in a header
       
   549 // ---------------------------------------------------------------------------
       
   550 void CATDialVoice::HandleConnectedComplete()
       
   551 	{
       
   552 	LOGTEXT(_L8("[Ltsy CallControl] Call status = RMobileCall::EStatusConnected"));
       
   553 	iCtsyDispatcherCallback.CallbackCallControlNotifyCallStatusChangeInd(KErrNone, 
       
   554 			                                                              iCallId, 
       
   555 			                                           RMobileCall::EStatusConnected);
       
   556 	
       
   557 	//Setting ltsy call information
       
   558 	TLtsyCallInformation& tCallInfo(iPhoneGlobals.GetCallInfoManager().GetCallInformationByCallId(iCallId));
       
   559 	tCallInfo.SetCallState(TLtsyCallInformation::EActiveCall);	
       
   560 	}
       
   561 
       
   562 // ---------------------------------------------------------------------------
       
   563 // CATDialVoice::EventSignal
       
   564 // other items were commented in a header
       
   565 // ---------------------------------------------------------------------------
       
   566 void CATDialVoice::EventSignal(TAtEventSource /*aEventSource*/, TInt aStatus)
       
   567 	{
       
   568 	LOGTEXT(_L8("[Ltsy] Starting CATDialVoice::EventSignal()"));
       
   569 	
       
   570 	iStatus = aStatus;
       
   571 	
       
   572 	if (aStatus != KErrNone)
       
   573 		{
       
   574 		HandleIOError();
       
   575 		Complete();
       
   576 		return;
       
   577 		}
       
   578 	
       
   579 	switch (iDialStep)
       
   580 		{
       
   581 		case EATWaitForWriteComplete:
       
   582 			iDialStep = EATWaitForDiallingComplete;
       
   583 			break;
       
   584 			
       
   585 		case EATWaitForDiallingComplete:
       
   586 			//first clean current line
       
   587 			ClearCurrentLine();
       
   588 			//Process result
       
   589 			if (iResult == KErrNone)
       
   590 				{
       
   591 				HandleDiallingComplete();
       
   592 				iDialStep = EATWaitForConnectingComplete;
       
   593 				}
       
   594 			else
       
   595 				{
       
   596 				HandleResponseError();
       
   597 				Complete();
       
   598 				}
       
   599 			break;
       
   600 			
       
   601 		case EATWaitForConnectingComplete:
       
   602 			//first clean current line
       
   603 			ClearCurrentLine();
       
   604 			//Process result
       
   605 			if (iResult == KErrNone)
       
   606 				{
       
   607 				HandleConnectingComplete();
       
   608 				iDialStep = EATWaitForConnectedComplete;
       
   609 				}
       
   610 			else
       
   611 				{
       
   612 				HandleResponseError();
       
   613 				Complete();
       
   614 				}
       
   615 		    break;
       
   616 		    
       
   617 		case EATWaitForConnectedComplete:
       
   618 			//first clean current line
       
   619 			ClearCurrentLine();
       
   620 			//Process result
       
   621 			if (iResult == KErrNone)
       
   622 				{
       
   623 				HandleConnectedComplete();
       
   624 				}
       
   625 			else
       
   626 				{
       
   627 				HandleResponseError();
       
   628 				}
       
   629 			
       
   630 			Complete();
       
   631 			break;
       
   632 			
       
   633 		default:
       
   634 			break;
       
   635 		}
       
   636 	}
       
   637 
       
   638 //End of file