# HG changeset patch # User ivan.fildichev@opencode.com # Date 1287501069 -10800 # Node ID 7f379d8ed02d5def6269cc09f7ef6f2986da139d # Parent d4cfc65049ba71d581eef62266cf954e8572d6c3 Implemented CTelObject::SetSessionOwnerByTsyHandleAndIpc() and CPhoneBase::FindByIpcAndSecureId() diff -r d4cfc65049ba -r 7f379d8ed02d telephonyserver/etelserverandcore/INC/ET_PHONE.H --- a/telephonyserver/etelserverandcore/INC/ET_PHONE.H Fri Oct 15 11:27:58 2010 +0300 +++ b/telephonyserver/etelserverandcore/INC/ET_PHONE.H Tue Oct 19 18:11:09 2010 +0300 @@ -180,7 +180,8 @@ IMPORT_C virtual TInt ServerVersion() const; IMPORT_C virtual TSecurityPolicy GetRequiredPlatSecCaps(const TInt aIpc); - IMPORT_C void SetSessionOwnerByTsyHandle(const TTsyReqHandle aTsyReqHandle); + IMPORT_C void SetSessionOwnerByTsyHandle(const TTsyReqHandle aTsyReqHandle); + IMPORT_C void SetSessionOwnerByTsyHandleAndIpc(const TTsyReqHandle aTsyReqHandle, TInt aIpc); IMPORT_C TInt ReserveSession(); IMPORT_C TBool IsSessionReserved() const; IMPORT_C void CancelReserveSession(); @@ -470,6 +471,7 @@ CReqEntry* FindClientInActive(CTelSession* aSession,const TInt aSubSessionHandle,const TInt aIpc); CReqEntry* FindByIpcAndTelObject(const TInt aIpc, const CTelObject* aTelObject, const TUint aBufSize); CReqEntry* FindByIpcAndTelObjectInWaiting(const TInt aIpc, const CTelObject* aTelObject, const TUint aBufSize); + CReqEntry* FindByIpcAndSecureId(const TInt aIpc, const TSecureId aSid); void AddReqToActive(CReqEntry* aReqEntry); void AddReqToWaiting(CReqEntry* aReqEntry); diff -r d4cfc65049ba -r 7f379d8ed02d telephonyserver/etelserverandcore/SETEL/ET_CORE.CPP --- a/telephonyserver/etelserverandcore/SETEL/ET_CORE.CPP Fri Oct 15 11:27:58 2010 +0300 +++ b/telephonyserver/etelserverandcore/SETEL/ET_CORE.CPP Tue Oct 19 18:11:09 2010 +0300 @@ -1054,6 +1054,21 @@ return NULL; } +CReqEntry* CPhoneBase::FindByIpcAndSecureId(const TInt aIpc, const TSecureId aSid) +// +// Finds an active request by both IPC and by the TSecureId it was placed on +// + { + CReqEntry* reqEntry; + TDblQueIter iter(iReqActiveList); + while(reqEntry = iter++, reqEntry!=NULL) + { + if(reqEntry->iFunction==aIpc && reqEntry->iMessage.SecureId()==aSid + && EFalse != reqEntry->iPlacedRequest) + return reqEntry; + } + return NULL; + } CReqEntry* CPhoneBase::FindByIpcAndTelObjectInWaiting(const TInt aIpc, const CTelObject* aTelObject, const TUint aBufSize) // // Finds a waiting request by both IPC and by the TelObject it was placed on diff -r d4cfc65049ba -r 7f379d8ed02d telephonyserver/etelserverandcore/SETEL/ET_PHONE.CPP --- a/telephonyserver/etelserverandcore/SETEL/ET_PHONE.CPP Fri Oct 15 11:27:58 2010 +0300 +++ b/telephonyserver/etelserverandcore/SETEL/ET_PHONE.CPP Tue Oct 19 18:11:09 2010 +0300 @@ -1392,28 +1392,42 @@ } // Can be used by the TSY to set the session owner to the current request. +// For each request the CTSY is given a TsyReqHandle and and IPC so this is a sensible thing +// for it to be dealing with. +// Note that once a session has an owner the reserved state is irrelevant. +EXPORT_C void CTelObject::SetSessionOwnerByTsyHandleAndIpc(const TTsyReqHandle aTsyReqHandle, TInt aIpc) + { + + TInt owningsession = PhoneOwner()->FindSessionByTsyHandle( aTsyReqHandle ); + TInt owningsubsession = PhoneOwner()->FindSubSessionByTsyHandle( aTsyReqHandle ); + + + if((NULL != aIpc) && + (iDeliveryObject->GetReqMode() == (KReqModeSessionBased | KReqModeTransferToDefaultHandler))) + // transfer to default handler + { + CReqEntry* reqEntry = PhoneOwner()->FindByIpcAndSecureId(aIpc, KUssdDefaultClientSid); + if(NULL != reqEntry) + { + owningsession = reinterpret_cast(reqEntry->iSession); + owningsubsession = reqEntry->iMessage.Int3(); + } + } + iDeliveryObject->iSessionOwner = TPhoneClientId(owningsession, owningsubsession); + } + +// Can be used by the TSY to set the session owner to the current request. // For each request the CTSY is given a TsyReqHandle so this is a sensible thing // for it to be dealing with. // Note that once a session has an owner the reserved state is irrelevant. - EXPORT_C void CTelObject::SetSessionOwnerByTsyHandle(const TTsyReqHandle aTsyReqHandle) { const TInt owningsession = PhoneOwner()->FindSessionByTsyHandle( aTsyReqHandle ); const TInt owningsubsession = PhoneOwner()->FindSubSessionByTsyHandle( aTsyReqHandle ); - - - if(iDeliveryObject->GetReqMode() == (KReqModeSessionBased | KReqModeTransferToDefaultHandler)) // transfer to default handler - { - iDeliveryObject->iSessionOwner = TPhoneClientId(KUssdDefaultClientSid, owningsubsession); - } - else //not default handler - { - iDeliveryObject->iSessionOwner = TPhoneClientId(owningsession, owningsubsession); - } + iDeliveryObject->iSessionOwner = TPhoneClientId(owningsession, owningsubsession); } - TBool CTelObject::IsSessionOwner(CReqEntry* aReqEntry) const { TPhoneClientId clientId(reinterpret_cast(aReqEntry->iSession),aReqEntry->iMessage.Int3()); diff -r d4cfc65049ba -r 7f379d8ed02d telephonyserver/etelserverandcore/bwins/ETELU.DEF --- a/telephonyserver/etelserverandcore/bwins/ETELU.DEF Fri Oct 15 11:27:58 2010 +0300 +++ b/telephonyserver/etelserverandcore/bwins/ETELU.DEF Tue Oct 19 18:11:09 2010 +0300 @@ -264,4 +264,7 @@ ?SetSessionOwnerByTsyHandle@CTelObject@@QAEXK@Z @ 263 NONAME ; void CTelObject::SetSessionOwnerByTsyHandle(unsigned long) ?EndSession@CTelObject@@QAEXXZ @ 264 NONAME ; void CTelObject::EndSession(void) ?IsSessionInProgress@CTelObject@@QBEHXZ @ 265 NONAME ; int CTelObject::IsSessionInProgress(void) const + ?FindSessionByTsyHandle@CPhoneBase@@QAEHK@Z @ 266 NONAME ; int CPhoneBase::FindSessionByTsyHandle(unsigned long) + ?FindSubSessionByTsyHandle@CPhoneBase@@QAEHK@Z @ 267 NONAME ; int CPhoneBase::FindSubSessionByTsyHandle(unsigned long) + ?SetSessionOwnerByTsyHandleAndIpc@CTelObject@@QAEXKH@Z @ 268 NONAME ; void CTelObject::SetSessionOwnerByTsyHandleAndIpc(unsigned long, int) diff -r d4cfc65049ba -r 7f379d8ed02d telephonyserverplugins/common_tsy/commontsy/src/mmsms/cmmussdtsy.cpp --- a/telephonyserverplugins/common_tsy/commontsy/src/mmsms/cmmussdtsy.cpp Fri Oct 15 11:27:58 2010 +0300 +++ b/telephonyserverplugins/common_tsy/commontsy/src/mmsms/cmmussdtsy.cpp Tue Oct 19 18:11:09 2010 +0300 @@ -771,7 +771,14 @@ { if ( KErrNone == aError ) { - SetSessionOwnerByTsyHandle( reqHandle ); + if(EFalse == iSendToDefaultHandler) + { + SetSessionOwnerByTsyHandle( reqHandle ); + } + else // default handler + { + SetSessionOwnerByTsyHandleAndIpc( reqHandle, EMultimodeUssdSendMessageDefaultHandler ); + } } else {