En tête technical corner
Liblinphone
Technical corner
Description
Liblinphone is a high-level library integrating all SIP calls and instant messaging features into a single easy-to-use API.
Two things are generally involved in telecommunications: media (transport of voice or video, encoding and decoding etc.), and signaling (routing calls, ringing, accepting a call etc.).
Liblinphone combines these two aspects together to do most of these things automatically. This makes it easier for the programmer to implement video calls and instant messaging in any application, without being an expert in VoIP and telecommunications. Liblinphone is an open source library that is based on Mediastreamer2 for voice/video streaming and belle-sip for SIP signaling.
The Liblinphone stack is suitable for building a VoLTE-compatible client, thanks to its interoperability with IMS networks and its available extension API.
- The Mediastreamer2 plugin API can be used to incorporate the EVS codec
- The low-level RTP transport API is suitable for interfacing with an API stack implementing RoHC (Robust Header Compression, RFC 3095)
Liblinphone in Linphone architecture
Linphone and linphonec are directly based on Liblinphone.
Liblinphone offers a consistent API for C, C#, C++, java and swift.
Signaling features
- SIP user agent that is compliant with RFC 3261
- SIP/UDP, SIP/TCP, SIP/TLS
- IPv6 dual stack or v6-only mode
- Secure user authentication: md5 / SHA256 digest, TLS client certificates
- Supports multiple calls simultaneously with call management features: call hold with music, resume, transfer etc.
- Multiple SIP proxy support: registrar, proxies, outbound proxies
- Presence using list subscription to a presence server
- DTMF (telephone tone) support using SIP INFO or RFC 4733
- Generic SUBSCRIBE/NOTIFY and PUBLISH
Media features
- Audio codecs: opus, speex, g711, g729, gsm, iLBC, AMR, AMR-WB, g722, SILK, iSAC, BV16, Codec2
- Video codecs: VP8, MPEG4, and hardware accelerated H.264 and H.265 codecs for macOS / iOS (VideoToolbox) and Android (MediaCodec) with resolutions up to 1080p.
- Audio conferencing
- Call recording (audio and video)
- Innovative RTP jitter buffer algorithm, which quickly adapts to network conditions with a lot of jitter and improves control of the audio latency
- Adaptive bit rate control algorithm: congestion control and estimation of available bandwidth, in order to optimise the quality of audio and video
- ICE (RFC 5245), STUN and TURN (RFC 5766) for optimised NAT traversal allowing peer-to-peer audio and video connections whenever possible
- SRTP, zRTP and SRTP-DTLS voice and video encryption
Instant Messaging features
- One-to-one and group text instant messaging. Liblinphone's group chat implementation is based on the SIP protocol, and uses signaling flows described in RCS specifications. We aim to converge to RCS compliance in future versions.
- End-to-end encryption with the implementation of the Double Ratchet Algorithm and Perfect Forward Secrecy
- "Is typing" and delivery notifications (undelivered, delivered, read, error)
- File sharing (images, videos, documents, vCards etc.)
Liblinphone leverages the Mediastreamer2 engine for rendering audio and video streams, and thus can take advantage of all the features implemented in Mediastreamer2.
For more information, see the complete list of media features in the Mediastreamer2 section.
Portability
Liblinphone is available on the following platforms:
- GNU/Linux: x86, x86-64, ARM v5, v7, arm64 ; Debian 8/9, Centos 7
- Windows Desktop: x86 (works also on x86_64) Windows 7 and later
- macOS: x86_64 ; 10.11 and later
- GNU/Linux embedded: Liblinphone is a good candidate to provide the software stack for a hardware phone or hardware communication system
- iOS 9 to 13 (ARM v7, ARM 64)
- Android 5.0 to 10 (ARM v7, ARM 64, x86, x86-64)
Implemented standards
REGISTRATION, CALLS, CORE FUNCTIONS
- Session Initiation Protocol, RFC 3261
- 8. General User Agent behaviour
- 9. Cancelling a request
- 10. Registrations
- 12. Dialogs
- 13. Initiating a session
- 14. Modifying an existing session
- 15. Terminating a session
- 17. Transactions
- 18. Transports
- 22.4 The Digest Authentication Scheme
- Session Initiation Protocol (SIP): Locating SIP Servers, RFC 3263
- Session Description Protocol, RFC 4566
- An Offer/Answer Model with the Session Description Protocol (SDP), RFC 3264
- An Extension to the Session Initiation Protocol (SIP), RFC 3581 (use of rport parameter)
- Session Initiation Protocol (SIP) INFO Method and Package Framework, RFC 6086
- 4. The INFO Method
- The Session Initiation Protocol (SIP) Refer Method, RFC 3515
- 2. The REFER Method
- Session Description Protocol (SDP) Security Descriptions for Media Streams, RFC 4568
- Negotiating Media Multiplexing Using the Session Description Protocol (SDP), draft-ietf-mmusic-sdp-bundle-negotiation-54
- Managing Client-Initiated Connections in the Session Initiation Protocol (+sip.instance parameter), RFC 5626
- Connection reuse in the Session Initiation Protocol (alias parameter), RFC 5923
- Correct Transaction Handling for 2xx Response to Session Initiation Protocol (SIP) INVITE Requests, RFC 6026
- A privacy mechanism for the Session Initiation Protocol, RFC 3323
- Private Extensions to the Session Initiation Protocol (SIP) for Asserted Identity within Trusted Networks, RFC 3325
- Interactive Connectivity Establishment (ICE), RFC 5245
- Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN), RFC 5766
- Session Traversal Utilities for NAT (STUN), RFC 5389
- Traversal Using Relays around NAT (TURN) Resolution Mechanism, RFC 5928
- Re-INVITE and Target-Refresh Request Handling, RFC 6141, chpt. 5 only
- Reliability of Provisional Responses in the Session Initiation Protocol (SIP), RFC 3262
- RTP Header Extension for the RTP Control Protocol (RTCP) Source Description Items, RFC 7941
- A General Mechanism for RTP Header Extensions, RFC 8285
PRESENCE
- A Presence Event Package for the Session Initiation Protocol (SIP), RFC 3856
- Session Initiation Protocol (SIP) Extension for Event State Publication, RFC 3903 (Creation of PUBLISH requests)
- A Data Model for Presence, RFC 4479
- RPID: Rich Presence Extensions to the Presence Information Data Format (PIDF), RFC 4480
- Subscriptions to Request-Contained Resource Lists in the Session Initiation Protocol (SIP), RFC 5367
- Session Initiation Protocol (SIP) - Specific Event Notification, RFC 6665
- Message Body Handling in the Session Initiation Protocol, RFC 5621
- SIP body compression, RFC 1951
ONE-TO-ONE & GROUP INSTANT MESSAGING
- Session Initiation Protocol, RFC 3261
- The Session Initiation Protocol (SIP) Refer Method, RFC 3515
- 2. The REFER Method
- Session Initiation Protocol (SIP) Extension for Instant Messaging, RFC 3428 (only text/plain messages)
- SIP Call Control - Conferencing for User Agents, RFC 4579
- Conference Establishment Using Request-Contained Lists in SIP, RFC 5366
- SIP Event Package for Conference State, RFC 4575
- Obtaining and Using Globally Routable User Agent URIs (GRUUs) in SIP, RFC 5627
- Subscriptions to Request-Contained Resource Lists in the Session Initiation Protocol (SIP), RFC 5367
- Session Initiation Protocol (SIP) - Specific Event Notification, RFC 6665
- Common Presence and Instant Messaging (CPIM): Message Format, RFC 3862
- Indication of message composition in instant messaging, RFC 3994
- Instant Message Disposition Notification, RFC 5438
- File transfer also possible via HTTP POST/GET - RCS vnd.gsma.rcs-ft-http+xml
- SIP body compression, RFC 1951
- Message Body Handling in the Session Initiation Protocol, RFC 5621
VCARD
License
Liblinphone is dual licensed, and can be licensed and distributed:
- Under a GNU GPLv3 license, for free (open source)
- Under a proprietary license, to be used in closed source applications. Contact Belledonne Communications for costs and other service information.
Binaries
Liblinphone Android version:
Read our wiki article to see how to import Liblinphone SDK using Maven.
Liblinphone IOS version:
Read our wiki article to see how to import Liblinphone SDK using Cocoapods.
Liblinphone win32 SDK version:
liblinphone-sdk-4.4.0-win32.zip
Liblinphone macOS SDK version:
Source code
The linphone-sdk project bundles Liblinphone and its dependencies as git submodules, in the purpose of simplifying the compilation and packaging of the whole Liblinphone suite, comprising Mediastreamer2, Belle-sip, Ortp and many others.
The submodules that are not developped or maintained by the Linphone team are grouped in the external/ directory.
The currently supported platforms are Android, iOS, Desktop (Linux, Windows, Mac OS X) and UWP (Universal Windows Platform).
You can find on GitLab the source code of linphone-sdk and of liblinphone, or you can clone it with Git.
It is still possible to compile the liblinphone project alone, but we recommend to compile linphone-sdk, as it is holding all the dependencies to build a full Linphone SDK.
Project | Git repository |
linphone-sdk, an umbrella project that contains liblinphone and all its dependencies | git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git --recursive |
The Liblinphone wiki is full of useful hints for start programming with Liblinphone, including:
- How to get started
- Technical articles about Liblinphone internals
- Information about the Liblinphone C# wrapper
- good practices for using SIP
API reference docs are provided for all supported programming languages:


Footer mentions
© Copyright 2020 - Linphone - Belledonne Communications SARL