ZDK
Public Member Functions | List of all members
ZDK::IAccount Class Referenceabstract

The main account class. More...

#include <IAccount.h>

Inheritance diagram for ZDK::IAccount:
ZDK::IZHandle

Public Member Functions

virtual ZDK::ZDKHandle UserHandle () const =0
 Gets the underlying user handler ID. More...
 
virtual void Configuration (ZDK::Shared::AccountConfig value)=0
 Sets the account configuration. More...
 
virtual ZDK::Shared::AccountConfig Configuration () const =0
 Gets a COPY of the account configuration. More...
 
virtual ZDK::Shared::Result RegisterAccount ()=0
 Registers the user to the configured service. More...
 
virtual ZDK::Shared::Result UnRegister ()=0
 Cancels registration and/or unregisters the user. More...
 
virtual ZDK::Shared::Result CreateUser ()=0
 Creates a new user account. More...
 
virtual ZDK::Shared::Result RemoveUser ()=0
 Destroys an user account object. More...
 
virtual ZDK::ZDKHandle AccountID () const =0
 Gets the ID of the account. More...
 
virtual ZDK::Shared::String AccountName () const =0
 Gets the account name. More...
 
virtual void AccountName (ZDK::Shared::String value)=0
 Configures the account name. More...
 
virtual ZDK::AccountStatus RegistrationStatus () const =0
 Gets the current account registration status. More...
 
virtual void ClearMediaCodecs ()=0
 Clears the account's codec list. More...
 
virtual ZDK::Shared::ItemList< ZDK::AudioVideoCodecs > MediaCodecs () const =0
 Gets the account's codecs allowed to be used. More...
 
virtual void MediaCodecs (ZDK::Shared::ItemList< ZDK::AudioVideoCodecs > value)=0
 Configures the account's codecs allowed to be used. More...
 
virtual void SetStatusEventListener (ZDK::Shared::AccountEventsHandler value)=0
 Adds a new account event listener. More...
 
virtual void DropStatusEventListener (ZDK::Shared::AccountEventsHandler value)=0
 Removes a specific already added account event listener. More...
 
virtual ZDK::Shared::Call CreateCall (ZDK::Shared::String calleeNumber, bool handlingVoipPhoneCallEvents, bool video)=0
 Creates and starts an outgoing call. More...
 
virtual ZDK::Shared::ItemList< ZDK::Shared::Call > GetActiveCalls () const =0
 Gets a list with all account's active/ongoing calls. More...
 
virtual ZDK::Shared::Message CreateMessage (ZDK::MessageType type)=0
 Creates a new EMPTY chat message with the given type. More...
 
virtual ZDK::Shared::Result ChatSessionEnd (ZDK::Shared::String pPeer)=0
 End a chat session. More...
 
virtual ZDK::Shared::Result SetPresenceStatus (ZDK::ContactStateType status, ZDK::Shared::String message)=0
 Start a presence publication for the user. More...
 
virtual ZDK::Shared::Result StartPush (bool shouldReregister, bool enableRtpMediaProxy)=0
 
virtual ZDK::Shared::Result StopPushAndUnregister (bool shouldRegister)=0
 
virtual ZDK::Shared::Result RelinquishCallOwnership (ZDK::Shared::Call call)=0
 
virtual void UpdatePushURI (ZDK::Shared::String newPushURI)=0
 WILL BE MOVED IN IPushConfig!
 
virtual void UpdatePushToken (ZDK::Shared::String newPushToken)=0
 WILL BE MOVED IN IPushConfig!
 
virtual void UpdatePushType (ZDK::Shared::String newPushType)=0
 WILL BE MOVED IN IPushConfig!
 
virtual ZDK::Shared::String PushURI () const =0
 WILL BE MOVED IN IPushConfig!
 
virtual void PushURI (ZDK::Shared::String value)=0
 WILL BE MOVED IN IPushConfig!
 
virtual ZDK::Shared::FileTransfer InitiateFileTransfer ()=0
 Initiates a new file transfer. More...
 
virtual ZDK::Shared::String GenerateUUID (bool noPrefix, int bufLen)=0
 Generate a random UUID. More...
 
virtual ZDK::Shared::Result ReplaceUserRegistration ()=0
 Replace user registration. More...
 
virtual int ActualRegistrationExpiry ()=0
 Get the user registration expiry time. More...
 
virtual void SetProbeEventListener (ZDK::Shared::SIPProbeEventsHandler value)=0
 Adds a new SIP probe event listener. More...
 
virtual void DropProbeEventListener (ZDK::Shared::SIPProbeEventsHandler value)=0
 Removes a specific already added SIP probe event listener. More...
 
virtual ZDK::Shared::Result ProbeSipTransport (ZDK::Shared::String domain, ZDK::Shared::String outboundProxy, ZDK::Shared::String username, ZDK::Shared::String authUsername, ZDK::Shared::String password)=0
 Probes for available transports for the given SIP settings. More...
 
virtual ZDK::Shared::Result TerminateConnection ()=0
 Terminates user's TCP-based connection. More...
 
- Public Member Functions inherited from ZDK::IZHandle
virtual ZDK::ZDKHandle Handle () const =0
 
virtual operator ZDK::ZDKHandle () const =0
 
virtual void Initialize ()=0
 
virtual void ReleaseReference ()=0
 

Detailed Description

The main account class.

Member Function Documentation

◆ AccountID()

virtual ZDK::ZDKHandle ZDK::IAccount::AccountID ( ) const
pure virtual

Gets the ID of the account.

Returns
The account's ID

◆ AccountName() [1/2]

virtual ZDK::Shared::String ZDK::IAccount::AccountName ( ) const
pure virtual

Gets the account name.

Returns
The account's name

◆ AccountName() [2/2]

virtual void ZDK::IAccount::AccountName ( ZDK::Shared::String  value)
pure virtual

Configures the account name.

Parameters
[in]valueThe account's name

◆ ActualRegistrationExpiry()

virtual int ZDK::IAccount::ActualRegistrationExpiry ( )
pure virtual

Get the user registration expiry time.

The actual registration validity period returned by the registrar. The stack will not wait for the full period to refresh the registration. It will try to refresh it after 90% of the negotiated time has elapsed.

Returns
  • 0 - Account is not registered
  • greater than 0 - The registration expiry period in seconds

◆ ChatSessionEnd()

virtual ZDK::Shared::Result ZDK::IAccount::ChatSessionEnd ( ZDK::Shared::String  pPeer)
pure virtual

End a chat session.

NOT IMPLEMENTED!

Returns
Result of the ending
See also
IResult

◆ ClearMediaCodecs()

virtual void ZDK::IAccount::ClearMediaCodecs ( )
pure virtual

Clears the account's codec list.

Equivalent to providing an empty list to MediaCodecs().

See also
AudioVideoCodecs, MediaCodecs()

◆ Configuration() [1/2]

virtual void ZDK::IAccount::Configuration ( ZDK::Shared::AccountConfig  value)
pure virtual

Sets the account configuration.

All changes checks and actions are taken automatically - e.g. reregister the account

Parameters
[in]valueThe account configuration
See also
AccountConfig

◆ Configuration() [2/2]

virtual ZDK::Shared::AccountConfig ZDK::IAccount::Configuration ( ) const
pure virtual

Gets a COPY of the account configuration.

Changes in the returned configuration are not handled!

Returns
A copy of the account configuration
See also
AccountConfig

◆ CreateCall()

virtual ZDK::Shared::Call ZDK::IAccount::CreateCall ( ZDK::Shared::String  calleeNumber,
bool  handlingVoipPhoneCallEvents,
bool  video 
)
pure virtual

Creates and starts an outgoing call.

Creates a call originating from the specified user and starts it. If there is no error the function will return immediately. Updates on the call status will come via callbacks.

Parameters
[in]calleeNumberThe number/user to call. The actual address is created from this ID and the account's configued domain.
[in]handlingVoipPhoneCallEventsIndicator whether to handle/receive call specific events
[in]videoIndicator whether to initiate a video call, if supported
Returns
The newly created call
See also
ICall, ICallEventsHandler, IVideoEventsHandler

◆ CreateMessage()

virtual ZDK::Shared::Message ZDK::IAccount::CreateMessage ( ZDK::MessageType  type)
pure virtual

Creates a new EMPTY chat message with the given type.

Creates and returns a new empty chat message from the given type that has to be filled in and then sent!

Returns
The newly created empty message
See also
IMessage, MessageType

◆ CreateUser()

virtual ZDK::Shared::Result ZDK::IAccount::CreateUser ( )
pure virtual

Creates a new user account.

Creates a new protocol user, based on the assigned configuration, that can be used to register on a server for incoming calls, create outgoing calls, subscribe for presence, etc. This is a mandatory operation before using most of the ZDK's functions.

Returns
Result of the creation
See also
IResult, Configuration(), RemoveUser()

◆ DropProbeEventListener()

virtual void ZDK::IAccount::DropProbeEventListener ( ZDK::Shared::SIPProbeEventsHandler  value)
pure virtual

Removes a specific already added SIP probe event listener.

All added/left listeners will be notified for each event.

Parameters
[in]valueThe SIP probe event listener to be removed
See also
ISIPProbeEventsHandler, SetProbeEventListener()

◆ DropStatusEventListener()

virtual void ZDK::IAccount::DropStatusEventListener ( ZDK::Shared::AccountEventsHandler  value)
pure virtual

Removes a specific already added account event listener.

All added/left listeners will be notified for each event.

Parameters
[in]valueThe account event listener to be removed
See also
IAccountEventsHandler, SetStatusEventListener()

◆ GenerateUUID()

virtual ZDK::Shared::String ZDK::IAccount::GenerateUUID ( bool  noPrefix,
int  bufLen 
)
pure virtual

Generate a random UUID.

Generates a valid RFC 4122 (RFC 2141) UUID URN that can be used for RFC 5626 (SIP Outbound).

The result is a string in the format

"urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

or the format

"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

depending on the "noPrefix" parameter. The prefix is there for easier use of ISIPConfig's SipInstance().

In case the "urn:uuid:" prefix is not desired, put 1 to the "noPrefix" parameter. The resulting string will be shorter and will contain only the random part.

If "noPrefix" is set to 0, the resulting string can be given directly to ISIPConfig's SipInstance().

Parameters
[in]noPrefixSet to 0 for full URN, 1 for a UUID without prefix
[in]bufLenAvailable bytes in the buffer (64 bytes or more are sufficient)
Returns
The generated UUID string

◆ GetActiveCalls()

virtual ZDK::Shared::ItemList<ZDK::Shared::Call> ZDK::IAccount::GetActiveCalls ( ) const
pure virtual

Gets a list with all account's active/ongoing calls.

Returns
The list with all account's active/ongoing calls
See also
ICall

◆ InitiateFileTransfer()

virtual ZDK::Shared::FileTransfer ZDK::IAccount::InitiateFileTransfer ( )
pure virtual

Initiates a new file transfer.

NOT IMPLEMENTED!

◆ MediaCodecs() [1/2]

virtual ZDK::Shared::ItemList<ZDK::AudioVideoCodecs> ZDK::IAccount::MediaCodecs ( ) const
pure virtual

Gets the account's codecs allowed to be used.

The order in which codecs are added is important. The codecs that are first in the list have greater priority. To reorder the list re-add the codecs with the proper order.

Returns
The full list with codecs to be used
See also
AudioVideoCodecs

◆ MediaCodecs() [2/2]

virtual void ZDK::IAccount::MediaCodecs ( ZDK::Shared::ItemList< ZDK::AudioVideoCodecs >  value)
pure virtual

Configures the account's codecs allowed to be used.

The order in which codecs are added is important. The codecs that are first in the list have greater priority. To reorder the list re-add the codecs with the proper order.

Parameters
[in]valueThe full list with codecs to be used
See also
AudioVideoCodecs

◆ ProbeSipTransport()

virtual ZDK::Shared::Result ZDK::IAccount::ProbeSipTransport ( ZDK::Shared::String  domain,
ZDK::Shared::String  outboundProxy,
ZDK::Shared::String  username,
ZDK::Shared::String  authUsername,
ZDK::Shared::String  password 
)
pure virtual

Probes for available transports for the given SIP settings.

Probes consecutively for transport availability over SIP with the given account settings.

The tests are done via SIP REGISTER requests with the given settings. The actual account's configuration will be used for this. No user-specific callbacks will be fired for this process.

This might be useful during the creation/configuration of the user account in order to notify the user for the supported transports and/or misconfiguration of either server or credentials.

During the TLS checks a Certificate-related callback can be fired which will usually result in TLS being rejected as a viable transport and the probing will continue with TCP.

If the TLS settings are changed the probing can be restarted.

The profile generated for the TLS test will benefit from any certificates that were added for a SIP user with the same configuration.

STUN and rport will not be used or tested. This may cause the probing to fail because of NAT issues.

The transports are checked in this order:

  1. TLS
  2. TCP
  3. UDP

Each test will generate an informative callback. The process will be considered successful after the first successful REGISTER. The newly created binding on the server will be removed (the temporary profile will be unregistered).

Parameters
[in]domainDomain (SIP user creation: realm entry)
[in]outboundProxyOutbound proxy (SIP user creation: server entry)
[in]usernameUsername
[in]authUsernameAuthentication username
[in]passwordAuthentication password
Returns
Result of the invocation
See also
ISIPProbeEventsHandler, IResult

◆ RegisterAccount()

virtual ZDK::Shared::Result ZDK::IAccount::RegisterAccount ( )
pure virtual

Registers the user to the configured service.

Starts the user's registration process. If the registration process was started the function returns Ok. The result of the process will be delivered by a callback.

Returns
Result of the invocation
See also
IAccountEventsHandler(), IResult

◆ RegistrationStatus()

virtual ZDK::AccountStatus ZDK::IAccount::RegistrationStatus ( ) const
pure virtual

Gets the current account registration status.

Returns
The account's registration status
See also
IAccountStatus

◆ RemoveUser()

virtual ZDK::Shared::Result ZDK::IAccount::RemoveUser ( )
pure virtual

Destroys an user account object.

Destroys an user account object and all related structures. Automatically unregisters the account from the server.

Fails if the user has active calls.

Returns
Result of the removal
See also
IResult, CreateUser()

◆ ReplaceUserRegistration()

virtual ZDK::Shared::Result ZDK::IAccount::ReplaceUserRegistration ( )
pure virtual

Replace user registration.

For protocols such as IAX2 there is no "binding" and this operation does not apply. For those types of protocols the function will internally call RegisterUser() and then return its status.

This function will first try to cleanly remove any active bindings on the registrar server that were put by this instance of the library.

Then it will try to create a new registration binding on the server.

This is mostly useful when switching network types and an IP address change has been detected. This function will try to remove the old (stale) binding that is currently active on the server and replace it with a "fresh" one done from the new IP address.

!NOTE! Network changed handling MUST be done with IContext's NetworkChanged()!

A better approach might be to use SIP Outbound (RFC 5626) but that requires server support.

Returns
Result of the invocation
See also
IResult, RegisterAccount(), UnRegister()

◆ SetPresenceStatus()

virtual ZDK::Shared::Result ZDK::IAccount::SetPresenceStatus ( ZDK::ContactStateType  status,
ZDK::Shared::String  message 
)
pure virtual

Start a presence publication for the user.

Use this function to publish the user's status on the server (if the server supports it). Use this function again at any time to change the account's status.

Parameters
[in]statusStatus of the user
[in]messageIf not NULLor empty, this will be published in the PIDF
Returns
Result of the set
See also
IResult

◆ SetProbeEventListener()

virtual void ZDK::IAccount::SetProbeEventListener ( ZDK::Shared::SIPProbeEventsHandler  value)
pure virtual

Adds a new SIP probe event listener.

All added listeners will be notified for each event.

Parameters
[in]valueThe SIP probe event listener to be added
See also
ISIPProbeEventsHandler, DropProbeEventListener()

◆ SetStatusEventListener()

virtual void ZDK::IAccount::SetStatusEventListener ( ZDK::Shared::AccountEventsHandler  value)
pure virtual

Adds a new account event listener.

All added listeners will be notified for each event.

Parameters
[in]valueThe account event listener to be added
See also
IAccountEventsHandler, DropStatusEventListener()

◆ TerminateConnection()

virtual ZDK::Shared::Result ZDK::IAccount::TerminateConnection ( )
pure virtual

Terminates user's TCP-based connection.

Destroys the currently used TCP-based connection. That triggers re-registration of EVERY already registered user using this socket/connection.

Very handy when PUSH is used for example, where it is nearly certain the connection is stale/half-opened.

Returns
Result of the invocation - ResultCode::InvalidArgument error in cases where the given connection is not TCP-based!

◆ UnRegister()

virtual ZDK::Shared::Result ZDK::IAccount::UnRegister ( )
pure virtual

Cancels registration and/or unregisters the user.

If the user account is in the process of registration this function will cancel it. If the user was already registered an unregistration process will start. If there is no error the function will return immediately and the final result will be delivered via a callback.

Returns
Result of the invocation
See also
IAccountEventsHandler(), IResult

◆ UserHandle()

virtual ZDK::ZDKHandle ZDK::IAccount::UserHandle ( ) const
pure virtual

Gets the underlying user handler ID.

Internally assigned on successful CreateUser() invocation and invalidated on RemoveUser().

Returns
The underlying user handler ID

The documentation for this class was generated from the following file: