telephonyserverplugins/simtsy/src/CSimLine.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 
     1 
     2 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 // All rights reserved.
     3 // All rights reserved.
     4 // This component and the accompanying materials are made available
     4 // This component and the accompanying materials are made available
     5 // under the terms of "Eclipse Public License v1.0"
     5 // under the terms of "Eclipse Public License v1.0"
     6 // which accompanies this distribution, and is available
     6 // which accompanies this distribution, and is available
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 
    19 
    20 /**
    20 /**
    21  @file
    21  @file
    22 */
    22 */
    23 
    23 
       
    24 
       
    25 
       
    26 #include "OstTraceDefinitions.h"
       
    27 #ifdef OST_TRACE_COMPILER_IN_USE
       
    28 #include "CSimLineTraces.h"
       
    29 #endif
       
    30 
    24 #include <testconfigfileparser.h>
    31 #include <testconfigfileparser.h>
    25 #include "CSimLine.h"
    32 #include "CSimLine.h"
    26 #include "CSimPhone.h"
    33 #include "CSimPhone.h"
    27 #include "CSimCall.h"
    34 #include "CSimCall.h"
    28 #include "Simlog.h"
       
    29 #include "CSimPubSub.h"
    35 #include "CSimPubSub.h"
    30 
    36 
    31 void CSimLine::CloseLine(TAny* aObj)
    37 void CSimLine::CloseLine(TAny* aObj)
    32 /**
    38 /**
    33 *	Utility func for cleanup stack
    39 *	Utility func for cleanup stack
    53 * Creates the System Agent object for incoming call notification and other notifications.
    59 * Creates the System Agent object for incoming call notification and other notifications.
    54 *
    60 *
    55 * @param aName name of the Line to be created.
    61 * @param aName name of the Line to be created.
    56 */
    62 */
    57 	{
    63 	{
    58 	LOGLINE2(">>CSimLine::ConstructL [aLineName=%S]", &aName);
    64 	OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CONSTRUCTL_1, ">>CSimLine::ConstructL [aLineName=%S]", aName);
    59 	iLineName = aName;
    65 	iLineName = aName;
    60 	iSimPubSubIC = CSimPubSub::NewL(this,iICProperty);
    66 	iSimPubSubIC = CSimPubSub::NewL(this,iICProperty);
    61 	iSimPubSubIC->Start();
    67 	iSimPubSubIC->Start();
    62 
    68 
    63 	iSimPubSubRH = CSimPubSub::NewL(this,iRHProperty);
    69 	iSimPubSubRH = CSimPubSub::NewL(this,iRHProperty);
    64 	iSimPubSubRH->Start();
    70 	iSimPubSubRH->Start();
    65 	
    71 	
    66 	iNotifyIncomingCallPause=this->CfgFile()->ItemValue(KNotifyIncomingCallPauseDuration,KDefaultNotifyIncomingCallPauseDuration);
    72 	iNotifyIncomingCallPause=this->CfgFile()->ItemValue(KNotifyIncomingCallPauseDuration,KDefaultNotifyIncomingCallPauseDuration);
    67 	
    73 	
    68 	iTimer = CSimTimer::NewL(iPhone);
    74 	iTimer = CSimTimer::NewL(iPhone);
    69 		LOGLINE1("<<CSimLine::ConstructL");
    75 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CONSTRUCTL_2, "<<CSimLine::ConstructL");
    70 }
    76 }
    71 
    77 
    72 CSimLine::~CSimLine()
    78 CSimLine::~CSimLine()
    73 /**
    79 /**
    74 *	Standard destructor.
    80 *	Standard destructor.
   148 */
   154 */
   149 	{
   155 	{
   150 	switch (aIpc)
   156 	switch (aIpc)
   151 		{
   157 		{
   152 	case EMobileLineNotifyMobileLineStatusChange:
   158 	case EMobileLineNotifyMobileLineStatusChange:
   153 		LOGLINE1("CLineMobile: Registered with the default number of slots");
   159 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NUMBEROFSLOTSL_1, "CLineMobile: Registered with the default number of slots");
   154 		return KDefaultNumberOfSlots;
   160 		return KDefaultNumberOfSlots;
   155 
   161 
   156 	default:
   162 	default:
   157 		LOGLINE1("CSimLine::NumberOfSlotsL: No match for IPC, defering to base function");
   163 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NUMBEROFSLOTSL_2, "CSimLine::NumberOfSlotsL: No match for IPC, defering to base function");
   158 		break;
   164 		break;
   159 		}
   165 		}
   160 	return CLineBase::NumberOfSlotsL(aIpc);
   166 	return CLineBase::NumberOfSlotsL(aIpc);
   161 	}
   167 	}
   162 
   168 
   196 * @param aTsyReqHandle Tsy Request handle for the client request
   202 * @param aTsyReqHandle Tsy Request handle for the client request
   197 * @param aName pointer to the name of the call
   203 * @param aName pointer to the name of the call
   198 * @return KErrNone
   204 * @return KErrNone
   199 */
   205 */
   200 	{
   206 	{
   201 	LOGLINE1(">>CSimLine::NotifyIncomingCall");
   207 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYINCOMINGCALL_1, ">>CSimLine::NotifyIncomingCall");
   202 	iNotifyIncomingCall.iNotifyPending=ETrue;
   208 	iNotifyIncomingCall.iNotifyPending=ETrue;
   203 	iNotifyIncomingCall.iNotifyHandle=aTsyReqHandle;
   209 	iNotifyIncomingCall.iNotifyHandle=aTsyReqHandle;
   204 	iNotifyIncomingCall.iNotifyData=(TAny*)aName;
   210 	iNotifyIncomingCall.iNotifyData=(TAny*)aName;
   205 	LOGLINE1("<<CSimLine::NotifyIncomingCall");
   211 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYINCOMINGCALL_2, "<<CSimLine::NotifyIncomingCall");
   206 	return KErrNone;
   212 	return KErrNone;
   207 	}
   213 	}
   208 
   214 
   209 TInt CSimLine::NotifyIncomingCallCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   215 TInt CSimLine::NotifyIncomingCallCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   210 /**
   216 /**
   213 *
   219 *
   214 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   220 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   215 * @return KErrNone
   221 * @return KErrNone
   216 */
   222 */
   217 	{
   223 	{
   218 	LOGLINE1(">>CSimLine::NotifyIncomingCallCancel");
   224 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYINCOMINGCALLCANCEL_1, ">>CSimLine::NotifyIncomingCallCancel");
   219 	if(iNotifyIncomingCall.iNotifyPending)
   225 	if(iNotifyIncomingCall.iNotifyPending)
   220 		{
   226 		{
   221 		iTimer->Cancel();
   227 		iTimer->Cancel();
   222 		iNotifyIncomingCall.iNotifyPending=EFalse;
   228 		iNotifyIncomingCall.iNotifyPending=EFalse;
   223 		ReqCompleted(iNotifyIncomingCall.iNotifyHandle, KErrCancel);
   229 		ReqCompleted(iNotifyIncomingCall.iNotifyHandle, KErrCancel);
   224 		}
   230 		}
   225 	LOGLINE1("<<CSimLine::NotifyIncomingCallCancel");
   231 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYINCOMINGCALLCANCEL_2, "<<CSimLine::NotifyIncomingCallCancel");
   226 	return KErrNone;
   232 	return KErrNone;
   227 	}
   233 	}
   228 
   234 
   229 TInt CSimLine::NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus)
   235 TInt CSimLine::NotifyHookChange(const TTsyReqHandle aTsyReqHandle, RCall::THookStatus* aHookStatus)
   230 /**
   236 /**
   234 * @param aTsyReqHandle Tsy Request handle for the client request
   240 * @param aTsyReqHandle Tsy Request handle for the client request
   235 * @param aHookStatus pointer to the line hook
   241 * @param aHookStatus pointer to the line hook
   236 * @return KErrNone
   242 * @return KErrNone
   237 */
   243 */
   238 	{
   244 	{
   239 	LOGLINE1(">>CSimLine::NotifyHookChange");
   245 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYHOOKCHANGE_1, ">>CSimLine::NotifyHookChange");
   240 	iNotifyHookChange.iNotifyPending=ETrue;
   246 	iNotifyHookChange.iNotifyPending=ETrue;
   241 	iNotifyHookChange.iNotifyHandle=aTsyReqHandle;
   247 	iNotifyHookChange.iNotifyHandle=aTsyReqHandle;
   242 	iNotifyHookChange.iNotifyData=(TAny*)aHookStatus;
   248 	iNotifyHookChange.iNotifyData=(TAny*)aHookStatus;
   243 	LOGLINE1("<<CSimLine::NotifyHookChange");
   249 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYHOOKCHANGE_2, "<<CSimLine::NotifyHookChange");
   244 	return KErrNone;
   250 	return KErrNone;
   245 	}
   251 	}
   246 
   252 
   247 TInt CSimLine::NotifyHookChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   253 TInt CSimLine::NotifyHookChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   248 /**
   254 /**
   251 *
   257 *
   252 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   258 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   253 * @return KErrNone
   259 * @return KErrNone
   254 */
   260 */
   255 	{
   261 	{
   256 	LOGLINE1(">>CSimLine::NotifyHookChangeCancel");
   262 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYHOOKCHANGECANCEL_1, ">>CSimLine::NotifyHookChangeCancel");
   257 	if(iNotifyHookChange.iNotifyPending)
   263 	if(iNotifyHookChange.iNotifyPending)
   258 		{
   264 		{
   259 		iNotifyHookChange.iNotifyPending=EFalse;
   265 		iNotifyHookChange.iNotifyPending=EFalse;
   260 		ReqCompleted(iNotifyHookChange.iNotifyHandle,KErrCancel);
   266 		ReqCompleted(iNotifyHookChange.iNotifyHandle,KErrCancel);
   261 		}
   267 		}
   262 	LOGLINE1("<<CSimLine::NotifyHookChangeCancel");
   268 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYHOOKCHANGECANCEL_2, "<<CSimLine::NotifyHookChangeCancel");
   263 	return KErrNone;
   269 	return KErrNone;
   264 	}
   270 	}
   265 
   271 
   266 
   272 
   267 TInt CSimLine::NotifyMobileLineStatusChange(const TTsyReqHandle aTsyReqHandle, RMobileCall::TMobileCallStatus* aStatus)
   273 TInt CSimLine::NotifyMobileLineStatusChange(const TTsyReqHandle aTsyReqHandle, RMobileCall::TMobileCallStatus* aStatus)
   272 * @param aTsyReqHandle Tsy Request handle for the client request
   278 * @param aTsyReqHandle Tsy Request handle for the client request
   273 * @param aStatus pointer to the line status
   279 * @param aStatus pointer to the line status
   274 * @return KErrNone
   280 * @return KErrNone
   275 */
   281 */
   276 	{
   282 	{
   277 	LOGLINE1(">>CSimLine::NotifyMobileLineStatusChange");
   283 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYMOBILELINESTATUSCHANGE_1, ">>CSimLine::NotifyMobileLineStatusChange");
   278 	iNotifyMobileStatusChange.iNotifyPending=ETrue;
   284 	iNotifyMobileStatusChange.iNotifyPending=ETrue;
   279 	iNotifyMobileStatusChange.iNotifyHandle=aTsyReqHandle;
   285 	iNotifyMobileStatusChange.iNotifyHandle=aTsyReqHandle;
   280 	iNotifyMobileStatusChange.iNotifyData=aStatus;
   286 	iNotifyMobileStatusChange.iNotifyData=aStatus;
   281 	LOGLINE1("<<CSimLine::NotifyMobileLineStatusChange");
   287 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYMOBILELINESTATUSCHANGE_2, "<<CSimLine::NotifyMobileLineStatusChange");
   282 	return KErrNone;
   288 	return KErrNone;
   283 	}
   289 	}
   284 
   290 
   285 TInt CSimLine::NotifyMobileLineStatusChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   291 TInt CSimLine::NotifyMobileLineStatusChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   286 /**
   292 /**
   289 * 
   295 * 
   290 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   296 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   291 * @return KErrNone
   297 * @return KErrNone
   292 */
   298 */
   293 	{
   299 	{
   294 	LOGLINE1(">>CSimLine::NotifyMobileLineStatusChangeCancel");
   300 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYMOBILELINESTATUSCHANGECANCEL_1, ">>CSimLine::NotifyMobileLineStatusChangeCancel");
   295 	if(iNotifyMobileStatusChange.iNotifyPending)
   301 	if(iNotifyMobileStatusChange.iNotifyPending)
   296 		{
   302 		{
   297 		iNotifyMobileStatusChange.iNotifyPending=EFalse;
   303 		iNotifyMobileStatusChange.iNotifyPending=EFalse;
   298 		ReqCompleted(iNotifyMobileStatusChange.iNotifyHandle,KErrCancel);
   304 		ReqCompleted(iNotifyMobileStatusChange.iNotifyHandle,KErrCancel);
   299 		}
   305 		}
   300 	LOGLINE1("<<CSimLine::NotifyMobileLineStatusChangeCancel");
   306 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYMOBILELINESTATUSCHANGECANCEL_2, "<<CSimLine::NotifyMobileLineStatusChangeCancel");
   301 	return KErrNone;
   307 	return KErrNone;
   302 	}
   308 	}
   303 
   309 
   304 TInt CSimLine::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle, RCall::TStatus* aStatus)
   310 TInt CSimLine::NotifyStatusChange(const TTsyReqHandle aTsyReqHandle, RCall::TStatus* aStatus)
   305 /**
   311 /**
   309 * @param aTsyReqHandle Tsy Request handle for the client request
   315 * @param aTsyReqHandle Tsy Request handle for the client request
   310 * @param aStatus pointer to the line status
   316 * @param aStatus pointer to the line status
   311 * @return KErrNone
   317 * @return KErrNone
   312 */
   318 */
   313 	{
   319 	{
   314 	LOGLINE1(">>CSimLine::NotifyStatusChange");
   320 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYSTATUSCHANGE_1, ">>CSimLine::NotifyStatusChange");
   315 	iNotifyStatusChange.iNotifyPending=ETrue;
   321 	iNotifyStatusChange.iNotifyPending=ETrue;
   316 	iNotifyStatusChange.iNotifyHandle=aTsyReqHandle;
   322 	iNotifyStatusChange.iNotifyHandle=aTsyReqHandle;
   317 	iNotifyStatusChange.iNotifyData=aStatus;
   323 	iNotifyStatusChange.iNotifyData=aStatus;
   318 	LOGLINE1("<<CSimLine::NotifyStatusChange");
   324 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYSTATUSCHANGE_2, "<<CSimLine::NotifyStatusChange");
   319 	return KErrNone;
   325 	return KErrNone;
   320 	}
   326 	}
   321 
   327 
   322 TInt CSimLine::NotifyStatusChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   328 TInt CSimLine::NotifyStatusChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   323 /**
   329 /**
   326 * 
   332 * 
   327 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   333 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   328 * @return KErrNone
   334 * @return KErrNone
   329 */
   335 */
   330 	{
   336 	{
   331 	LOGLINE1(">>CSimLine::NotifyStatusChangeCancel");
   337 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYSTATUSCHANGECANCEL_1, ">>CSimLine::NotifyStatusChangeCancel");
   332 	if(iNotifyStatusChange.iNotifyPending)
   338 	if(iNotifyStatusChange.iNotifyPending)
   333 		{
   339 		{
   334 		iNotifyStatusChange.iNotifyPending=EFalse;
   340 		iNotifyStatusChange.iNotifyPending=EFalse;
   335 		ReqCompleted(iNotifyStatusChange.iNotifyHandle,KErrCancel);
   341 		ReqCompleted(iNotifyStatusChange.iNotifyHandle,KErrCancel);
   336 		}
   342 		}
   337 	LOGLINE1("<<CSimLine::NotifyStatusChangeCancel");
   343 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYSTATUSCHANGECANCEL_2, "<<CSimLine::NotifyStatusChangeCancel");
   338 	return KErrNone;
   344 	return KErrNone;
   339 	}
   345 	}
   340 
   346 
   341 TInt CSimLine::NotifyCallAdded(const TTsyReqHandle aTsyReqHandle,TName* aName)
   347 TInt CSimLine::NotifyCallAdded(const TTsyReqHandle aTsyReqHandle,TName* aName)
   342 /**
   348 /**
   346 * @param aTsyReqHandle Tsy Request handle for the client request
   352 * @param aTsyReqHandle Tsy Request handle for the client request
   347 * @param aName pointer to the name of the call
   353 * @param aName pointer to the name of the call
   348 * @return KErrNone
   354 * @return KErrNone
   349 */
   355 */
   350 	{
   356 	{
   351 	LOGLINE1(">>CSimLine::NotifyCallAdded");
   357 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYCALLADDED_1, ">>CSimLine::NotifyCallAdded");
   352 	iNotifyCallAdded.iNotifyPending=ETrue;
   358 	iNotifyCallAdded.iNotifyPending=ETrue;
   353 	iNotifyCallAdded.iNotifyHandle=aTsyReqHandle;
   359 	iNotifyCallAdded.iNotifyHandle=aTsyReqHandle;
   354 	iNotifyCallAdded.iNotifyData=(TAny*)aName;
   360 	iNotifyCallAdded.iNotifyData=(TAny*)aName;
   355 	LOGLINE1("<<CSimLine::NotifyCallAdded");
   361 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYCALLADDED_2, "<<CSimLine::NotifyCallAdded");
   356 	return KErrNone;
   362 	return KErrNone;
   357 	}
   363 	}
   358 
   364 
   359 TInt CSimLine::NotifyCallAddedCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   365 TInt CSimLine::NotifyCallAddedCancel(const TTsyReqHandle /*aTsyReqHandle*/)
   360 /**
   366 /**
   363 *
   369 *
   364 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   370 * @param aTsyReqHandle Tsy Request handle for the client cancel request
   365 * @return KErrNone
   371 * @return KErrNone
   366 */
   372 */
   367 	{
   373 	{
   368 	LOGLINE1(">>CSimLine::NotifyCallAddedCancel");
   374 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYCALLADDEDCANCEL_1, ">>CSimLine::NotifyCallAddedCancel");
   369 	if(iNotifyCallAdded.iNotifyPending)
   375 	if(iNotifyCallAdded.iNotifyPending)
   370 		{
   376 		{
   371 		iNotifyCallAdded.iNotifyPending=EFalse;
   377 		iNotifyCallAdded.iNotifyPending=EFalse;
   372 		ReqCompleted(iNotifyCallAdded.iNotifyHandle,KErrCancel);
   378 		ReqCompleted(iNotifyCallAdded.iNotifyHandle,KErrCancel);
   373 		}
   379 		}
   374 	LOGLINE1("<<CSimLine::NotifyCallAddedCancel");
   380 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_NOTIFYCALLADDEDCANCEL_2, "<<CSimLine::NotifyCallAddedCancel");
   375 	return KErrNone;
   381 	return KErrNone;
   376 	}
   382 	}
   377 
   383 
   378 
   384 
   379 void CSimLine::HandleNewCallAddedNotification(const TDesC& aNewName)
   385 void CSimLine::HandleNewCallAddedNotification(const TDesC& aNewName)
   380 /**
   386 /**
   381 * Process a potential "New Call Added Notification" completion.
   387 * Process a potential "New Call Added Notification" completion.
   382 */
   388 */
   383 	{
   389 	{
   384 	LOGLINE1(">>CSimLine::HandleNewCallAddedNotification");
   390 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_HANDLENEWCALLADDEDNOTIFICATION_1, ">>CSimLine::HandleNewCallAddedNotification");
   385 	iNameOfLastCallAdded.Copy(aNewName);
   391 	iNameOfLastCallAdded.Copy(aNewName);
   386 	if(iNotifyCallAdded.iNotifyPending)
   392 	if(iNotifyCallAdded.iNotifyPending)
   387 		{
   393 		{
   388 		iNotifyCallAdded.iNotifyPending=EFalse;
   394 		iNotifyCallAdded.iNotifyPending=EFalse;
   389 		((TName*)iNotifyCallAdded.iNotifyData)->Copy(aNewName);
   395 		((TName*)iNotifyCallAdded.iNotifyData)->Copy(aNewName);
   390 		ReqCompleted(iNotifyCallAdded.iNotifyHandle,KErrNone);
   396 		ReqCompleted(iNotifyCallAdded.iNotifyHandle,KErrNone);
   391 		}
   397 		}
   392 	LOGLINE1("<<CSimLine::HandleNewCallAddedNotification");
   398 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_HANDLENEWCALLADDEDNOTIFICATION_2, "<<CSimLine::HandleNewCallAddedNotification");
   393 	}
   399 	}
   394 
   400 
   395 TInt CSimLine::GetCaps(const TTsyReqHandle aTsyReqHandle, RLine::TCaps* aCaps)
   401 TInt CSimLine::GetCaps(const TTsyReqHandle aTsyReqHandle, RLine::TCaps* aCaps)
   396 /**
   402 /**
   397  * Retrieve the current line capabilities.
   403  * Retrieve the current line capabilities.
   447 * @param aTsyReqHandle
   453 * @param aTsyReqHandle
   448 * @param aLineInfo pointer to the line information to be returned to client
   454 * @param aLineInfo pointer to the line information to be returned to client
   449 * @return KErrNone
   455 * @return KErrNone
   450 */
   456 */
   451 	{
   457 	{
   452 	LOGLINE1(">>CSimLine::GetInfo");
   458 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETINFO_1, ">>CSimLine::GetInfo");
   453 	aLineInfo->iHookStatus=iHookState;
   459 	aLineInfo->iHookStatus=iHookState;
   454 	aLineInfo->iStatus=(RCall::TStatus)iState;
   460 	aLineInfo->iStatus=(RCall::TStatus)iState;
   455 	aLineInfo->iNameOfLastCallAdded.Copy(iNameOfLastCallAdded);
   461 	aLineInfo->iNameOfLastCallAdded.Copy(iNameOfLastCallAdded);
   456 	if(iAnswerNextIncomingCall)
   462 	if(iAnswerNextIncomingCall)
   457 		aLineInfo->iNameOfCallForAnswering.Copy(iAnswerNextIncomingCall->iName);
   463 		aLineInfo->iNameOfCallForAnswering.Copy(iAnswerNextIncomingCall->iName);
   458 	else
   464 	else
   459 		aLineInfo->iNameOfCallForAnswering.Zero();
   465 		aLineInfo->iNameOfCallForAnswering.Zero();
   460 
   466 
   461 	ReqCompleted(aTsyReqHandle,KErrNone);
   467 	ReqCompleted(aTsyReqHandle,KErrNone);
   462 	LOGLINE1("<<CSimLine::GetInfo");
   468 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETINFO_2, "<<CSimLine::GetInfo");
   463 	return KErrNone;
   469 	return KErrNone;
   464 	}
   470 	}
   465 
   471 
   466 
   472 
   467 RCall::TStatus CSimLine::GetCoreLineStatus()
   473 RCall::TStatus CSimLine::GetCoreLineStatus()
   502 * @param aTsyReqHandle
   508 * @param aTsyReqHandle
   503 * @param aLineStatus pointer to the line status
   509 * @param aLineStatus pointer to the line status
   504 * @return KErrNone
   510 * @return KErrNone
   505 */
   511 */
   506 	{
   512 	{
   507 	LOGLINE1(">>CSimLine::GetStatus");
   513 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETSTATUS_1, ">>CSimLine::GetStatus");
   508 	*aLineStatus=GetCoreLineStatus();
   514 	*aLineStatus=GetCoreLineStatus();
   509 	ReqCompleted(aTsyReqHandle,KErrNone);
   515 	ReqCompleted(aTsyReqHandle,KErrNone);
   510 	LOGLINE1("<<CSimLine::GetStatus");
   516 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETSTATUS_2, "<<CSimLine::GetStatus");
   511 	return KErrNone;
   517 	return KErrNone;
   512 	}
   518 	}
   513 
   519 
   514 TInt CSimLine::GetMobileLineStatus(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aLineStatus)
   520 TInt CSimLine::GetMobileLineStatus(const TTsyReqHandle aTsyReqHandle,RMobileCall::TMobileCallStatus* aLineStatus)
   515 /**
   521 /**
   519 * @param aTsyReqHandle
   525 * @param aTsyReqHandle
   520 * @param aLineStatus pointer to the line status
   526 * @param aLineStatus pointer to the line status
   521 * @return KErrNone
   527 * @return KErrNone
   522 */
   528 */
   523 	{
   529 	{
   524 	LOGLINE1(">>CSimLine::GetMobileLineStatus");
   530 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETMOBILELINESTATUS_1, ">>CSimLine::GetMobileLineStatus");
   525 	*aLineStatus=iState;
   531 	*aLineStatus=iState;
   526 	ReqCompleted(aTsyReqHandle,KErrNone);
   532 	ReqCompleted(aTsyReqHandle,KErrNone);
   527 	LOGLINE1("<<CSimLine::GetMobileLineStatus");
   533 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETMOBILELINESTATUS_2, "<<CSimLine::GetMobileLineStatus");
   528 	return KErrNone;
   534 	return KErrNone;
   529 	}
   535 	}
   530 
   536 
   531 TInt CSimLine::GetHookStatus(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus* aHookStatus)
   537 TInt CSimLine::GetHookStatus(const TTsyReqHandle aTsyReqHandle,RCall::THookStatus* aHookStatus)
   532 /**
   538 /**
   536 * @param aTsyReqHandle
   542 * @param aTsyReqHandle
   537 * @param aHookStatus pointer to the hook status
   543 * @param aHookStatus pointer to the hook status
   538 * @return KErrNone
   544 * @return KErrNone
   539 */
   545 */
   540 	{
   546 	{
   541 	LOGLINE1(">>CSimLine::GetHookStatus");
   547 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETHOOKSTATUS_1, ">>CSimLine::GetHookStatus");
   542 	*aHookStatus=iHookState;
   548 	*aHookStatus=iHookState;
   543 	ReqCompleted(aTsyReqHandle,KErrNone);
   549 	ReqCompleted(aTsyReqHandle,KErrNone);
   544 	LOGLINE1("<<CSimLine::GetHookStatus");
   550 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_GETHOOKSTATUS_2, "<<CSimLine::GetHookStatus");
   545 	return KErrNone;
   551 	return KErrNone;
   546 	}
   552 	}
   547 
   553 
   548 const CTestConfigSection* CSimLine::CfgFile()
   554 const CTestConfigSection* CSimLine::CfgFile()
   549 /**
   555 /**
   550 * Returns a pointer to the config file section
   556 * Returns a pointer to the config file section
   551 *
   557 *
   552 * @return CTestConfig a pointer to the configuration file data section
   558 * @return CTestConfig a pointer to the configuration file data section
   553 */
   559 */
   554 	{
   560 	{
   555 	LOGLINE1(">>CSimLine::CfgFile");
   561 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CFGFILE_1, ">>CSimLine::CfgFile");
   556 	return iPhone->CfgFile();
   562 	return iPhone->CfgFile();
   557 	}
   563 	}
   558 
   564 
   559 TInt CSimLine::ChangeStateL(RMobileCall::TMobileCallStatus aNewState,TBool aSwap,CSimCall* aOriginatingCall)
   565 TInt CSimLine::ChangeStateL(RMobileCall::TMobileCallStatus aNewState,TBool aSwap,CSimCall* aOriginatingCall)
   560 /**
   566 /**
   571 	CSimCall* swappedCall=NULL;
   577 	CSimCall* swappedCall=NULL;
   572 	TInt i=0;
   578 	TInt i=0;
   573 	TInt count=iCalls->Count();
   579 	TInt count=iCalls->Count();
   574 	for(i=0;i<count;i++)
   580 	for(i=0;i<count;i++)
   575 		{
   581 		{
   576 		LOGLINE3(">>CSimLine::ChangeState0 0x%08x %d",iCalls->At(i),iCalls->At(i)->iState);
   582 		OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_1, ">>CSimLine::ChangeState0 0x%08x %d",(TUint)iCalls->At(i),iCalls->At(i)->iState);
   577 		}
   583 		}
   578 	
   584 	
   579 	TInt ret=KErrGeneral;
   585 	TInt ret=KErrGeneral;
   580 	const TStateChangeValidity* stateChangePnt=KLineStateChangeValidity;
   586 	const TStateChangeValidity* stateChangePnt=KLineStateChangeValidity;
   581 	while(stateChangePnt->iOldState!=KStateTableTerminator)
   587 	while(stateChangePnt->iOldState!=KStateTableTerminator)
   591 
   597 
   592     //coverity[cannot_single]	
   598     //coverity[cannot_single]	
   593 	if(ret!=KErrNone && !(aSwap && iState==RMobileCall::EStatusConnected && aNewState==RMobileCall::EStatusConnected))
   599 	if(ret!=KErrNone && !(aSwap && iState==RMobileCall::EStatusConnected && aNewState==RMobileCall::EStatusConnected))
   594 		return ret;
   600 		return ret;
   595  
   601  
   596 	LOGLINE2(">>CSimLine::ChangeState 0x%08x",aOriginatingCall);
   602 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_2, ">>CSimLine::ChangeState 0x%08x",aOriginatingCall);
   597 	if(aNewState==RMobileCall::EStatusIdle)
   603 	if(aNewState==RMobileCall::EStatusIdle)
   598 		{
   604 		{
   599 		if(iState==RMobileCall::EStatusIdle)
   605 		if(iState==RMobileCall::EStatusIdle)
   600 			return KErrAlreadyExists;
   606 			return KErrAlreadyExists;
   601 		else if(iState==RMobileCall::EStatusDisconnecting || iState==RMobileCall::EStatusDialling)
   607 		else if(iState==RMobileCall::EStatusDisconnecting || iState==RMobileCall::EStatusDialling)
   602 			{
   608 			{
   603 			TInt i=0;
   609 			TInt i=0;
   604 			TInt count=iCalls->Count();
   610 			TInt count=iCalls->Count();
   605 			for(i=0;i<count;i++)
   611 			for(i=0;i<count;i++)
   606 				{
   612 				{
   607 				LOGLINE3(">>CSimLine::ChangeState1 0x%08x %d",iCalls->At(i),iCalls->At(i)->iState);
   613 				OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_3, ">>CSimLine::ChangeState1 0x%08x %d",(TUint)iCalls->At(i),iCalls->At(i)->iState);
   608 	
   614 	
   609 				if(aOriginatingCall!=iCalls->At(i) && iCalls->At(i)->iState != RMobileCall::EStatusIdle)
   615 				if(aOriginatingCall!=iCalls->At(i) && iCalls->At(i)->iState != RMobileCall::EStatusIdle)
   610 					{
   616 					{
   611 					aNewState=iCalls->At(i)->iState;
   617 					aNewState=iCalls->At(i)->iState;
   612 					break;
   618 					break;
   625 			}
   631 			}
   626 		TInt i=0;
   632 		TInt i=0;
   627 		TInt count=iCalls->Count();
   633 		TInt count=iCalls->Count();
   628 		for(i=0;i<count;i++)
   634 		for(i=0;i<count;i++)
   629 			{
   635 			{
   630 			LOGLINE3(">>CSimLine::ChangeState1 0x%08x %d",iCalls->At(i),iCalls->At(i)->iState);
   636 			OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_4, ">>CSimLine::ChangeState1 0x%08x %d",(TUint)iCalls->At(i),iCalls->At(i)->iState);
   631 			if(iCalls->At(i) != aOriginatingCall && iCalls->At(i)->iState == RMobileCall::EStatusHold)
   637 			if(iCalls->At(i) != aOriginatingCall && iCalls->At(i)->iState == RMobileCall::EStatusHold)
   632 				{
   638 				{
   633 				if(aSwap)
   639 				if(aSwap)
   634 					{
   640 					{
   635 					swappedCall=iCalls->At(i);
   641 					swappedCall=iCalls->At(i);
   645 		{
   651 		{
   646 		TInt i=0;
   652 		TInt i=0;
   647 		TInt count=iCalls->Count();
   653 		TInt count=iCalls->Count();
   648 		for(i=0;i<count;i++)
   654 		for(i=0;i<count;i++)
   649 			{
   655 			{
   650 			LOGLINE3(">>CSimLine::ChangeState1 0x%08x %d",iCalls->At(i),iCalls->At(i)->iState);
   656 			OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_5, ">>CSimLine::ChangeState1 0x%08x %d",(TUint)iCalls->At(i),iCalls->At(i)->iState);
   651 			if(iCalls->At(i) != aOriginatingCall)
   657 			if(iCalls->At(i) != aOriginatingCall)
   652 				{
   658 				{
   653 				if(iCalls->At(i)->iState == RMobileCall::EStatusConnected)
   659 				if(iCalls->At(i)->iState == RMobileCall::EStatusConnected)
   654 					{
   660 					{
   655                     //coverity[dead_error_condition]					
   661                     //coverity[dead_error_condition]					
   667 				}
   673 				}
   668 			}	
   674 			}	
   669 		}
   675 		}
   670 
   676 
   671 	// Actually change the state.
   677 	// Actually change the state.
   672 	LOGLINE3(">>CSimLine::ChangeState [oldState=%d]  [newState=%d]", iState, aNewState);
   678 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_6, ">>CSimLine::ChangeState [oldState=%d]  [newState=%d]", iState, aNewState);
   673 	
   679 	
   674 	if(iState != aNewState)
   680 	if(iState != aNewState)
   675 		{
   681 		{
   676 		iState=aNewState;
   682 		iState=aNewState;
   677 
   683 
   722 	if((ret = iPhone->ValidateChangeState(this,aNewState)) != KErrNone)
   728 	if((ret = iPhone->ValidateChangeState(this,aNewState)) != KErrNone)
   723 		return ret;
   729 		return ret;
   724 
   730 
   725 	for(i=0;i<iCalls->Count();i++)
   731 	for(i=0;i<iCalls->Count();i++)
   726 		{
   732 		{
   727 	LOGLINE3(">>CSimLine::ChangeState5 0x%08x %d",iCalls->At(i),iCalls->At(i)->iState);
   733 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_7, ">>CSimLine::ChangeState5 0x%08x %d",(TUint)iCalls->At(i),iCalls->At(i)->iState);
   728 		}
   734 		}
   729 	
   735 	
   730 	LOGLINE1("<<CSimLine::ChangeState");
   736 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_CHANGESTATEL_8, "<<CSimLine::ChangeState");
   731 	return KErrNone;
   737 	return KErrNone;
   732 	}
   738 	}
   733 
   739 
   734 void CSimLine::SimPSEvent(const CSimPubSub::TPubSubProperty aProperty, TInt /*aStatus*/)
   740 void CSimLine::SimPSEvent(const CSimPubSub::TPubSubProperty aProperty, TInt /*aStatus*/)
   735 /**
   741 /**
   736 Handles the P&S notifications for the Line class
   742 Handles the P&S notifications for the Line class
   737 
   743 
   738 @param aProperty The property key representing the notification. 
   744 @param aProperty The property key representing the notification. 
   739 */
   745 */
   740 	{
   746 	{
   741 	LOGLINE1(">>CSimLine::SimPSEvent");
   747 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_SIMPSEVENT_1, ">>CSimLine::SimPSEvent");
   742 	if(aProperty==iICProperty) // check for this here still, start the timer for amount specified in config file.
   748 	if(aProperty==iICProperty) // check for this here still, start the timer for amount specified in config file.
   743 		ProcessIncomingCallEvent();
   749 		ProcessIncomingCallEvent();
   744 	if(aProperty==iRHProperty)
   750 	if(aProperty==iRHProperty)
   745 		ProcessRemoteHangupEvent();
   751 		ProcessRemoteHangupEvent();
   746 	LOGLINE1("<<CSimLine::SimPSEvent");
   752 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_SIMPSEVENT_2, "<<CSimLine::SimPSEvent");
   747 	}
   753 	}
   748 
   754 
   749 TInt CSimLine::SetAutoAnswerCallObject(CSimCall* aCallObject)
   755 TInt CSimLine::SetAutoAnswerCallObject(CSimCall* aCallObject)
   750 /**
   756 /**
   751 * Attempt to set the call object that will be used to answer the next incoming
   757 * Attempt to set the call object that will be used to answer the next incoming
   754 *
   760 *
   755 * @param aCallObject pointer to the call object
   761 * @param aCallObject pointer to the call object
   756 * @return KErrNone if successful
   762 * @return KErrNone if successful
   757 */
   763 */
   758 	{
   764 	{
   759 	LOGLINE1(">>CSimLine::SetAnswerCallObject");
   765 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_SETAUTOANSWERCALLOBJECT_1, ">>CSimLine::SetAnswerCallObject");
   760 	if(iAnswerIncomingCallReqPending)			// Is there a request already outstanding?
   766 	if(iAnswerIncomingCallReqPending)			// Is there a request already outstanding?
   761 		return KErrEtelAnswerAlreadyOutstanding;
   767 		return KErrEtelAnswerAlreadyOutstanding;
   762 
   768 
   763 	iAnswerIncomingCallReqPending=ETrue;
   769 	iAnswerIncomingCallReqPending=ETrue;
   764 	if (iAnswerNextIncomingCall!=aCallObject)
   770 	if (iAnswerNextIncomingCall!=aCallObject)
   768 			iAnswerNextIncomingCall->Close();
   774 			iAnswerNextIncomingCall->Close();
   769 			}
   775 			}
   770 		iAnswerNextIncomingCall=aCallObject;		// Set the "answer next call" object
   776 		iAnswerNextIncomingCall=aCallObject;		// Set the "answer next call" object
   771 		iAnswerNextIncomingCall->Open();
   777 		iAnswerNextIncomingCall->Open();
   772 		}
   778 		}
   773 	LOGLINE1("<<CSimLine::SetAnswerCallObject");
   779 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_SETAUTOANSWERCALLOBJECT_2, "<<CSimLine::SetAnswerCallObject");
   774 	return KErrNone;
   780 	return KErrNone;
   775 	}
   781 	}
   776 
   782 
   777 void CSimLine::ResetAutoAnswerCallObject(CSimCall* aCallObject)
   783 void CSimLine::ResetAutoAnswerCallObject(CSimCall* aCallObject)
   778 /**
   784 /**
   780 * was to be used to automatically answer the next incoming call.
   786 * was to be used to automatically answer the next incoming call.
   781 *
   787 *
   782 * @param aCallObject pointer to the call object
   788 * @param aCallObject pointer to the call object
   783 */
   789 */
   784 	{
   790 	{
   785 	LOGLINE1(">>CSimLine::ResetAnswerCallObject");
   791 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_RESETAUTOANSWERCALLOBJECT_1, ">>CSimLine::ResetAnswerCallObject");
   786 	__ASSERT_ALWAYS(iAnswerNextIncomingCall==aCallObject,SimPanic(EIllegalAnswerNextIncomingCallInconsistancy));
   792 	__ASSERT_ALWAYS(iAnswerNextIncomingCall==aCallObject,SimPanic(EIllegalAnswerNextIncomingCallInconsistancy));
   787 	iAnswerNextIncomingCall->Close();
   793 	iAnswerNextIncomingCall->Close();
   788 	iAnswerNextIncomingCall=iSpareCall;
   794 	iAnswerNextIncomingCall=iSpareCall;
   789 	iAnswerIncomingCallReqPending=EFalse;
   795 	iAnswerIncomingCallReqPending=EFalse;
   790 	}
   796 	}
   792 void CSimLine::ProcessIncomingCallEvent()
   798 void CSimLine::ProcessIncomingCallEvent()
   793 /**
   799 /**
   794 * Process an incoming call event.
   800 * Process an incoming call event.
   795 */
   801 */
   796 	{
   802 	{
   797 	LOGLINE1(">>CSimLine::ProcessIncomingCallEvent ");
   803 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSINCOMINGCALLEVENT_1, ">>CSimLine::ProcessIncomingCallEvent ");
   798 
   804 
   799 	if (iSpareCall == iAnswerNextIncomingCall)
   805 	if (iSpareCall == iAnswerNextIncomingCall)
   800 		{
   806 		{
   801 		TName callName;
   807 		TName callName;
   802 		TRAPD(err,iAnswerNextIncomingCall=CreateNewCallL(callName,ECallTypeNormalCall));
   808 		TRAPD(err,iAnswerNextIncomingCall=CreateNewCallL(callName,ECallTypeNormalCall));
   809 	// Delay sending the notification of an incoming call if
   815 	// Delay sending the notification of an incoming call if
   810 	// one has been set.
   816 	// one has been set.
   811 	iTimer->Start(iNotifyIncomingCallPause, this);
   817 	iTimer->Start(iNotifyIncomingCallPause, this);
   812 	
   818 	
   813 	__ASSERT_ALWAYS(iAnswerNextIncomingCall->ActionEvent(CSimCall::ECallEventIncomingCall,KErrNone) == KErrNone, SimPanic(EGeneral));
   819 	__ASSERT_ALWAYS(iAnswerNextIncomingCall->ActionEvent(CSimCall::ECallEventIncomingCall,KErrNone) == KErrNone, SimPanic(EGeneral));
   814 	LOGLINE1("<<CSimLine::ProcessIncomingCallEvent");
   820 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSINCOMINGCALLEVENT_2, "<<CSimLine::ProcessIncomingCallEvent");
   815 	}
   821 	}
   816 
   822 
   817 TInt CSimLine::SetRemoteHangupCallObject(CSimCall* aCallObject)
   823 TInt CSimLine::SetRemoteHangupCallObject(CSimCall* aCallObject)
   818 /**
   824 /**
   819 * Attempt to set the call object that will be hung up remotely
   825 * Attempt to set the call object that will be hung up remotely
   822 *
   828 *
   823 * @param aCallObject pointer to the call object
   829 * @param aCallObject pointer to the call object
   824 * @return KErrNone if successful
   830 * @return KErrNone if successful
   825 */
   831 */
   826 	{
   832 	{
   827 	LOGLINE1(">>CSimLine::SetRemoteHangupCallObject");
   833 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_SETREMOTEHANGUPCALLOBJECT_1, ">>CSimLine::SetRemoteHangupCallObject");
   828 	if(iRemoteHangupCallReqPending)			// Is there a request already outstanding?
   834 	if(iRemoteHangupCallReqPending)			// Is there a request already outstanding?
   829 		return KErrEtelInitialisationFailure;
   835 		return KErrEtelInitialisationFailure;
   830 
   836 
   831 	iRemoteHangupCallReqPending=ETrue;
   837 	iRemoteHangupCallReqPending=ETrue;
   832 	if (iRemoteHangupCall!=aCallObject)
   838 	if (iRemoteHangupCall!=aCallObject)
   833 		{
   839 		{
   834 		iRemoteHangupCall=aCallObject;		// Set the "remote hang up" object
   840 		iRemoteHangupCall=aCallObject;		// Set the "remote hang up" object
   835 		}
   841 		}
   836 	LOGLINE1("<<CSimLine::SetRemoteHangupCallObject");
   842 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_SETREMOTEHANGUPCALLOBJECT_2, "<<CSimLine::SetRemoteHangupCallObject");
   837 	return KErrNone;
   843 	return KErrNone;
   838 	}
   844 	}
   839 
   845 
   840 void CSimLine::ResetRemoteHangupCallObject(CSimCall* aCallObject)
   846 void CSimLine::ResetRemoteHangupCallObject(CSimCall* aCallObject)
   841 /**
   847 /**
   843 * was to be remotely hung up.
   849 * was to be remotely hung up.
   844 *
   850 *
   845 * @param aCallObject pointer to the call object
   851 * @param aCallObject pointer to the call object
   846 */
   852 */
   847 	{
   853 	{
   848 	LOGLINE1(">>CSimLine::ResetRemoteHangupCallObject");
   854 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_RESETREMOTEHANGUPCALLOBJECT_1, ">>CSimLine::ResetRemoteHangupCallObject");
   849 	__ASSERT_ALWAYS(iRemoteHangupCall==aCallObject,SimPanic(EIllegalAnswerRemoteHangupCallInconsistency));
   855 	__ASSERT_ALWAYS(iRemoteHangupCall==aCallObject,SimPanic(EIllegalAnswerRemoteHangupCallInconsistency));
   850 	iRemoteHangupCallReqPending=EFalse;
   856 	iRemoteHangupCallReqPending=EFalse;
   851 	}
   857 	}
   852 
   858 
   853 void CSimLine::ProcessRemoteHangupEvent()
   859 void CSimLine::ProcessRemoteHangupEvent()
   854 /**
   860 /**
   855 * Process a remote hangup event.
   861 * Process a remote hangup event.
   856 */
   862 */
   857 	{
   863 	{
   858 	LOGLINE1(">>CSimLine::ProcessRemoteHangupEvent");
   864 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSREMOTEHANGUPEVENT_1, ">>CSimLine::ProcessRemoteHangupEvent");
   859 
   865 
   860 	if (iRemoteHangupCall == NULL)
   866 	if (iRemoteHangupCall == NULL)
   861 		{
   867 		{
   862 		TInt err = FindActiveCall(iRemoteHangupCall);
   868 		TInt err = FindActiveCall(iRemoteHangupCall);
   863 		if(err == KErrNone)
   869 		if(err == KErrNone)
   864 			{
   870 			{
   865 			err = iRemoteHangupCall->ActionEvent(CSimCall::ECallEventRemoteHangup,KErrNone);
   871 			err = iRemoteHangupCall->ActionEvent(CSimCall::ECallEventRemoteHangup,KErrNone);
   866 			if(err != KErrNone)
   872 			if(err != KErrNone)
   867 				{
   873 				{
   868 				LOGLINE2("ERROR: CSimLine::ProcessRemoteHangupEvent returned: %d", err);
   874 				OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSREMOTEHANGUPEVENT_2, "ERROR: CSimLine::ProcessRemoteHangupEvent returned: %d", err);
   869 				}
   875 				}
   870 			}
   876 			}
   871 		else
   877 		else
   872 			{
   878 			{
   873 			LOGLINE1("No outstanding call to hang up remotely");
   879 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSREMOTEHANGUPEVENT_3, "No outstanding call to hang up remotely");
   874 			}
   880 			}
   875 		}
   881 		}
   876 	LOGLINE1("<<CSimLine::ProcessRemoteHangupEvent");
   882 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSREMOTEHANGUPEVENT_4, "<<CSimLine::ProcessRemoteHangupEvent");
   877 	}
   883 	}
   878 
   884 
   879 void CSimLine::CallDestructor(CSimCall* aCall)
   885 void CSimLine::CallDestructor(CSimCall* aCall)
   880 /**
   886 /**
   881  * This function is called from a call's destructor.
   887  * This function is called from a call's destructor.
   913 /**
   919 /**
   914 Send notification of an incoming call.
   920 Send notification of an incoming call.
   915 */
   921 */
   916 void CSimLine::ProcessNotifyIncomingCallEvent()
   922 void CSimLine::ProcessNotifyIncomingCallEvent()
   917 	{
   923 	{
   918 	LOGLINE1(">>CSimLine::ProcessNotifyIncomingCallEvent");	
   924 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSNOTIFYINCOMINGCALLEVENT_1, ">>CSimLine::ProcessNotifyIncomingCallEvent");
   919 	if(iNotifyIncomingCall.iNotifyPending)
   925 	if(iNotifyIncomingCall.iNotifyPending)
   920 		{
   926 		{
   921 		iNotifyIncomingCall.iNotifyPending=EFalse;
   927 		iNotifyIncomingCall.iNotifyPending=EFalse;
   922 		((TName*)iNotifyIncomingCall.iNotifyData)->Copy(iAnswerNextIncomingCall->iName);
   928 		((TName*)iNotifyIncomingCall.iNotifyData)->Copy(iAnswerNextIncomingCall->iName);
   923 		ReqCompleted(iNotifyIncomingCall.iNotifyHandle,KErrNone);
   929 		ReqCompleted(iNotifyIncomingCall.iNotifyHandle,KErrNone);
   924 		}
   930 		}
   925 	LOGLINE1("<<CSimLine::ProcessNotifyIncomingCallEvent");	
   931 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMLINE_PROCESSNOTIFYINCOMINGCALLEVENT_2, "<<CSimLine::ProcessNotifyIncomingCallEvent");
   926 	}
   932 	}
   927 
   933