Return to Snippet

Revision: 69019
at April 3, 2015 19:57 by warnerBro19

Initial Code
using System;
using Ozeki.Media;
using Ozeki.VoIP;
using Ozeki.VoIP.SDK;

namespace Conference_Call
    class Program
        static ISoftPhone softphone;
        static IPhoneLine phoneLine;

        static ConferenceRoom conferenceRoom;

        private static void Main(string[] args)
            softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000);

            var registrationRequired = true;
            var userName = "715";
            var displayName = "715";
            var authenticationId = "715";
            var registerPassword = "715";
            var domainHost = "";
            var domainPort = 5060;

            var account = new SIPAccount(registrationRequired, displayName, userName, authenticationId, registerPassword, domainHost, domainPort);



        static void RegisterAccount(SIPAccount account)
                phoneLine = softphone.CreatePhoneLine(account);
                phoneLine.RegistrationStateChanged += line_RegStateChanged;
                softphone.IncomingCall += softphone_IncomingCall;
            catch (Exception ex)
                Console.WriteLine("Error during SIP registration: " + ex);

        static void InitializeConferenceRoom()
            conferenceRoom = new ConferenceRoom();

        static void softphone_IncomingCall(object sender, VoIPEventArgs<IPhoneCall> e)
            IPhoneCall call = e.Item;
            call.CallStateChanged += call_CallStateChanged;

        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!");

        static void call_CallStateChanged(object sender, CallStateChangedArgs e)
            IPhoneCall call = sender as IPhoneCall;

            if (e.State == CallState.Answered)
            else if (e.State.IsCallEnded())


Initial URL

Initial Description
A conference call is a meeting, conducted over the phone using audio, between two or more people and usually for the purposes of discussing a particular topic. In my former snippets I dealt with text-to-speech and speech-to-text functionalities. So the implementation of conference calling can sound a little bit strange as compared with my previous tutorials. But I thought it provides a good opportunity for a new challange, so I thought I share my upshot expectedly that it will be useful for you. 

A softphone with built-in conference call feature can be greatly used in business communication as well as in companionship. The source code below is ready for use, so you only need to copy&paste it to your Visual Studio, then modify the necessary fields. (Do not forget to add the necessary DLL file providing the VoIP background to your references:

This program will be a console application that functions as a softphone making conference calling possible. This solution assumes that you have a PBX with some SIP extensions installed previously. After creating the necessary using lines and objects, you need to define your PBX and provide the appropriate SIP account details in order to be able to register your application to the phone system. When you have created all the required methods for SIP calling, you need to initialize the conference room and handle the related events. AddToConference is used to add new party to the conference room and RemoveFromConference is used when the call is ended.

Have a good time!

Initial Title
How to implement conference calling for a SIP softphone in C#?

Initial Tags
phone, Net, c#

Initial Language