bedefaced / sipdotnet

.NET wrapper for liblinphone library
GNU Lesser General Public License v3.0
51 stars 28 forks source link

sipdotnet

Small .NET wrapper for liblinphone library. You can use it for simple interface for SIP telephony.

Using

You can access to wrapped liblinphone actions and events by Phone class. Only that you need is the SIP account (Account class).

For using library from .NET code you need to copy linphone dlls (liblinphone and dependencies) to directory with your EXE file (or use, for example, Add item dialog in Visual Studio (and select Copy to Output: Copy if newer or Copy always in Properties window of added dlls)) and then add sipdotnet.dll (or the whole project) as dependency to your solution.

Current available functionality:

Example

Account account = new Account ("username", "password", "server");
Phone phone = new Phone (account);
phone.PhoneConnectedEvent += delegate() {
    Console.WriteLine("Phone connected. Calling...");
    phone.MakeCallAndRecord("phonenumber", "/tmp/filename.wav");
};
phone.CallActiveEvent += delegate(Call call) {
    Console.WriteLine("Answered. Call is active!");
};
phone.CallCompletedEvent += delegate(Call call) {
    Console.WriteLine("Completed.");
};
phone.Connect (); // connecting
Console.ReadLine ();
Console.WriteLine("Disconnecting...");
phone.Disconnect (); // terminate all calls and disconnect

Requirements

Liblinphone on Windows

Due to backwardness of SDK binaries version it's recommended to use dlls from Linphone desktop build. You can use my zipped collection in lib directory or collect necessary dlls yourself using such tools as Dependency Walker against 'linphone.dll'.

Liblinphone on Linux

1) Install Mono 2) Build manually from sources, or use my bash script for Ubuntu 16.04.

License

LGPLv3 (see LICENSE file)