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

ZDK's main entry point. More...

#include <IContext.h>

Inheritance diagram for ZDK::IContext:

Public Member Functions

virtual ZDK::Shared::Result InitDNS (void *jvm, void *connectivityManager)=0
 Initialize DNS when used on Android. More...
virtual ZDK::Shared::Result StartContext ()=0
 Initialize the ZDK. More...
virtual ZDK::Shared::Result StopContext ()=0
 Destroys the ZDK. More...
virtual ZDK::Shared::Result AddProtocol (ZDK::ProtocolType proto, int port)=0
 Creates a call manager instance for a protocol. More...
virtual bool ContextRunning () const =0
 Returnes whether the context is running and functional. More...
virtual ZDK::Shared::Result TestSIPURI (ZDK::Shared::String sipURI)=0
 Checks if a string is a SIP AoR or SIP Uri. More...
virtual void SetStatusListener (ZDK::Shared::ContextEventsHandler value)=0
 Configures the context event listener. More...
virtual ZDK::Shared::Result NetworkChanged ()=0
 Notify the ZDK for changed network event. More...
virtual ZDK::Shared::CallsProvider CallsProvider ()=0
 Gets the active calls information provider. More...
virtual ZDK::Shared::AccountProvider AccountProvider ()=0
 Gets the account information and control provider. More...
virtual ZDK::Shared::ConferenceProvider ConferenceProvider ()=0
 Gets the conference controlling helper. More...
virtual ZDK::Shared::DNSRequestProvider DNSRequestProvider ()=0
 Gets the DNS resolving requests provider. More...
virtual ZDK::Shared::ContextConfiguration Configuration ()=0
 Gets the general ZDK/Context configuration. More...
virtual ZDK::Shared::EncryptionConfiguration EncryptionConfiguration ()=0
 Gets the encription specific configuration. More...
virtual ZDK::Shared::AudioEndpointControl AudioControls ()=0
 Gets the audio endpoint's main entry point. More...
virtual ZDK::Shared::VideoEndpointControl VideoControls ()=0
 Gets the video endpoint's main entry point. More...
virtual ZDK::Shared::RingBackToneControl Ringback ()=0
 Ringback tone's main entry point. More...
virtual ZDK::Shared::Activation Activation ()=0
 Gets the ZDK's Activation process handler. More...
virtual ZDK::Shared::Log Logger ()=0
 Gets the ZDK's debug logging facility instance. More...
virtual ZDK::Shared::String LibraryVersion ()=0
 Get the ZDK version. 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

ZDK's main entry point.

Member Function Documentation

◆ AccountProvider()

virtual ZDK::Shared::AccountProvider ZDK::IContext::AccountProvider ( )
pure virtual

Gets the account information and control provider.

Manages creation and destruction of user accounts and provides information regarding them.

The account provider
See also

◆ Activation()

virtual ZDK::Shared::Activation ZDK::IContext::Activation ( )
pure virtual

Gets the ZDK's Activation process handler.

The activation handler
See also

◆ AddProtocol()

virtual ZDK::Shared::Result ZDK::IContext::AddProtocol ( ZDK::ProtocolType  proto,
int  port 
pure virtual

Creates a call manager instance for a protocol.

Creates a call manager instance for a specific protocol.

Protocol MUST be added before creating accounts using it!

Will be automatically destroyed by StopContext().

Some call managers are automatically created by StartContext(). SIP cannot be created by this function.

[in]portPort at which to bind the main socket
Result of the addition
See also
ProtocolType, IResult

◆ AudioControls()

virtual ZDK::Shared::AudioEndpointControl ZDK::IContext::AudioControls ( )
pure virtual

Gets the audio endpoint's main entry point.

Entry point for controlling the audio endpoint

The audio endpoint control
See also

◆ CallsProvider()

virtual ZDK::Shared::CallsProvider ZDK::IContext::CallsProvider ( )
pure virtual

Gets the active calls information provider.

The calls provider
See also

◆ ConferenceProvider()

virtual ZDK::Shared::ConferenceProvider ZDK::IContext::ConferenceProvider ( )
pure virtual

Gets the conference controlling helper.

The conference provider
See also

◆ Configuration()

virtual ZDK::Shared::ContextConfiguration ZDK::IContext::Configuration ( )
pure virtual

Gets the general ZDK/Context configuration.

The configuration is applied with StartContext()! Any changes after StartContext() has been invoked will not take effect until a restart happens - StopContext() followed by StartContext().

The context configuration
See also

◆ ContextRunning()

virtual bool ZDK::IContext::ContextRunning ( ) const
pure virtual

Returnes whether the context is running and functional.

Context's running state

◆ DNSRequestProvider()

virtual ZDK::Shared::DNSRequestProvider ZDK::IContext::DNSRequestProvider ( )
pure virtual

Gets the DNS resolving requests provider.

The DNS resolving requests provider
See also

◆ EncryptionConfiguration()

virtual ZDK::Shared::EncryptionConfiguration ZDK::IContext::EncryptionConfiguration ( )
pure virtual

Gets the encription specific configuration.

The encription configuration
See also

◆ InitDNS()

virtual ZDK::Shared::Result ZDK::IContext::InitDNS ( void *  jvm,
void *  connectivityManager 
pure virtual

Initialize DNS when used on Android.

Automatically invoked from the zdk.jni! MUST be called before StartContext()!

Performs initializations internally required by the c-ares library when used on Android.

As of Android 8 (API level 26) getting DNS server information has become more restrictive and can only be accessed using the Connectivity Manager. It is necessary to pass the connectivity manager to c-ares via JNI. Also, the ACCESS_NETWORK_STATE permission must be present in the Android application.

Android older than 8 do not need to to be initalized as they are less restrictive. However, this is a run time not compile time limitation. Proper Android initalization should take place regardless of the targeted Android version.

Deinitalization will take place internally.

[in]jvmPointer to the JVM
[in]connectivityManagerPointer to Java object of type ConnectivityManager

◆ LibraryVersion()

virtual ZDK::Shared::String ZDK::IContext::LibraryVersion ( )
pure virtual

Get the ZDK version.

Get the revision of the ZDK's source last commit.

The revision as an ASCII string. The string resides in the ZDK's memory and should not be modified.

◆ Logger()

virtual ZDK::Shared::Log ZDK::IContext::Logger ( )
pure virtual

Gets the ZDK's debug logging facility instance.

Only a single instance of the debug logging facility is created and returned during the life time of the library.

The ZDK's debug logging facility instance
See also

◆ NetworkChanged()

virtual ZDK::Shared::Result ZDK::IContext::NetworkChanged ( )
pure virtual

Notify the ZDK for changed network event.

Handles the network change event - resets the DNS, re-register users, refreshes active calls, etc.

Each invocation restarts a timer delaying the execution of the handling with 500ms from the last received event - if invoked more then once in the delay period, the handling will happen 500ms after the last call.

Result of the invocation
See also

◆ Ringback()

virtual ZDK::Shared::RingBackToneControl ZDK::IContext::Ringback ( )
pure virtual

Ringback tone's main entry point.

Entry point for controlling the ringback tone heard by the user when the remote peer starts ringing

The ringback tone control
See also

◆ SetStatusListener()

virtual void ZDK::IContext::SetStatusListener ( ZDK::Shared::ContextEventsHandler  value)
pure virtual

Configures the context event listener.

The set listener will be notified for each event.

[in]valueThe context event listener to be added
See also

◆ StartContext()

virtual ZDK::Shared::Result ZDK::IContext::StartContext ( )
pure virtual

Initialize the ZDK.

Create all internal structures, protocol stacks, network transports and event queues. It will test the available audio devices. It will spawn necessary processing threads. You must call StopContext() to close the network transports, stop all threads and free all structures.

Do not call this function more than once in a row - use StopContext() to clean up and then you can call StartContext() again.

Result of the initialization
See also
StopContext(), IResult

◆ StopContext()

virtual ZDK::Shared::Result ZDK::IContext::StopContext ( )
pure virtual

Destroys the ZDK.

Closes network transports, terminates worker threads and frees all structures. You can call StartContext() after this to re-open the library.

This is a blocking call and will always take some time to finish but has a hard-limit of 2 seconds for IAX and 4 seconds for SIP which in the worst case means 6-7 seconds with some additional time for thread synchronisation.

Result of the initialization
See also
StartContext(), IResult

◆ TestSIPURI()

virtual ZDK::Shared::Result ZDK::IContext::TestSIPURI ( ZDK::Shared::String  sipURI)
pure virtual

Checks if a string is a SIP AoR or SIP Uri.

Processes the string as a dial target to check if it is a valid SIP Uri or a valid SIP Address of Record or a tel uri.

SIP Uri: sip:user[:password][:port][;params] SIP AoR: "Display Name" <sip:user[:password][:port][;params]>;[aor-params] tel uri: tel:phonenumber[;params]

[in]pSipUriUTF-8 encoded to parse
Result of the test
See also

◆ VideoControls()

virtual ZDK::Shared::VideoEndpointControl ZDK::IContext::VideoControls ( )
pure virtual

Gets the video endpoint's main entry point.

Entry point for controlling the video endpoint

The video endpoint control
See also

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