Skip to content

3dprogramin/sipdotnet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  • SIP-proxy connection control:

    • Connect
    • Disconnect
    • Useragent and Version definition
  • Call / Register / Error events:

    • PhoneConnectedEvent
    • PhoneDisconnectedEvent
    • IncomingCallEvent
    • CallActiveEvent
    • CallCompletedEvent
    • ErrorEvent
  • Make / receive / terminate / record calls:

    • MakeCall
    • MakeCallAndRecord
    • ReceiveCall
    • ReceiveCallAndRecord
    • TerminateCall
    • TerminateAllCalls (what's different with this fork compared to original repo, thanks again bedefaced)
  • Utilities:

    • SendDTMFs (sending DTMF-tones)
    • SetIncomingRingSound and SetRingbackSound (sound that is heard when it's ringing to remote party)

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

  • .NET 4.0 framework on Windows or Linux (>= Mono 3.2.8)
  • last available (4.1.1) liblinphone library binaries installed

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)

About

.NET wrapper for liblinphone library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%