telephonyserver/etelserverandcore/SETEL/ET_SVR.CPP
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
       
    16 
       
    17 #include "OstTraceDefinitions.h"
       
    18 #ifdef OST_TRACE_COMPILER_IN_USE
       
    19 #include "ET_SVRTraces.h"
       
    20 #endif
       
    21 
    16 #include <e32svr.h>
    22 #include <e32svr.h>
    17 #include "ET_SSTD.H"
    23 #include "ET_SSTD.H"
    18 #include <e32cmn.h>
    24 #include <e32cmn.h>
    19 #include "et_record.h"
    25 #include "et_record.h"
    20 #include <u32hal.h>
    26 #include <u32hal.h>
    55 void CDestroyDummySubSession::RunL()
    61 void CDestroyDummySubSession::RunL()
    56 //
    62 //
    57 // Destroy the tel object and the the server
    63 // Destroy the tel object and the the server
    58 //
    64 //
    59 	{
    65 	{
    60 	LOGTEXT("In RunL and about to Destroy the Tel Objects");
    66 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CDESTROYDUMMYSUBSESSION_RUNL_1, "In RunL and about to Destroy the Tel Objects");
    61 	iOpen=EFalse;
    67 	iOpen=EFalse;
    62 	iTelObject->TelObjectClose();
    68 	iTelObject->TelObjectClose();
    63 	}
    69 	}
    64 
    70 
    65 //
    71 //
    95 	/** 
   101 	/** 
    96 	@internalComponent */
   102 	@internalComponent */
    97 	{
   103 	{
    98 	if((aMessage.Type()==EOptional) || (aMessage.Type()==EGraceful))
   104 	if((aMessage.Type()==EOptional) || (aMessage.Type()==EGraceful))
    99 		{
   105 		{
   100 		LOGTEXT("CTelServer received Shutdown. Scheduling shutdown when there's no sessions.");
   106 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_CFMESSAGESHUTDOWN_1, "CTelServer received Shutdown. Scheduling shutdown when there's no sessions.");
   101 		iShutGracefully = ETrue;
   107 		iShutGracefully = ETrue;
   102 		LOGTEXT2("Session Count is %d", iSessionCount);
   108 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_CFMESSAGESHUTDOWN_2, "Session Count is %d", iSessionCount);
   103 		if(iSessionCount==0)
   109 		if(iSessionCount==0)
   104 			{
   110 			{
   105 			LOGTEXT("Calling AsynOneShot::Call()");
   111 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_CFMESSAGESHUTDOWN_3, "Calling AsynOneShot::Call()");
   106 			iSch->Call();
   112 			iSch->Call();
   107 			}
   113 			}
   108 		}
   114 		}
   109 	else
   115 	else
   110 		{
   116 		{
   111 		LOGTEXT("CTelServer received Shutdown option EUnGraceful. Not supported, ignoring.");
   117 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_CFMESSAGESHUTDOWN_4, "CTelServer received Shutdown option EUnGraceful. Not supported, ignoring.");
   112 		}
   118 		}
   113 	}
   119 	}
   114 
   120 
   115 //
   121 //
   116 // CTelSchedulerStop class definitions
   122 // CTelSchedulerStop class definitions
   141 void CTelSchedulerStop::RunL()
   147 void CTelSchedulerStop::RunL()
   142 //
   148 //
   143 // Stop the Active Scheduler (after any libraries have been unloaded)
   149 // Stop the Active Scheduler (after any libraries have been unloaded)
   144 //
   150 //
   145 	{
   151 	{
   146 	LOGTEXT("In RunL and about to stop CActiveScheduler");
   152 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSCHEDULERSTOP_RUNL_1, "In RunL and about to stop CActiveScheduler");
   147 	CActiveScheduler::Stop();
   153 	CActiveScheduler::Stop();
   148 	}
   154 	}
   149 
   155 
   150 //
   156 //
   151 // CTelServer class definitions
   157 // CTelServer class definitions
   188 	StartL(ETEL_SERVER_NAME);
   194 	StartL(ETEL_SERVER_NAME);
   189 	}
   195 	}
   190 
   196 
   191 CTelServer::~CTelServer()
   197 CTelServer::~CTelServer()
   192 	{
   198 	{
   193 	LOGTEXT("CTelServer::~CTelServer()");
   199 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_DTOR_1, "CTelServer::~CTelServer()");
   194 	delete iChannelHandler;
   200 	delete iChannelHandler;
   195 	delete iPhoneManager;
   201 	delete iPhoneManager;
   196 	delete iSch;
   202 	delete iSch;
   197 	iEmergencyClientSessions.Reset();
   203 	iEmergencyClientSessions.Reset();
   198 	}
   204 	}
   234 void CTelServer::Dec()
   240 void CTelServer::Dec()
   235 //
   241 //
   236 // Decrement a session stop scheduler if no session
   242 // Decrement a session stop scheduler if no session
   237 //
   243 //
   238 	{
   244 	{
   239 	LOGTEXT("Entered CTelServer::Dec");
   245 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_DEC_1, "Entered CTelServer::Dec");
   240 	__ASSERT_ALWAYS((iSessionCount>0),Fault(EEtelFaultNegativeSessionCount));
   246 	__ASSERT_ALWAYS((iSessionCount>0),Fault(EEtelFaultNegativeSessionCount));
   241 	iSessionCount--;
   247 	iSessionCount--;
   242 	LOGTEXT2("Session Count is %d", iSessionCount);
   248 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_DEC_2, "Session Count is %d", iSessionCount);
   243 	// If iShutGracefully==ETrue the Rootserver has informed us that it wants us to shutdown
   249 	// If iShutGracefully==ETrue the Rootserver has informed us that it wants us to shutdown
   244 	// next time there is no sessions. If it is EFalse no such notification has arrived and 
   250 	// next time there is no sessions. If it is EFalse no such notification has arrived and 
   245 	// ETel continues running even though there are no sessions.
   251 	// ETel continues running even though there are no sessions.
   246 	if((iSessionCount==0) && (iShutGracefully))
   252 	if((iSessionCount==0) && (iShutGracefully))
   247 		{
   253 		{
   248 		LOGTEXT("Calling AsynOneShot::Call()");
   254 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_DEC_3, "Calling AsynOneShot::Call()");
   249 		iSch->Call();
   255 		iSch->Call();
   250 		}
   256 		}
   251 	LOGTEXT("Exited from CTelServer::Dec");
   257 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVER_DEC_4, "Exited from CTelServer::Dec");
   252 	}
   258 	}
   253 
   259 
   254 TBool CTelServer::IsPriorityClient(const CTelSession* aSession) const
   260 TBool CTelServer::IsPriorityClient(const CTelSession* aSession) const
   255 //
   261 //
   256 // Check if aSession is the priority client session
   262 // Check if aSession is the priority client session
   441 //
   447 //
   442 	{
   448 	{
   443 	// RThread::SetProtected is superceded by the security model
   449 	// RThread::SetProtected is superceded by the security model
   444 	
   450 	
   445 	__UHEAP_MARK;
   451 	__UHEAP_MARK;
   446 	LOGTEXT("----------New Log----------\015\012");
   452 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDERS, ETELSERVERTHREAD_1, "----------New Log----------\015\012");
   447 	LOGTEXT("Entered ETel Server thread");
   453 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDERS, ETELSERVERTHREAD_2, "Entered ETel Server thread");
   448 	LOGTEXTREL("Entered ETel Server thread");
   454 	OstTraceDef0(OST_TRACE_CATEGORY_PRODUCTION, TRACE_BORDERS, ETELSERVERTHREAD_3, "Entered ETel Server thread");
   449 	
   455 	
   450 	CTrapCleanup* pT;
   456 	CTrapCleanup* pT;
   451 	if ((pT=CTrapCleanup::New())==NULL)
   457 	if ((pT=CTrapCleanup::New())==NULL)
   452 		{
   458 		{
   453 		Fault(EEtelFaultCreateTrapCleanup);
   459 		Fault(EEtelFaultCreateTrapCleanup);
   469 	if(err!=KErrNone)
   475 	if(err!=KErrNone)
   470 		{
   476 		{
   471 		Fault(EEtelFaultSvrStartServer);
   477 		Fault(EEtelFaultSvrStartServer);
   472 		}
   478 		}
   473 
   479 
   474 	LOGTEXT("ETel:\tMeeting rendezvous\n");
   480 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDERS, ETELSERVERTHREAD_4, "ETel:\tMeeting rendezvous\n");
   475 	RThread::Rendezvous(KErrNone);
   481 	RThread::Rendezvous(KErrNone);
   476 	CTelScheduler::Start();
   482 	CTelScheduler::Start();
   477 	LOGTEXT("ETel:\tScheduler has been stopped\n");
   483 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDERS, ETELSERVERTHREAD_5, "ETel:\tScheduler has been stopped\n");
   478 
   484 
   479 	delete pT;
   485 	delete pT;
   480 	delete pServer;
   486 	delete pServer;
   481 	delete pScheduler;
   487 	delete pScheduler;
   482 
   488 
   483 	LOGTEXT("ETel:\tAbout to exit ETel thread function\n");
   489 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDERS, ETELSERVERTHREAD_6, "ETel:\tAbout to exit ETel thread function\n");
   484 	LOGTEXTREL("ETel:\tAbout to exit ETel thread function\n");
   490 	OstTraceDef0(OST_TRACE_CATEGORY_PRODUCTION, TRACE_BORDERS, ETELSERVERTHREAD_7, "ETel:\tAbout to exit ETel thread function\n");
   485 	__UHEAP_MARKEND;
   491 	__UHEAP_MARKEND;
   486 
   492 
   487 	return(KErrNone);
   493 	return(KErrNone);
   488 	}
   494 	}
   489 
   495 
   582 	20605,		//range is 20605-20606 inclusive
   588 	20605,		//range is 20605-20606 inclusive
   583 	20607,		//range is 20607-20609 inclusive
   589 	20607,		//range is 20607-20609 inclusive
   584 	20610,		//range is 20610-20610 inclusive
   590 	20610,		//range is 20610-20610 inclusive
   585 	20611,		//range is 20611-20618 inclusive
   591 	20611,		//range is 20611-20618 inclusive
   586 	20619,		//range is 20619-20999 inclusive
   592 	20619,		//range is 20619-20999 inclusive
   587 	21000,		//range is 21000-21029 inclusive
   593 	21000,		//range is 21000-21030 inclusive
   588 	21030,		//range is 21030-21499 inclusive
   594 	21031,		//range is 21031-21499 inclusive
   589 	21500,		//range is 21500-21508 inclusive
   595 	21500,		//range is 21500-21508 inclusive
   590 	21509,		//range is 21509-21509 inclusive
   596 	21509,		//range is 21509-21509 inclusive
   591 	21510,		//range is 21510-21511 inclusive
   597 	21510,		//range is 21510-21511 inclusive
   592 	21512,		//range is 21512-21513 inclusive
   598 	21512,		//range is 21512-21513 inclusive
   593 	21514,		//range is 21514-21521 inclusive
   599 	21514,		//range is 21514-21521 inclusive
   594 	21522,		//range is 21522-21522 inclusive
   600 	21522,		//range is 21522-21522 inclusive
   595 	21523,		//range is 21523-21524 inclusive
   601 	21523,		//range is 21523-21524 inclusive
   596 	21525,		//range is 21525-21525 inclusive
   602 	21525,		//range is 21525-21525 inclusive
   597 	21526,		//range is 21526
   603 	21526,		//range is 21526
   598 	21527,		//range is 21527-21528 inclusive
   604 	21527,		//range is 21527-21528 inclusive
   599 	21529,		//range is 21529
   605 	21529,		//range is 21529-21530 inclusive
   600 	21530,		//range is 21530-21999 inclusive
   606 	21531,		//range is 21531-21999 inclusive
   601 	22000,		//range is 22000-22003 inclusive
   607 	22000,		//range is 22000-22003 inclusive
   602 	22004,		//range is 22004
   608 	22004,		//range is 22004
   603 	22005,		//range is 22005-22008 inclusive
   609 	22005,		//range is 22005-22008 inclusive
   604 	22009,		//range is 22009
   610 	22009,		//range is 22009
   605 	22010,		//range is 22010-22011 inclusive
   611 	22010,		//range is 22010-22011 inclusive