CRegBindingImplementation Class Reference

class CRegBindingImplementation : public CBase

Implementation class for managing SIP registration binding.

Inherits from

Public Member Functions
~CRegBindingImplementation ()
void AddTransactionL ( CSIPTransactionBase &)
const CSIPToHeader & Aor ()
CSIPRegistrationBinding & Binding ()
void ChangeState (const CRegistrationState *)
TInt CheckIfStandAlone ()
CSIPClientConnection * ClientConnection ()
CSIPClientConnection & ClientConnectionL ()
CSIPConnection * Connection ()
const CSIPConnection * Connection ()
void ConnectionDeleted ()
void ConnectionLost ()
const CSIPContactHeader & ContactHeader ()
CSIPContactHeader & ContactHeader ()
TUint32 ContextId ()
CSIPClientTransaction * CreateClientTransactionL ()
void DeletingRefresh ( 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 ()
void RemoveRegisteredContact ()
void RemoveTransaction (const CSIPTransactionBase &)
CSIPConnection & SIPConnectionL ()
const CSIPRefresh * SIPRefresh ()
CSIPRefresh * SIPRefresh ()
void SetOutboundProxyL ( CSIPRouteHeader *)
void SetPropertyL ( TUint32 , TBool )
void SetRegistrationId ( TUint32 )
MTransactionAssociation & TransactionAssociation ()
CSIPClientTransaction * UpdateL ( CSIPMessageElements *, TUint *)
CSIPClientTransaction * UpdateRefreshL ( CSIPRefresh &, CSIPMessageElements *, TBool )
void UpdateRefreshState ( TUint )
void UpdateRegisteredContactL ()
TBool operator== (const CRegBindingImplementation &)
Private Member Functions
CRegBindingImplementation ( CSIPRegistrationBinding &, CSIPConnection &)
void CheckConnectionL ()
void CheckElementsL (const CSIPMessageElements *)
void ConstructL ( CSIPToHeader *, CSIPContactHeader *, CSIPRefresh *, CSIPRouteHeader *, CUri8 *, CSIPFromHeader *)
void DetachContactHeader ( TAny *)
void DetachHeaders ( 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 &)

void AddTransactionL ( 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 *)

void ChangeState ( const CRegistrationState * aNewState )

Change the registration binding state.

Parameters

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

CheckConnectionL()

void CheckConnectionL ( ) 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 *)

void CheckElementsL ( 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 * aElements Message 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()

void ConnectionDeleted ( )

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

ConnectionLost()

void ConnectionLost ( )

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

void ConstructL ( 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)

void DeletingRefresh ( CSIPRefresh & aRefresh,
TUint32 aRefreshId
)

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 = 0 contains 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 *)

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

Parameters

TAny * aElements Message elements. Ownership is not transferred.

DetachHeaders(TAny *, RStringF)

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

Parameters

TAny * aElements Message elements. Ownership is not transferred.
RStringF aName Header 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 ( TInt aError,
TUint32 aRequestId,
CConnectionCallback & aCallback
)

Parameters

TInt aError
TUint32 aRequestId
CConnectionCallback & aCallback

FindTransaction(TUint32)

CSIPClientTransaction * FindTransaction ( TUint32 aRequestId )

Searches for a transaction matching the given aRequestId.

Parameters

TUint32 aRequestId Request id

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

TBool HandleError ( CConnectionCallback & aCallback,
TInt aError,
TUint32 aRequestId,
const CRegistrationState & aUnregistered
)

Parameters

CConnectionCallback & aCallback
TInt aError
TUint32 aRequestId
const CRegistrationState & aUnregistered

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

TBool IncomingResponseL ( CSIPResponseElements * aElements,
TUint32 aRequestId,
TUint32 aRegistrationId,
TUint32 aRefreshId,
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 & aRegistration Registration binding who creates this CRegBindingImplementation instance.
CSIPConnection & aConnection The SIP connection to be used
CSIPToHeader * aAor contains user's address-of-record to register; the ownership is transfered
CSIPContactHeader * aContact contact(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 * aRefresh if set, created binding will be refreshed; the ownership is transfered
CSIPRouteHeader * aOutboundProxy an outbound proxy address; the ownership is transfered
CUri8 * aRemoteUri if set, will be used in request-uri construction; the ownership is transfered
CSIPFromHeader * aFrom From 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 = 0 contains 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()

void RemoveRegisteredContact ( )

RemoveTransaction(const CSIPTransactionBase &)

void RemoveTransaction ( 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 *)

void SetOutboundProxyL ( CSIPRouteHeader * aOutboundProxy )

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

Parameters

CSIPRouteHeader * aOutboundProxy an outbound proxy. Ownership is transferred.

SetPropertyL(TUint32, TBool)

void SetPropertyL ( TUint32 aProperty,
TBool aValue
)
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)

void SetRegistrationId ( TUint32 aRegistrationId )

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,
TBool aTerminate
)

Parameters

CSIPRefresh & aRefresh
CSIPMessageElements * aElements
TBool aTerminate

UpdateRefreshState(TUint)

void UpdateRefreshState ( TUint aStatusCode ) const

Parameters

TUint aStatusCode

UpdateRegisteredContactL()

void UpdateRegisteredContactL ( )

operator==(const CRegBindingImplementation &)

TBool operator== ( const CRegBindingImplementation & aRegistration ) const

Compares this object to another object

Parameters

const CRegBindingImplementation & aRegistration CRegBindingImplementation 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]