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