Overview
Siprix VoIP SDK is a software component designed for integration into client applications. It is a library providing a C API, distributed in the form of binary artefacts for the various platforms. Siprix implements SIP client functionality. It uses SIP as signalling protocol and RTP for exchanging audio and video media with SIP Servers (PBXs). It can capture and send audio from system’s microphone devices, capture and send video from cameras or image files, playback received audio/video.
General Concepts
Library is designed to be abstract and not depend on the other system components. It provides only dialing functionality without any UI, which allows to integrate it into various applications and implement own business logic above it.
Threading
Library is written on C++ and is thread safe. It allows to invoke API methods from any thread and doesn’t run them synchronously, methods just verify input arguments and post actual handling to the internal worker thread.
Library raises events to the app from the separate callback thread. It’s secure to invoke methods in the callback(event) handlers.
Attention
App should take into account that modify UI allowed only from UI thread and event handler should be post to UI thread using one of: BeginInvoke, DispatchQueue.main.async, etc.
Error Handling
As stated above, API methods synchronously verifying input parameters and does internal state
allow to invoke current method. If some condition match method returns ErrorCode and breaks handling.
If everything is good method returns success code and continues handling in the worker thread.
If something went wrong in the worker thread library will generate event/callback with details.
App can use method GetErrorText() to get readable error text.
Objects Persistence
Library doesn’t make any internal serialization. Each time when app creates new library’s instance it starts from default state.
This approach allows to avoid unwanted cases like:
Account was registered in previous session, but shouldn’t register in the new session (or wise versa);
Account’s password stored in readable format;
Library writes some data to inappropriate place;
Etc.
Application should add own implementation which completely controls when/what/where to write/read.
Multiple Instances
Application can create only one instance of library.
Client-Server approach
Library implements SIP client functionality and it requires communication with remote side (same client or SIP PBX). When application invokes some method it can’t expect immediate result, as typically it requires to send some request, receive response or timeout and only after that report new state.
- As example:
When user wants to end call application should:
Invoke
Call_Bye()Display some intermediate state
When library raised
ISiprixEventHandler::OnCallTerminated()event - switch UI.
Handling strings
Library handles strings as zero terminated utf-8 encoded sequence of characters.
Diagnostics and home folder
Library has ability to write log files and also display diagnose output directly to IDE. Log files split by chunks with size 5MB and only last 3 files stored. It prevents flood users computer/device with logs.
Application can set level of the Logs/IDE output details using methods:
Ini_SetLogLevelFile(), Ini_SetLogLevelIde()
Library writes log file to the Home folder, specified by the application or created automatically on initialization stage.
Platform |
Path |
|---|---|
Windows |
C:\users\<user>\Application Data\`<name>` |
Android: |
/storage/emulated/0/Android/data/<PackageName>/files |
Linux: |
~/.local/share/<name> |
MacOS: |
~/Library/Application Support/<name> |
iOS: |
~/Library/Application Support/<name> |
Application can set own folder name or whole path using method: Ini_SetHomeFolder().
Default value of the <name> is `siprix`.
DataSheet
Supported Platforms:
Android (arm64-v8a, armeabi-v7a, x86_64, x86)
iOS (x64, arm64)
Windows (x64)
MacOS (x64, arm64)
Linux (x64)
Supported codecs
Audio
OPUS
PCMU
PCMA
G722
G729
ILBC
ISAC
DTMF (telephone-event)
Video
H264
VP8
VP9
AV1
Call features
Multiple simultaneous calls
Make and receive Video calls
Multi-party voice conference
Call transfer (Attended and Blind)
Call forward
Hold
Mute
- Subscription
Subscribe and receive updates with presence/BLF state of remote extensions
SIP Methods:
REGISTER
INVITE
ACK
CANCEL
OPTIONS
BYE
SUBSCRIBE
NOTIFY
REFER
INFO
MESSAGE
Supported protocols:
UDP
TCP
TLS
SIP
SDP
RTP
SRTP
STUN
TURN
ICE
Security
Secure signalling using SIP over TLS
Secure media using DTLS/SDES SRTP