CRegBindingImplementation Class Reference

class CRegBindingImplementation : public CBase

Implementation class for managing SIP registration binding.

Inherits from

  • CRegBindingImplementation
Public Member Functions
~CRegBindingImplementation()
voidAddTransactionL(CSIPTransactionBase &)
const CSIPToHeader &Aor()
CSIPRegistrationBinding &Binding()
voidChangeState(const CRegistrationState *)
TInt CheckIfStandAlone()
CSIPClientConnection *ClientConnection()
CSIPClientConnection &ClientConnectionL()
CSIPConnection *Connection()
const CSIPConnection *Connection()
voidConnectionDeleted()
voidConnectionLost()
const CSIPContactHeader &ContactHeader()
CSIPContactHeader &ContactHeader()
TUint32 ContextId()
CSIPClientTransaction *CreateClientTransactionL()
voidDeletingRefresh(CSIPRefresh &, TUint32)
CSIPClientTransaction *DeregisterL(CSIPMessageElements *)
CSIPClientTransaction *DoDeregisterL(CSIPMessageElements *)
CSIPClientTransaction *DoRegisterL(CSIPMessageElements *)
CSIPClientTransaction *DoUpdateL(CSIPMessageElements *, TUint *)
TBool ErrorOccured(TInt, TUint32, CConnectionCallback &)
CSIPClientTransaction *FindTransaction(TUint32)
TBool HandleError(CConnectionCallback &, TInt, TUint32, const CRegistrationState &)
TBool IncomingResponseL(CSIPResponseElements *, TUint32, TUint32, TUint32, CConnectionCallback &)
TBool IsContextActive()
CRegBindingImplementation *NewL(CSIPRegistrationBinding &, CSIPConnection &, CSIPToHeader *, CSIPContactHeader *, CSIPRefresh *, CSIPRouteHeader *, CUri8 *, CSIPFromHeader *)
const CSIPRouteHeader *OutboundProxy()
CSIPClientTransaction *RegisterL(CSIPMessageElements *)
const CSIPContactHeader *RegisteredContact()
voidRemoveRegisteredContact()
voidRemoveTransaction(const CSIPTransactionBase &)
CSIPConnection &SIPConnectionL()
const CSIPRefresh *SIPRefresh()
CSIPRefresh *SIPRefresh()
voidSetOutboundProxyL(CSIPRouteHeader *)
voidSetPropertyL(TUint32, TBool)
voidSetRegistrationId(TUint32)
MTransactionAssociation &TransactionAssociation()
CSIPClientTransaction *UpdateL(CSIPMessageElements *, TUint *)
CSIPClientTransaction *UpdateRefreshL(CSIPRefresh &, CSIPMessageElements *, TBool)
voidUpdateRefreshState(TUint)
voidUpdateRegisteredContactL()
TBool operator==(const CRegBindingImplementation &)
Private Member Functions
CRegBindingImplementation(CSIPRegistrationBinding &, CSIPConnection &)
voidCheckConnectionL()
voidCheckElementsL(const CSIPMessageElements *)
voidConstructL(CSIPToHeader *, CSIPContactHeader *, CSIPRefresh *, CSIPRouteHeader *, CUri8 *, CSIPFromHeader *)
voidDetachContactHeader(TAny *)
voidDetachHeaders(TAny *, RStringF)
const CRegistrationState &StateL()
UNIT_TEST(CSIP_Test)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
CSIPToHeader *iAor
TBool iCacheOutboundProxyIP
CSIPConnection *iConnection
CSIPContactHeader *iContact
CSIPFromHeader *iFrom
CSIPRouteHeader *iOutboundProxy
CSIPRefresh *iRefresh
CSIPContactHeader *iRegisteredContact
CSIPRegistrationBinding &iRegistration
TUint32 iRegistrationId
CUri8 *iRemoteUri
TBool iSendWithExpires
const CRegistrationState *iState
RPointerArray< CSIPClientTransaction >iTransactions

Constructor & Destructor Documentation

CRegBindingImplementation(CSIPRegistrationBinding &, CSIPConnection &)

CRegBindingImplementation(CSIPRegistrationBinding &aRegistration,
CSIPConnection &aConnection
)[private]

Parameters

CSIPRegistrationBinding & aRegistration
CSIPConnection & aConnection

~CRegBindingImplementation()

~CRegBindingImplementation()

Destructor

Member Functions Documentation

AddTransactionL(CSIPTransactionBase &)

voidAddTransactionL(CSIPTransactionBase &aTransaction)

Parameters

CSIPTransactionBase & aTransaction

Aor()

const CSIPToHeader &Aor()const

Gets the address-of-record (AOR) used for creating binding

Binding()

CSIPRegistrationBinding &Binding()const

ChangeState(const CRegistrationState *)

voidChangeState(const CRegistrationState *aNewState)

Change the registration binding state.

Parameters

const CRegistrationState * aNewStateState to enter, can be NULL. Ownership is not transferred.

CheckConnectionL()

voidCheckConnectionL()const [private]

Checks that CSIPConnection is available for use (not NULL). If iConnection is NULL, it means user has deleted a resource needed by CRegBindingImplementation, and this function leaves.

CheckElementsL(const CSIPMessageElements *)

voidCheckElementsL(const CSIPMessageElements *aElements)const [private]
Checks that aElements don't contain Contact or Expires headers.
leave
KErrSIPMalformedMessage If Contact or Expires header is present in aElements.

Parameters

const CSIPMessageElements * aElementsMessage elements

CheckIfStandAlone()

TInt CheckIfStandAlone()

ClientConnection()

CSIPClientConnection *ClientConnection()

ClientConnectionL()

CSIPClientConnection &ClientConnectionL()

Connection()

CSIPConnection *Connection()

Gets the SIP connection used for the registration.

Connection()

const CSIPConnection *Connection()const

Gets the SIP connection used for the registration.

ConnectionDeleted()

voidConnectionDeleted()

Informs CRegBindingImplementation that the associated CSIPConnection has been deleted. After this the CSIPRegistrationBinding object can't be used any more.

ConnectionLost()

voidConnectionLost()

ConstructL(CSIPToHeader *, CSIPContactHeader *, CSIPRefresh *, CSIPRouteHeader *, CUri8 *, CSIPFromHeader *)

voidConstructL(CSIPToHeader *aAor,
CSIPContactHeader *aContacts,
CSIPRefresh *aRefresh,
CSIPRouteHeader *aOutboundProxy,
CUri8 *aRemoteUri,
CSIPFromHeader *aFrom
)[private]

Parameters

CSIPToHeader * aAor
CSIPContactHeader * aContacts
CSIPRefresh * aRefresh
CSIPRouteHeader * aOutboundProxy
CUri8 * aRemoteUri
CSIPFromHeader * aFrom

ContactHeader()

const CSIPContactHeader &ContactHeader()const

Gets Contact header associated with the registration binding

ContactHeader()

CSIPContactHeader &ContactHeader()

Gets Contact header associated with the registration binding

ContextId()

TUint32 ContextId()const

Gets the context id

CreateClientTransactionL()

CSIPClientTransaction *CreateClientTransactionL()

DeletingRefresh(CSIPRefresh &, TUint32)

voidDeletingRefresh(CSIPRefresh &aRefresh,
TUint32aRefreshId
)

Parameters

CSIPRefresh & aRefresh
TUint32 aRefreshId

DeregisterL(CSIPMessageElements *)

CSIPClientTransaction *DeregisterL(CSIPMessageElements *aElements = 0)
Creates SIP (de)REGISTER request, sends it to the given destination. This function will remove registration binding. Any SIP response (2xx - 6xx) to this request removes the binding. Note that deregistration can be done then the 2xx is received to the initial REGISTER transaction and there is no on-going registration updates.
Pre-condition
Connection().State()==EActive

Parameters

CSIPMessageElements * aElements = 0contains user SIP headers and content; the ownership is transfered. If set, user SIP headers must not contain any Contact-header nor Expires-header

DetachContactHeader(TAny *)

voidDetachContactHeader(TAny *aElements)[private, static]
Removes, does not delete, Contact headers from aElements.
Pre-condition
aElements != NULL

Parameters

TAny * aElementsMessage elements. Ownership is not transferred.

DetachHeaders(TAny *, RStringF)

voidDetachHeaders(TAny *aElements,
RStringFaName
)[private, static]
Removes, does not delete, the headers identified by aName, from aElements.
Pre-condition
aElements != NULL

Parameters

TAny * aElementsMessage elements. Ownership is not transferred.
RStringF aNameHeader name

DoDeregisterL(CSIPMessageElements *)

CSIPClientTransaction *DoDeregisterL(CSIPMessageElements *aElements)

Parameters

CSIPMessageElements * aElements

DoRegisterL(CSIPMessageElements *)

CSIPClientTransaction *DoRegisterL(CSIPMessageElements *aElements)

Parameters

CSIPMessageElements * aElements

DoUpdateL(CSIPMessageElements *, TUint *)

CSIPClientTransaction *DoUpdateL(CSIPMessageElements *aElements,
TUint *aExpirationValue
)

Parameters

CSIPMessageElements * aElements
TUint * aExpirationValue

ErrorOccured(TInt, TUint32, CConnectionCallback &)

TBool ErrorOccured(TIntaError,
TUint32aRequestId,
CConnectionCallback &aCallback
)

Parameters

TInt aError
TUint32 aRequestId
CConnectionCallback & aCallback

FindTransaction(TUint32)

CSIPClientTransaction *FindTransaction(TUint32aRequestId)

Searches for a transaction matching the given aRequestId.

Parameters

TUint32 aRequestIdRequest id

HandleError(CConnectionCallback &, TInt, TUint32, const CRegistrationState &)

TBool HandleError(CConnectionCallback &aCallback,
TIntaError,
TUint32aRequestId,
const CRegistrationState &aUnregistered
)

Parameters

CConnectionCallback & aCallback
TInt aError
TUint32 aRequestId
const CRegistrationState & aUnregistered

IncomingResponseL(CSIPResponseElements *, TUint32, TUint32, TUint32, CConnectionCallback &)

TBool IncomingResponseL(CSIPResponseElements *aElements,
TUint32aRequestId,
TUint32aRegistrationId,
TUint32aRefreshId,
CConnectionCallback &aCallback
)

Parameters

CSIPResponseElements * aElements
TUint32 aRequestId
TUint32 aRegistrationId
TUint32 aRefreshId
CConnectionCallback & aCallback

IsContextActive()

TBool IsContextActive()const

Checks if the registration context can be used for creating SIP messages/dialogs

NewL(CSIPRegistrationBinding &, CSIPConnection &, CSIPToHeader *, CSIPContactHeader *, CSIPRefresh *, CSIPRouteHeader *, CUri8 *, CSIPFromHeader *)

CRegBindingImplementation *NewL(CSIPRegistrationBinding &aRegistration,
CSIPConnection &aConnection,
CSIPToHeader *aAor,
CSIPContactHeader *aContact,
CSIPRefresh *aRefresh,
CSIPRouteHeader *aOutboundProxy,
CUri8 *aRemoteUri,
CSIPFromHeader *aFrom
)[static]
Two-phased constructor.
Pre-condition
aAor != 0 && aContact != 0
"Expires" parameter in aContact must be >= KSIPMinExpirationValue

Parameters

CSIPRegistrationBinding & aRegistrationRegistration binding who creates this CRegBindingImplementation instance.
CSIPConnection & aConnectionThe SIP connection to be used
CSIPToHeader * aAorcontains user's address-of-record to register; the ownership is transfered
CSIPContactHeader * aContactcontact(s) to be registered. The "expires" parameter indicates how long the client would like the binding to be valid. "expires" parameter value must be >= KSIPMinExpirationValue; the ownership is transfered
CSIPRefresh * aRefreshif set, created binding will be refreshed; the ownership is transfered
CSIPRouteHeader * aOutboundProxyan outbound proxy address; the ownership is transfered
CUri8 * aRemoteUriif set, will be used in request-uri construction; the ownership is transfered
CSIPFromHeader * aFromFrom header, the ownership is transferred

OutboundProxy()

const CSIPRouteHeader *OutboundProxy()const

Gets used outbound proxy

RegisterL(CSIPMessageElements *)

CSIPClientTransaction *RegisterL(CSIPMessageElements *aElements = 0)
Creates SIP REGISTER request, sends it to the given destination. Received 2xx response will create at least one registration binding.
Pre-condition
Connection().State()==EActive
leave
KErrSIPMalformedMessage if aElements contain contact or expires headers

Parameters

CSIPMessageElements * aElements = 0contains user SIP headers and content; the ownership is taken

RegisteredContact()

const CSIPContactHeader *RegisteredContact()const

Gets the registered Contact-header received in the 200 OK response.

RemoveRegisteredContact()

voidRemoveRegisteredContact()

RemoveTransaction(const CSIPTransactionBase &)

voidRemoveTransaction(const CSIPTransactionBase &aTransaction)

Parameters

const CSIPTransactionBase & aTransaction

SIPConnectionL()

CSIPConnection &SIPConnectionL()

SIPRefresh()

const CSIPRefresh *SIPRefresh()const

Gets associated refresh in case the user has requested the refresh of the registration. Note that client cannot use update or terminate functions defined in the CSIPRefresh class.

SIPRefresh()

CSIPRefresh *SIPRefresh()

Gets associated refresh in case the user has requested the refresh of the registration. Note that client cannot use update or terminate functions defined in the CSIPRefresh class.

SetOutboundProxyL(CSIPRouteHeader *)

voidSetOutboundProxyL(CSIPRouteHeader *aOutboundProxy)

Sets/resets outbound proxy. If a 0-pointer is given the outbound proxy will be reset.

Parameters

CSIPRouteHeader * aOutboundProxyan outbound proxy. Ownership is transferred.

SetPropertyL(TUint32, TBool)

voidSetPropertyL(TUint32aProperty,
TBoolaValue
)
Sets/resets properties.
Pre-condition
IsContextActive()==EFalse
leave
KErrSIPInvalidRegistrationState if IsContextActive() is ETrue
leave
KErrNotFound if property is not found

Parameters

TUint32 aProperty
TBool aValue

SetRegistrationId(TUint32)

voidSetRegistrationId(TUint32aRegistrationId)

Parameters

TUint32 aRegistrationId

StateL()

const CRegistrationState &StateL()const [private]

Returns the current registration state. If state handler is not available, meaning user has deleted a resource needed by CRegBindingImplementation, this function leaves.

TransactionAssociation()

MTransactionAssociation &TransactionAssociation()

UNIT_TEST(CSIP_Test)

UNIT_TEST(CSIP_Test)const [private]

Parameters

CSIP_Test

UpdateL(CSIPMessageElements *, TUint *)

CSIPClientTransaction *UpdateL(CSIPMessageElements *aElements,
TUint *aExpirationValue = 0
)

Parameters

CSIPMessageElements * aElements
TUint * aExpirationValue = 0

UpdateRefreshL(CSIPRefresh &, CSIPMessageElements *, TBool)

CSIPClientTransaction *UpdateRefreshL(CSIPRefresh &aRefresh,
CSIPMessageElements *aElements,
TBoolaTerminate
)

Parameters

CSIPRefresh & aRefresh
CSIPMessageElements * aElements
TBool aTerminate

UpdateRefreshState(TUint)

voidUpdateRefreshState(TUintaStatusCode)const

Parameters

TUint aStatusCode

UpdateRegisteredContactL()

voidUpdateRegisteredContactL()

operator==(const CRegBindingImplementation &)

TBool operator==(const CRegBindingImplementation &aRegistration)const

Compares this object to another object

Parameters

const CRegBindingImplementation & aRegistrationCRegBindingImplementation object to compare

Member Data Documentation

CSIPToHeader * iAor

CSIPToHeader *iAor[private]

TBool iCacheOutboundProxyIP

TBool iCacheOutboundProxyIP[private]

CSIPConnection * iConnection

CSIPConnection *iConnection[private]

CSIPContactHeader * iContact

CSIPContactHeader *iContact[private]

CSIPFromHeader * iFrom

CSIPFromHeader *iFrom[private]

CSIPRouteHeader * iOutboundProxy

CSIPRouteHeader *iOutboundProxy[private]

CSIPRefresh * iRefresh

CSIPRefresh *iRefresh[private]

CSIPContactHeader * iRegisteredContact

CSIPContactHeader *iRegisteredContact[private]

CSIPRegistrationBinding & iRegistration

CSIPRegistrationBinding &iRegistration[private]

TUint32 iRegistrationId

TUint32 iRegistrationId[private]

CUri8 * iRemoteUri

CUri8 *iRemoteUri[private]

TBool iSendWithExpires

TBool iSendWithExpires[private]

const CRegistrationState * iState

const CRegistrationState *iState[private]

RPointerArray< CSIPClientTransaction > iTransactions

RPointerArray< CSIPClientTransaction >iTransactions[private]