# Mobile SDK Operation Scheme
TrueConf Server is implemented as a class that provides access to the main functions and a mechanism for subscribing to events. The core functionality for iOS and Android is unified; however, there are some differences. You will learn more about this later.
General operation algorithm:
There are a video conferencing server and a client application (terminal).
To conduct a video communication session, a user must be assigned to the terminal, performing all operations on their behalf. Guest connections are available.
A communication session between two endpoints (terminals) is initiated at the request of one of the participants.
For conferences with multiple participants, a separate conference object with its own identifier and lifespan is created on the server (the current version of the SDK does not support this functionality, only connection to an already created group conference is possible). The terminal must either call into such a conference itself or be added to the participant list before it begins.
# Connecting to the server
The terminal, when there is a network connection on the device, attempts to connect to the video conferencing server. Once the connection is established, it remains active for the entire duration of the system's operation. In the event of a disconnection, the system automatically attempts to reconnect. If reconnection is not successful within the set period, the application is notified, and attempts to re-establish the connection continue with reduced intensity.
# Authorization
The terminal must be authorized on the server using a unique user identifier (TrueConf ID) and password. If TrueConf Server has guest licenses available, temporary users with one-time passwords (guests) can be generated.
A single identifier can only be authorized on one terminal, meaning that unlike regular client applications, TrueConf SDK does not support multiple logins. When logging in on another terminal, the previously authorized terminal will be automatically disconnected.
A user is considered authorized on a specific terminal and available for calls as long as the terminal maintains a connection with the server. If the connection is lost, the terminal will attempt to automatically reconnect, and if it fails within a specified time, it is considered offline. Depending on the terminal's settings (auto-login option enabled), upon client restart or connection restoration, it may attempt to authorize using the last used identifier.
In addition to TrueConf ID (login), a display name is used, which appears on interface elements. In some cases, it may be absent, and TrueConf ID will be used instead.
# Conference
The session starts at the initiative of one of the users. For this to happen, the user's application must be connected to the server, and the user must be authorized on it (see general workflow). When a call is made, the terminal enters a waiting mode, which will end either with the start of the conference or with a notification that it cannot be started.
In the first stage, the server verifies that the called party exists and is "online." After this, a request is sent to the called party. It can either be accepted or rejected. If there is no response within a certain period of time, the request is automatically considered rejected. If a positive response is received, the calling party is informed, and the connection between the two participants is established through the server. If both conference participants are in direct view of each other in terms of network topology, a direct connection may be established, bypassing the server.
The session can be terminated either by command from one of the parties or if the broken connection cannot be restored within a specified time.
The conference widget's user interface is embedded in the SDK and cannot be modified except for branding interface elements and manually configuring the video layout. Outside of a conference, the interface and behavior are determined by the application using it.
# Video and audio transmission
When connecting to a session, the quality and delay of transmitted video and audio data are determined by the condition of the channel and the performance of the terminals. This is how the SVC technology works, used in the TrueConf video conferencing system. It adapts according to the channel conditions and changes dynamically during the session. There are global maximum stream limitations depending on the type of network connection used (3G, Wi-Fi, wired) and maximum stream limitations set on the server side. When these are present, the option with the minimum bitrate is selected. Bitrate limitation on the terminal side is not supported in the current version of the SDK.
During a session, you can switch between cameras and speakers/headsets. If the channel quality falls below the threshold, it is possible to forcefully disable video sending and receiving, prioritizing the audio stream.
# Additional Service Features
The video conferencing server monitors the status of authorized users and can automatically notify other terminals of any changes (using the onUserStatusUpdate event). Status notifications are based on subscriptions. These can be set up on the server by editing users' address books, or on the terminal by requesting the status of a specific user during a single authorization session.
# Application States with SDK
Operations that lead to changes in terminal mode can take a long time and may be interrupted at any moment (for instance, if the network connection is lost). Therefore, the SDK operates with clearly defined terminal states and transitions between them. The main operations are state change commands and events that report an actual state change or an error that occurred. The state changes are illustrated in the diagram below:
# User statuses
The status of other subscribers, received when subscribing to status changes, differs slightly from the terminal statuses. The correspondence table is provided below.
Terminal Status | User Status | Notes |
---|---|---|
Undefined | Technical status, indicates that status information has not yet been received | |
Unknown | A subscriber with such TrueConf ID does not exist or their status cannot be retrieved | |
Disconnected | Offline | |
Connected | Offline | |
Logged In | Online | The subscriber is registered on the network and can receive incoming calls |
In conference | Busy | The subscriber is in a conference and can receive special requests, but a point-to-point call is not possible |
# Guest users
You can join public conferences (webinars) as a guest. To do this, generate guest login credentials by following these instructions:
LOGIN
— *guest2*EXTID*DISPLAYNAME
Where:
EXTID
—External ID
(any text)DISPLAYNAME
— the display name for a guest. It can be empty. Must be in UTF8.
PASSWORD
— $2RAND*TIMESTAMP*SIGN
Where:
RAND
— any string without the*
characterTIMESTAMP
— the expiration time of the password in UTC (GMT) in seconds since January 1, 1970 (integer)SIGN = md5(RAND + EXTID + TIMESTAMP + SECRET)
, whereSECRET
is the Guest connections authentication key parameter of your server from the Settings section:
If the login begins with guest2
, the system expects the password in a specific format. If the password is correct and the TIMESTAMP
is not older than the server time, then upon joining the conference, the guest will have a Call ID of #guest2:EXTID@server.name
.
The ability to join public conferences as a guest and the total number of such available connections depend on the license for your TrueConf Server.