Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: sipconnection.h
Link against: sipclient.lib

Class CSIPConnection

class CSIPConnection : public CBase;

Description

Class for monitoring connection's state and sending SIP requests outside the dialog associations. Class must not be used

Note that the user can have only one instance of the class per same IAP-id.

Derivation

Members

Defined in CSIPConnection:
EActive, EInactive, EInit, ESuspended, EUnavailable, FetchRegistrationsL(), GetLocalAddrL(), IapId(), NewL(), NewLC(), SIP(), SIP(), SendRequestL(), SendRequestL(), SendRequestL(), SendRequestL(), SetOptL(), SetOptL(), State(), TState, ~CSIPConnection()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

Capability: NetworkServices

static IMPORT_C CSIPConnection *NewL(CSIP &aSIP, TUint32 aIapId, MSIPConnectionObserver &aObserver);

Description

Two-phased constructor.

Parameters

CSIP &aSIP

a handle to the SIP server

TUint32 aIapId

IAP-id

MSIPConnectionObserver &aObserver

a observer for receiving asynchonous events on this connection

Return value

CSIPConnection *

New object, ownership is transferred


NewLC()

Capability: NetworkServices

static IMPORT_C CSIPConnection *NewLC(CSIP &aSIP, TUint32 aIapId, MSIPConnectionObserver &aObserver);

Description

Two-phased constructor. Constructs an object and adds the pointer to the cleanup stack;

Parameters

CSIP &aSIP

TUint32 aIapId

IAP-id

MSIPConnectionObserver &aObserver

a observer for receiving asynchonous events on this connection

Return value

CSIPConnection *

New object, ownership is transferred


~CSIPConnection()

Capability: NetworkServices

IMPORT_C ~CSIPConnection();

Description

Destructor

[Top]


Member functions


State()

IMPORT_C TState State() const;

Description

Gets current state of the connection

Return value

TState

current state of the connection


SendRequestL()

Capability: NetworkServices

IMPORT_C CSIPClientTransaction *SendRequestL(CSIPRequestElements *aElements, const MSIPRegistrationContext &aContext);

Pre-Condition

State() == EActive.

aContext.IsContextActive() == ETrue

Description

Creates SIP request and sends it to the given destination. The function must not be used with SIP requests that creates SIP dialog associations or must be sent within SIP dialog association. This provokes the Non-invite state machine. This function must be used if the user has created the registration binding.

Parameters

CSIPRequestElements *aElements

contains local and remote addresses, optional SIP message headers and body. The ownership is transferred.

const MSIPRegistrationContext &aContext

defines outbound proxy to be used. If the user does not provide from-address it will be constucted using user's AOR used during the registration.

Return value

CSIPClientTransaction *

SIP client transaction, ownership is transferred

Leave codes

KErrArgument

if aElements == 0

KErrSIPInvalidRegistrationState

if aContext.IsContextActive() == EFalse


SendRequestL()

Capability: NetworkServices

IMPORT_C CSIPClientTransaction *SendRequestL(CSIPRequestElements *aElements, const MSIPRegistrationContext &aContext, CSIPRefresh &aRefresh);

Pre-Condition

State() == EActive.

aContext.IsContextActive() == ETrue

Description

Creates SIP request and sends it to the given destination. The function must not be used with SIP requests that creates SIP dialog associations or must be sent within SIP dialog association. This provokes the Non-invite state machine. This function must be used if the user has created the registration binding.

Parameters

CSIPRequestElements *aElements

contains local and remote addresses, optional SIP message headers and body. The ownership is transferred.

const MSIPRegistrationContext &aContext

defines outbound proxy to be used. If the user does not provide from-address it will be constucted using user's AOR used during the registration.

CSIPRefresh &aRefresh

defines the refresh interval for this transaction.

Return value

CSIPClientTransaction *

SIP client transaction, ownership is transferred

Leave codes

KErrArgument

if aElements == 0

KErrSIPInvalidRegistrationState

if aContext.IsContextActive() == EFalse


SendRequestL()

Capability: NetworkServices

IMPORT_C CSIPClientTransaction *SendRequestL(CSIPRequestElements *aElements);

Pre-Condition

State() == EActive.

aElements.FromHeader() != 0

Description

Creates SIP request and sends it to the given destination. The function must not be used with SIP requests that creates SIP dialog associations or must be sent within SIP dialog association. This invokes the Non-invite state machine.

Parameters

CSIPRequestElements *aElements

contains local and remote addresses, optional SIP message headers and body. The ownership is transferred.

Return value

CSIPClientTransaction *

SIP client transaction, ownership is transferred

Leave codes

KErrArgument

if aElements == 0 or if From-header is not present in aElements


SendRequestL()

Capability: NetworkServices

IMPORT_C CSIPClientTransaction *SendRequestL(CSIPRequestElements *aElements, CSIPRefresh &aRefresh);

Pre-Condition

State() == EActive.

aElements.FromHeader() != 0

Description

Creates SIP request and sends it to the given destination. The function must not be used with SIP requests that creates SIP dialog associations or must be sent within SIP dialog association. This invokes the Non-invite state machine.

Parameters

CSIPRequestElements *aElements

contains local and remote addresses, optional SIP message headers and body. The ownership is transferred.

CSIPRefresh &aRefresh

indicates that transaction will be refreshed

Return value

CSIPClientTransaction *

SIP client transaction, ownership is transferred

Leave codes

KErrArgument

if aElements == 0 or if From-header is not present in aElements


FetchRegistrationsL()

Capability: NetworkServices

IMPORT_C CSIPClientTransaction *FetchRegistrationsL(CSIPRequestElements *aElements);

Pre-Condition

State() == EActive

aElements != 0

aElements->Method().DesC().Length()==0

Description

Creates SIP REGISTER request and sends it to the given destination. User must no define any Contact or Expires-headers in the provided elements.

Parameters

CSIPRequestElements *aElements

contains local and remote addresses, optional SIP message headers and body. User must not set any expires values to aElements. The ownership is transferred.

Return value

CSIPClientTransaction *

SIP REGISTER client transaction, ownership is transferred

Leave codes

KErrArgument

if aElements == 0 or if the request method has been defined in aElements


IapId()

IMPORT_C TUint32 IapId() const;

Description

Gets Iap-id used for this connection

Return value

TUint32

Iap-id


SIP()

IMPORT_C CSIP *SIP();

Description

Gets SIP server handle

Return value

CSIP *

handle to SIP server, or 0-pointer if SIP server does not exist any more


SIP()

IMPORT_C const CSIP *SIP() const;

Description

Gets SIP server handle

Return value

const CSIP *

handle to SIP server, or 0-pointer if SIP server does not exist any more


SetOptL()

Capability: Location
Capability: NetworkControl
Capability: NetworkServices
Capability: ReadDeviceData
Capability: WriteDeviceData

IMPORT_C void SetOptL(TUint aOptionName, TUint aOptionLevel, const TDesC8 &aOption=KNullDesC8);

Pre-Condition

State() == EActive

Description

Sets a RSocket option used for all the sockets used for sending SIP requests and responses in this CSIPConnection.

Parameters

TUint aOptionName

An integer constant which identifies an option.

TUint aOptionLevel

An integer constant which identifies level of an option.

const TDesC8 &aOption

Option value packaged in a descriptor.

Leave codes

A

system-wide error code


SetOptL()

Capability: Location
Capability: NetworkControl
Capability: NetworkServices
Capability: ReadDeviceData
Capability: WriteDeviceData

IMPORT_C void SetOptL(TUint aOptionName, TUint aOptionLevel, TInt aOption);

Pre-Condition

State() == EActive

Description

Sets a RSocket option used for all the sockets used for sending SIP requests and responses in this CSIPConnection.

Parameters

TUint aOptionName

An integer constant which identifies an option.

TUint aOptionLevel

An integer constant which identifies level of an option.

TInt aOption

Option value as an integer.

Leave codes

A

system-wide error codes


GetLocalAddrL()

IMPORT_C void GetLocalAddrL(TInetAddr &aAddr) const;

Pre-Condition

State() == CSIPConnection::EActive

Description

Gets the local IP address of this CSIPConnection that is used by the SIP implementation. The user should re-new the call whenever the connection state changes to the CSIPConnection::EActive in order to verify the correctness of the previously retrieved local IP address. The local IP address might be different as a result of the connection state change.

Parameters

TInetAddr &aAddr

on return filled with local IP address

Leave codes

a

system-wide error code

[Top]


Member enumerations


Enum TState

TState

Description

Connection states

EInit

Connection initializing

EActive

Connection active

ESuspended

Connection suspended

EInactive

Connection is inactive

EUnavailable

Connection is permanently unavailable