How to make conference call?
Download: | conference-call.zip |
This article is about to introduce how to create a softphone which is able to handle multiple incoming calls, and connect them together. To fully understand this guide, you might need to study the How to accept incoming call article first.
What is client mixed conference call?
Conference calling is a basic requirement for VoIP systems. This is because the spread of voice over IP technology increased the wish for digitizing more advanced communication forms like lectures or conferences.
Conference calls are basically made by using client mixing meaning that all the clients can hear anything any of the other clients tells (Figure 1).
How to implement conference call using C#?
The audio conferencing is supported by a special tool in the Ozeki VoIP SIP SDK called ConferenceRoom. It is a MediaHandler that makes all the background work and you only need to add the calls to it - and remove them, when needed.
All you have to do is to create a ConferenceRoom instance, and call its StartConferencing() method after the phone line has been successfully registered. Since now you have a conference room, when an incoming call occurs and that enters into Answered call state, you have to add the call to the conference room with the AddToConference() method, and if a call ends, you have to remove that with the RemoveFromConference() method.
The example softphone of this guide will only create the conference room for the callers, but you could also communicate them using this softphone through microphone and speaker by using the ConnectSender() and ConnectReceiver() methods.
Client mixed conference call in C#
using System; using Ozeki.Media; using Ozeki.VoIP; namespace Conference_Call { class Program { static ISoftPhone softphone; // softphone object static IPhoneLine phoneLine; // phoneline object static ConferenceRoom conferenceRoom; private static void Main(string[] args) { // Create a softphone object with RTP port range 5000-10000 softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000); // SIP account registration data, (supplied by your VoIP service provider) var registrationRequired = true; var userName = "858"; var displayName = "858"; var authenticationId = "858"; var registerPassword = "858"; var domainHost = "192.168.115.100"; var domainPort = 5060; var account = new SIPAccount(registrationRequired, displayName, userName, authenticationId, registerPassword, domainHost, domainPort); // Send SIP regitration request RegisterAccount(account); // Prevents the termination of the application Console.ReadLine(); } static void RegisterAccount(SIPAccount account) { try { phoneLine = softphone.CreatePhoneLine(account); phoneLine.RegistrationStateChanged += line_RegStateChanged; softphone.IncomingCall += softphone_IncomingCall; softphone.RegisterPhoneLine(phoneLine); } catch (Exception ex) { Console.WriteLine("Error during SIP registration: " + ex); } } static void InitializeConferenceRoom() { conferenceRoom = new ConferenceRoom(); conferenceRoom.StartConferencing(); } static void softphone_IncomingCall(object sender, VoIPEventArgs<IPhoneCall> e) { IPhoneCall call = e.Item; call.CallStateChanged += call_CallStateChanged; call.Answer(); } static void line_RegStateChanged(object sender, RegistrationStateChangedArgs e) { if (e.State == RegState.NotRegistered || e.State == RegState.Error) Console.WriteLine("Registration failed!"); if (e.State == RegState.RegistrationSucceeded) { Console.WriteLine("Registration succeeded - Online!"); InitializeConferenceRoom(); } } static void call_CallStateChanged(object sender, CallStateChangedArgs e) { IPhoneCall call = sender as IPhoneCall; if (e.State == CallState.Answered) conferenceRoom.AddToConference(call); else if (e.State.IsCallEnded()) conferenceRoom.RemoveFromConference(call); } } }
Related Pages
More information
- How to build a softphone voip sip client
- Register to SIP PBX
- Voip softphone development
- How to encrypt voip sip calls with sip encryption
- How to encrypt voip sip calls with rtp encryption
- How to ring a sip extension csharp example for sip invite
- How to make a sip voice call using csharp
- Voip multiple phone lines
- How to send stream of voice data into call using csharp microphone
- How to receive voice from SIP voice call using csharp speaker
- How to make conference voice call using voip sip
- How to play an mp3 file into a voice call using csharp
- How to convert text to speech and play that into a call using csharp
- How to use Microsoft Speech Platform 11 for TTS and STT
- How to record voip sip voice call
- How to accept incoming call using csharp
- How to reject incoming call using csharp
- How to read Headset buttons using Bluetooth
- How to implement auto answer using csharp
- How to recognize incoming voice using speech to text conversion
- Voip forward call
- Voip blind transfer
- Voip attended transfer
- Voip do not disturb
- Voip call hold
- SIP Message Waiting Indication
- Voip DTMF signaling
- How to work with sip and sdp in voip sip calls
- How to work with rtp in voip sip calls
- How to make voip video calls in csharp
- Voip video codec
- Shows how to use SpeechToText Google API
- How to convert Text to Speech using C# and Google
- Azure Text-to-Speech