Welcome to liblinphone C# API reference documentation
Liblinphone is a high-level open source library that integrates all the SIP voice/video and instant messaging features into a single easy-to-use API. This is the VoIP SDK engine on which Linphone applications are based.
Liblinphone combines our media processing and streaming toolkit (Mediastreamer2) with our user-agent library for SIP signaling (belle-sip).
Liblinphone is distributed under GPLv3 (https://www.gnu.org/licenses/gpl-3.0.html). Please understand the licencing details before using it! For any use of this library beyond the rights granted to you by the GPLv3 license, please contact Belledonne Communications.
CSharp tutorial for liblinphone
You can find a step by step tutorial to use liblinphone in C# here
Other supported languages
Liblinphone has support for a variety of languages, each one has its own reference documentation:
- C (https://download.linphone.org/snapshots/docs/liblinphone/5.3/c)
- C++ (https://download.linphone.org/snapshots/docs/liblinphone/5.3/c++)
- Swift (https://download.linphone.org/snapshots/docs/liblinphone/5.3/swift)
- Java (https://download.linphone.org/snapshots/docs/liblinphone/5.3/java)
- C# (https://download.linphone.org/snapshots/docs/liblinphone/5.3/cs)
- Python (coming soon)
See also
Quick tour of liblinphone's features
Introduction
Liblinphone's has a consistent object-oriented design. Root objects must be constructed by the Factory class. No 'new' operator invocation is permitted. Liblinphone is using SIP as signaling protocol, which actually comprises a huge set of RFCs to cover various aspects of communications. Some terminology of the API is directly inherited from SIP specifications, that's why having some knowledge of the protocol is recommended for a better understanding of this documentation.
Initializing the engine
A typical liblinphone application has to first instanciate a Core object using the Factory. The core object represents the liblinphone engine, from which call, conferences, instant messages can be sent or received. For events to be reported and engine to schedule its tasks, the application must call Iterate() at regular interval, typically from a 20ms timer. In most case, a SIP account has to be provisionned so that SIP registration can take place onto a SIP server. This task is designated to the Account class. An Account can be created using CreateAccount(AccountParams), based on parameters created with CreateAccountParams(). Then, account can be added to the core for usage using AddAccount(Account). Application usually need to get informed of events occuring in the lifetime of the engine, which is done through listeners that the applications can override. An important listener interface is the CoreListener, that application should override and and create, and then assign into their Core object through Listener property.
Making calls
Applications can place outgoing calls using Invite(String) or InviteAddressWithParams(Address, CallParams). The CallParams class represents parameters for the calls, such as enabling video, requiring a specific MediaEncryption. The CallListener interface provides application way to get inform of the progress of the call, represented by the CallState enum. Incoming calls are notified through the CoreListener interface, and can later be accepted using Accept() . Calls can be terminated or aborted at any time using Terminate() .
Instant messaging
The ChatRoom class represents a text conversation. The Core object provides persistancy for all conversations, ie it stores all received and sent messages. The list of conversation can be retrieved using ChatRooms. To create a new conversation, use CreateChatRoom(ChatRoomParams, String, IEnumerable<Address>). ChatRoomParams provide a way to specify which kind of chatroom is to be created: for group, for one-ton-one conversation, with end-to end encryption for example. To send a message, first create the ChatMessage with CreateMessageFromUtf8(String), then send it with Send() . A ChatMessage reports its progress through the ChatMessageListener interface. ChatRooms are automatically created by the Core when receiving a message that starts a new conversation, and notified through the CoreListener interface.
Presence
Applications can submit presence information through the Core's PresenceModel property. The PresenceModel class represents the presence information, which is submitted to a presence server. Symmetrically, applications can subscribe to the presence server to get notified of the presence status of a contact list. This is to be done thanks to the FriendList and Friend classes.