/// <summary>
        /// Default constructor, initalizes the softphone with deafult parameters.
        /// </summary>
        public Softphone()
        {
            _softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000);

            _microphone    = Microphone.GetDefaultDevice();
            _speaker       = Speaker.GetDefaultDevice();
            _connector     = new MediaConnector();
            _mediaSender   = new PhoneCallAudioSender();
            _mediaReceiver = new PhoneCallAudioReceiver();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handler of making call and receiving call
        /// </summary>
        /// <param name="registerName">The SIP ID what will registered into your PBX</param>
        /// <param name="domainHost">The address of your PBX</param>
        public CallHandlerSample(string registerName, string domainHost)
        {
            microphone = Microphone.GetDefaultDevice();
            speaker = Speaker.GetDefaultDevice();
            connector = new MediaConnector();
            mediaSender = new PhoneCallAudioSender();
            mediaReceiver = new PhoneCallAudioReceiver();

            InitializeSoftPhone(registerName, domainHost);
        }
Exemplo n.º 3
0
 static void OzekiInit()
 {
     //softphone = SoftPhoneFactory.CreateSoftPhone(6000, 6200);
     softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000);
     //Console.WriteLine("OZEKI: CreatedSoftPhone");
     microphone    = Microphone.GetDefaultDevice();
     speaker       = Speaker.GetDefaultDevice();
     mediaSender   = new PhoneCallAudioSender();
     mediaReceiver = new PhoneCallAudioReceiver();
     connector     = new MediaConnector();
 }
Exemplo n.º 4
0
        public Softphone()
        {
            softphone     = SoftPhoneFactory.CreateSoftPhone(5000, 10000);
            microphone    = Microphone.GetDefaultDevice();
            speaker       = Speaker.GetDefaultDevice();
            connector     = new MediaConnector();
            mediaSender   = new PhoneCallAudioSender();
            mediaReceiver = new PhoneCallAudioReceiver();

            incomingCall = false;
        }
Exemplo n.º 5
0
        public PhoneForm()
        {
            InitializeComponent();
            softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000);

            microphone    = Microphone.GetDefaultDevice();
            speaker       = Speaker.GetDefaultDevice();
            mediaSender   = new PhoneCallAudioSender();
            mediaReceiver = new PhoneCallAudioReceiver();
            connector     = new MediaConnector();
        }
Exemplo n.º 6
0
        void form_CallAssistant_Load(object sender, EventArgs e)
        {
            _microphone    = Microphone.GetDefaultDevice();
            _speaker       = Speaker.GetDefaultDevice();
            _connector     = new MediaConnector();
            _mediaSender   = new PhoneCallAudioSender();
            _mediaReceiver = new PhoneCallAudioReceiver();

            _databaseManager = new DatabaseManager();

            InitializeSoftphone();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Default constructor, initalizes the softphone with deafult parameters.
        /// </summary>
        public SoftPhone()
        {
            //you can specify the User-Agent of the softphone
            string userAgent = "ORX SoftPhone";

            _softphone     = SoftPhoneFactory.CreateSoftPhone(5000, 10000, userAgent);
            _microphone    = Microphone.GetDefaultDevice();
            _speaker       = Speaker.GetDefaultDevice();
            _connector     = new MediaConnector();
            _mediaSender   = new PhoneCallAudioSender();
            _mediaReceiver = new PhoneCallAudioReceiver();

            _incomingCall = false;

            MediaHandlers = new MediaHandlers();
            InitMedia();
        }
Exemplo n.º 8
0
Arquivo: App.cs Projeto: Nedvid/BlaBla
        //OZEKI
        void Ozeki()
        {
            softphone = SoftPhoneFactory.CreateSoftPhone(6000, 6200);

            microphone    = Microphone.GetDefaultDevice();
            speaker       = Speaker.GetDefaultDevice();
            mediaSender   = new PhoneCallAudioSender();
            mediaReceiver = new PhoneCallAudioReceiver();
            connector     = new MediaConnector();

            var config = new DirectIPPhoneLineConfig(local_ip, 5060);

            phoneLine = softphone.CreateDirectIPPhoneLine(config);
            phoneLine.RegistrationStateChanged += line_RegStateChanged;
            softphone.IncomingCall             += softphone_IncomingCall;
            softphone.RegisterPhoneLine(phoneLine);
        }
Exemplo n.º 9
0
        public CallHandler()
        {
            _guid = Guid.NewGuid().ToString();

            // Setup logging
            _logFileName = String.Format("{0}{1}.log", _dataDirectory, _guid);
            GlobalContext.Properties["LogFileName"] = _logFileName;
            GlobalContext.Properties["CallGUID"]    = _guid;
            log4net.Config.XmlConfigurator.Configure();
            _log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            _wavFileName = String.Format("{0}{1}.wav", _dataDirectory, _guid);

            _mixer         = new AudioMixerMediaHandler();
            _audioReceiver = new PhoneCallAudioReceiver();
            _wavRecorder   = new WaveStreamRecorder(_wavFileName, new WaveFormat());
            _connector     = new MediaConnector();
            _connector.Connect(_audioReceiver, _mixer);
            _connector.Connect(_mixer, _wavRecorder);
        }
Exemplo n.º 10
0
        private void Nasluchuj()
        {
            softphone     = SoftPhoneFactory.CreateSoftPhone(zalogowanyUzytkownik.AdresIP, 4900, 5100);
            mediaSender   = new PhoneCallAudioSender();
            mediaReceiver = new PhoneCallAudioReceiver();
            connector     = new MediaConnector();
            var config = new DirectIPPhoneLineConfig(zalogowanyUzytkownik.AdresIP.ToString(), 5060);

            phoneLine = softphone.CreateDirectIPPhoneLine(config);
            phoneLine.Config.SRTPMode           = Ozeki.Common.SRTPMode.Prefer;
            phoneLine.RegistrationStateChanged += line_RegStateChanged;
            phoneLine.SIPAccount.UserName       = zalogowanyUzytkownik.login;
            phoneLine.SIPAccount.DisplayName    = zalogowanyUzytkownik.imie + " " + zalogowanyUzytkownik.nazwisko;
            System.Windows.Application.Current.Dispatcher.Invoke(() => { System.Windows.Application.Current.MainWindow.Title = "SuperIP Phone - " + zalogowanyUzytkownik.login + "@" + zalogowanyUzytkownik.AdresIP + ":" + phoneLine.SIPAccount.DomainServerPort; });//ustawienie nazwy okna
            softphone.IncomingCall += softphone_IncomingCall;
            phoneLine.InstantMessaging.MessageReceived += PhoneLine_InstantMessageReceived;
            softphone.RegisterPhoneLine(phoneLine);
            foreach (var kodek in softphone.Codecs)
            {
                softphone.EnableCodec(kodek.PayloadType);
            }
        }
Exemplo n.º 11
0
        void Glowna(string DocIP)
        {
            softphone = SoftPhoneFactory.CreateSoftPhone(5000, 10000);

            microphone    = Microphone.GetDefaultDevice();
            speaker       = Speaker.GetDefaultDevice();
            mediaSender   = new PhoneCallAudioSender();
            mediaReceiver = new PhoneCallAudioReceiver();
            connector     = new MediaConnector();

            DoceloweIP = DocIP;

            //Console.WriteLine("Please enter the IP address of your machine: ");
            //var ipAddress = LocalIP;
            var config = new DirectIPPhoneLineConfig(LocalIP, 5060);

            //var config = new DirectIPPhoneLineConfig(textBox1.Text, 5060);
            phoneLine = softphone.CreateDirectIPPhoneLine(config);
            phoneLine.RegistrationStateChanged += line_RegStateChanged;
            softphone.IncomingCall             += softphone_IncomingCall;
            softphone.RegisterPhoneLine(phoneLine);

            //Console.ReadLine();
        }
Exemplo n.º 12
0
        /// <summary>
        /// Creates the incoming and outgoing media handlers such as microphone or speaker
        /// </summary>
        private void CreateMediaHandlers()
        {
            MediaHandlerFactory factory = new MediaHandlerFactory();
            activeAudioCallListener = factory.CreateSoftPhoneCallListener();
            activeVideoCallListener = factory.CreateSoftPhoneVideoCallListener();

            phoneCallAudioReceiver = activeAudioCallListener.GetComponent("AudiReceiver") as PhoneCallAudioReceiver;
            phoneCallAudioSender = activeAudioCallListener.GetComponent("AudioSender") as PhoneCallAudioSender;

            phonecallVideoSender = activeVideoCallListener.GetComponent("VideoSender") as PhoneCallVideoSender;
            phonecallVideoReceiver = activeVideoCallListener.GetComponent("VideoReceiver") as PhoneCallVideoReceiver;

            mediaConnector = activeAudioCallListener.MediaConnector;

            microphone = activeAudioCallListener.GetComponent("Microphone") as Microphone;
            if (microphone != null)
            {
                microphone.LevelChanged += (Microphone_LevelChanged);
            }

            speaker = activeAudioCallListener.GetComponent("Speaker") as Speaker;
            if (speaker != null)
            {
                speaker.LevelChanged += (Speaker_LevelChanged);
            }

            incomingDataMixer = activeAudioCallListener.GetComponent("SpeakerMixer") as AudioMixerMediaHandler;
            camera = activeVideoCallListener.GetComponent("WebCamera") as WebCamera;

            remoteImageHandler = activeVideoCallListener.GetComponent("RemoteImageHandler") as ImageProvider<Image>;
            localImageHandler = activeVideoCallListener.GetComponent("LocalImageHandler") as ImageProvider<Image>;

            AudioProcessor = activeAudioCallListener.GetComponent("AudioProcessor") as AudioQualityEnhancer;
            outgoingDataMixer = activeAudioCallListener.GetComponent("OutGoingDataMixer") as AudioMixerMediaHandler;
            RecordDataMixer = activeAudioCallListener.GetComponent("RecordDataMixer") as AudioMixerMediaHandler;

            dtmfEventWavePlayer = activeAudioCallListener.GetComponent("DTMF") as DtmfEventWavePlayer;
            ringtoneWavePlayer = activeAudioCallListener.GetComponent("Ringtones") as PhoneCallStateWavePlayer;

            Stream basicRing = Assembly.GetExecutingAssembly().GetManifestResourceStream(
                "OzekiDemoSoftphone.Resources.basic_ring.wav"
                );

            ringtoneWavePlayer.UpdateIncomingStateStream(CallState.Ringing, @"..\..\Resources\basic_ring.wav");
            ringtoneWavePlayer.UpdateOutgoingStateStream(CallState.Ringing, @"..\..\Resources\ringback.wav");
        }
Exemplo n.º 13
0
        /// <summary>
        /// Initializes the audio handlers (microphone, speaker, DTMF player etc.).
        /// </summary>
        private void InitAudio()
        {
            // ----- CREATE -----
            // devices
            Microphone = Microphone.GetDefaultDevice();
            Speaker    = Speaker.GetDefaultDevice();

            // audio processors
            if (Microphone == null)
            {
                AudioEnhancer = new AudioQualityEnhancer(new AudioFormat());
            }
            else
            {
                AudioEnhancer = new AudioQualityEnhancer(Microphone.MediaFormat);
            }
            AudioEnhancer.SetEchoSource(Speaker);
            _dtmfPlayer = new DtmfEventWavePlayer();

            // ringtones
            var ringbackStream = LoadRingbackStream();
            var ringtoneStream = LoadRingtoneStream();

            _ringtonePlayer = new WaveStreamPlayback(ringtoneStream, true, false);
            _ringbackPlayer = new WaveStreamPlayback(ringbackStream, true, false);

            // mixers
            //outgoingDataMixer = new AudioMixerMediaHandler();
            //speakerMixer = new AudioMixerMediaHandler();
            recordDataMixer = new AudioMixerMediaHandler();

            // phone handlers
            _phoneCallAudioSender   = new PhoneCallAudioSender();
            _phoneCallAudioReceiver = new PhoneCallAudioReceiver();


            // ----- CONNECT -----
            // connect outgoing
            //audioConnector.Connect(AudioEnhancer, outgoingDataMixer);
            //audioConnector.Connect(outgoingDataMixer, phoneCallAudioSender);
            //audioConnector.Connect(outgoingDataMixer, recordDataMixer);

            _audioConnector.Connect(AudioEnhancer, _phoneCallAudioSender);
            _audioConnector.Connect(AudioEnhancer, recordDataMixer);
            _audioConnector.Connect(_phoneCallAudioReceiver, recordDataMixer);
            if (Microphone != null)
            {
                Microphone.LevelChanged += (Microphone_LevelChanged);
                _audioConnector.Connect(Microphone, AudioEnhancer);
            }

            // connect incoming
            if (Speaker != null)
            {
                Speaker.LevelChanged += (Speaker_LevelChanged);
                _audioConnector.Connect(_phoneCallAudioReceiver, Speaker);
                _audioConnector.Connect(_ringtonePlayer, Speaker);
                _audioConnector.Connect(_ringbackPlayer, Speaker);
                _audioConnector.Connect(_dtmfPlayer, Speaker);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Creates a complex phone call listener, built up from microphone, speaker, waverecorder, waveplayer, dtmf and ringtone sounds.
        /// </summary>
        /// <returns>The media handler collection that represent the phone call listener.</returns>
        public MediaHandlerCollection CreateSoftPhoneCallListener()
        {
            var phoneCallAudioReceiver = new PhoneCallAudioReceiver();
            var phoneCallAudioSender = new PhoneCallAudioSender();

            var microphone =  Microphone.GetDefaultDevice();
            var speaker =  Speaker.GetDefaultDevice();

            var audioProcessor = new AudioQualityEnhancer();
            audioProcessor.SetEchoSource(speaker);   // Handles the audio that comes from the PhoneCallListener

            var outgoingDataMixer = new AudioMixerMediaHandler();
            var recordDataMixer = new AudioMixerMediaHandler();
            var speakerMixer = new AudioMixerMediaHandler();

            var dtmf = new DtmfEventWavePlayer();
            var ringtones = new PhoneCallStateWavePlayer(
                commonWaveFormat,
                outGoingToneStreams,
                incomingToneStreams
            );

            if (microphone != null) mediaConnector.Connect(microphone, audioProcessor);
            mediaConnector.Connect(audioProcessor, outgoingDataMixer);
            mediaConnector.Connect(outgoingDataMixer, phoneCallAudioSender);
            // No WaveStreamPlayback (see CreateWaveStreamPlayback method)

            //mediaConnector.Connect(phoneCallAudioReceiver, speaker);
            mediaConnector.Connect(phoneCallAudioReceiver, speakerMixer);
            mediaConnector.Connect(dtmf, speakerMixer);
            mediaConnector.Connect(ringtones, speakerMixer);
            if (speaker != null) mediaConnector.Connect(speakerMixer, speaker);

            mediaConnector.Connect(phoneCallAudioReceiver, recordDataMixer);
            mediaConnector.Connect(outgoingDataMixer, recordDataMixer);

            // No WaveStreamRecorder (see CreateWaveStreamRecorder method)

            /*
             * Media Connections:
             *
             * +---------------------------------------------------------------+
             * |                           PhoneCall                           |**************
             * +---------------------------------------------------------------+  *          *
             *              ^^                              VV                    *          *
             *     +--------------------+             +----------------------+  +----+   +---------+
             *     |PhoneCallAudioSender|             |PhoneCallAudioReceiver|  |DMTF|   |Ringtones|
             *     +--------------------+             +----------------------+  +----+   +---------+
             *                ^^                            V              V       V          |
             *       +-----------------+              +---------------+   +------------+      |
             *       |OutgoingDataMixer|----- >> -----|RecordDataMixer|   |SpeakerMixer|--<<--/
             *       +-----------------+              +---------------+   +------------+
             *         ^^          ^^                       V                      |
             *+--------------+   +------------------+    +------------------+      |
             *|AudioProcessor|   |WaveStreamPlayback|    |WaveStreamRecorder|      V
             *+--------------+   +------------------+    +------------------+      V
             *        ^^                                                           |
             *    +----------+                                                 +-------+
             *    |Microphone|                                                 |Speaker|
             *    +----------+                                                 +-------+
             */
            var mediaHandlers = new Dictionary<string, VoIPMediaHandler>
                                    {
                                        {"AudioProcessor", audioProcessor},
                                        {"OutGoingDataMixer", outgoingDataMixer},
                                        {"RecordDataMixer", recordDataMixer},
                                        {"SpeakerMixer", speakerMixer},
                                        {"DTMF", dtmf},
                                        {"Ringtones", ringtones},

                                        {"AudioSender",phoneCallAudioSender},
                                        {"AudiReceiver",phoneCallAudioReceiver},
            };
            if(microphone != null)
                mediaHandlers.Add("Microphone", microphone);
            if (speaker != null)
                mediaHandlers.Add("Speaker", speaker);

            return new MediaHandlerCollection(mediaConnector,mediaHandlers);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Initializes the audio handlers (microphone, speaker, DTMF player etc.).
        /// </summary>
        private void InitAudio()
        {
            // ----- CREATE -----
            // devices
            Microphone = Microphone.GetDefaultDevice();
            Speaker = Speaker.GetDefaultDevice();

            // audio processors
            AudioEnhancer = new AudioQualityEnhancer();
            AudioEnhancer.SetEchoSource(Speaker);
            dtmfPlayer = new DtmfEventWavePlayer();

            // ringtones
            var ringbackStream = LoadRingbackStream();
            var ringtoneStream = LoadRingtoneStream();
            ringtonePlayer = new WaveStreamPlayback(ringtoneStream, true, false);
            ringbackPlayer = new WaveStreamPlayback(ringbackStream, true, false);

            // mixers
            outgoingDataMixer = new AudioMixerMediaHandler();
            speakerMixer = new AudioMixerMediaHandler();
            recordDataMixer = new AudioMixerMediaHandler();

            // phone handlers
            phoneCallAudioSender = new PhoneCallAudioSender();
            phoneCallAudioReceiver = new PhoneCallAudioReceiver();

            // ----- CONNECT -----
            // connect outgoing
            audioConnector.Connect(AudioEnhancer, outgoingDataMixer);
            audioConnector.Connect(outgoingDataMixer, phoneCallAudioSender);
            audioConnector.Connect(outgoingDataMixer, recordDataMixer);
            if (Microphone != null)
            {
                Microphone.LevelChanged += (Microphone_LevelChanged);
                audioConnector.Connect(Microphone, AudioEnhancer);
            }

            // connect incoming
            audioConnector.Connect(phoneCallAudioReceiver, speakerMixer);
            audioConnector.Connect(phoneCallAudioReceiver, recordDataMixer);
            audioConnector.Connect(ringtonePlayer, speakerMixer);
            audioConnector.Connect(ringbackPlayer, speakerMixer);
            audioConnector.Connect(dtmfPlayer, speakerMixer);
            if (Speaker != null)
            {
                Speaker.LevelChanged += (Speaker_LevelChanged);
                audioConnector.Connect(speakerMixer, Speaker);
            }

            // add to collection
            Dictionary<string, VoIPMediaHandler> collection = new Dictionary<string, VoIPMediaHandler>();
            collection.Add("AudioEnhancer", AudioEnhancer);
            collection.Add("DTMFPlayer", dtmfPlayer);
            collection.Add("OutgoingDataMixer", outgoingDataMixer);
            collection.Add("SpeakerMixer", speakerMixer);
            collection.Add("PhoneCallAudioSender", phoneCallAudioSender);
            collection.Add("PhoneCallAudioReceiver", phoneCallAudioReceiver);
            audioCollection = new MediaHandlerCollection(audioConnector, collection);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initializes the audio handlers (microphone, speaker, DTMF player etc.).
        /// </summary>
        private void InitAudio()
        {
            // ----- CREATE -----
            // devices
            Microphone = Microphone.GetDefaultDevice();
            Speaker    = Speaker.GetDefaultDevice();

            // audio processors
            AudioEnhancer = new AudioQualityEnhancer();
            AudioEnhancer.SetEchoSource(Speaker);
            dtmfPlayer = new DtmfEventWavePlayer();

            // ringtones
            var ringbackStream = LoadRingbackStream();
            var ringtoneStream = LoadRingtoneStream();

            ringtonePlayer = new WaveStreamPlayback(ringtoneStream, true, false);
            ringbackPlayer = new WaveStreamPlayback(ringbackStream, true, false);

            // mixers
            outgoingDataMixer = new AudioMixerMediaHandler();
            speakerMixer      = new AudioMixerMediaHandler();
            recordDataMixer   = new AudioMixerMediaHandler();

            // phone handlers
            phoneCallAudioSender   = new PhoneCallAudioSender();
            phoneCallAudioReceiver = new PhoneCallAudioReceiver();


            // ----- CONNECT -----
            // connect outgoing
            audioConnector.Connect(AudioEnhancer, outgoingDataMixer);
            audioConnector.Connect(outgoingDataMixer, phoneCallAudioSender);
            audioConnector.Connect(outgoingDataMixer, recordDataMixer);
            if (Microphone != null)
            {
                Microphone.LevelChanged += (Microphone_LevelChanged);
                audioConnector.Connect(Microphone, AudioEnhancer);
            }

            // connect incoming
            audioConnector.Connect(phoneCallAudioReceiver, speakerMixer);
            audioConnector.Connect(phoneCallAudioReceiver, recordDataMixer);
            audioConnector.Connect(ringtonePlayer, speakerMixer);
            audioConnector.Connect(ringbackPlayer, speakerMixer);
            audioConnector.Connect(dtmfPlayer, speakerMixer);
            if (Speaker != null)
            {
                Speaker.LevelChanged += (Speaker_LevelChanged);
                audioConnector.Connect(speakerMixer, Speaker);
            }

            // add to collection
            Dictionary <string, VoIPMediaHandler> collection = new Dictionary <string, VoIPMediaHandler>();

            collection.Add("AudioEnhancer", AudioEnhancer);
            collection.Add("DTMFPlayer", dtmfPlayer);
            collection.Add("OutgoingDataMixer", outgoingDataMixer);
            collection.Add("SpeakerMixer", speakerMixer);
            collection.Add("PhoneCallAudioSender", phoneCallAudioSender);
            collection.Add("PhoneCallAudioReceiver", phoneCallAudioReceiver);
            audioCollection = new MediaHandlerCollection(audioConnector, collection);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Creates a complex phone call listener, built up from microphone, speaker, waverecorder, waveplayer, dtmf and ringtone sounds.
        /// </summary>
        /// <returns>The media handler collection that represent the phone call listener.</returns>
        public MediaHandlerCollection CreateSoftPhoneCallListener()
        {
            var phoneCallAudioReceiver = new PhoneCallAudioReceiver();
            var phoneCallAudioSender   = new PhoneCallAudioSender();

            var microphone = Microphone.GetDefaultDevice();
            var speaker    = Speaker.GetDefaultDevice();


            var audioProcessor = new AudioQualityEnhancer();

            audioProcessor.SetEchoSource(speaker);   // Handles the audio that comes from the PhoneCallListener

            var outgoingDataMixer = new AudioMixerMediaHandler();
            var recordDataMixer   = new AudioMixerMediaHandler();
            var speakerMixer      = new AudioMixerMediaHandler();

            var dtmf      = new DtmfEventWavePlayer();
            var ringtones = new PhoneCallStateWavePlayer(
                commonWaveFormat,
                outGoingToneStreams,
                incomingToneStreams
                );


            if (microphone != null)
            {
                mediaConnector.Connect(microphone, audioProcessor);
            }
            mediaConnector.Connect(audioProcessor, outgoingDataMixer);
            mediaConnector.Connect(outgoingDataMixer, phoneCallAudioSender);
            // No WaveStreamPlayback (see CreateWaveStreamPlayback method)

            //mediaConnector.Connect(phoneCallAudioReceiver, speaker);
            mediaConnector.Connect(phoneCallAudioReceiver, speakerMixer);
            mediaConnector.Connect(dtmf, speakerMixer);
            mediaConnector.Connect(ringtones, speakerMixer);
            if (speaker != null)
            {
                mediaConnector.Connect(speakerMixer, speaker);
            }

            mediaConnector.Connect(phoneCallAudioReceiver, recordDataMixer);
            mediaConnector.Connect(outgoingDataMixer, recordDataMixer);



            // No WaveStreamRecorder (see CreateWaveStreamRecorder method)

            /*
             * Media Connections:
             *
             * +---------------------------------------------------------------+
             * |                           PhoneCall                           |**************
             * +---------------------------------------------------------------+  *          *
             *              ^^                              VV                    *          *
             *     +--------------------+             +----------------------+  +----+   +---------+
             *     |PhoneCallAudioSender|             |PhoneCallAudioReceiver|  |DMTF|   |Ringtones|
             *     +--------------------+             +----------------------+  +----+   +---------+
             *                ^^                            V              V       V          |
             *       +-----------------+              +---------------+   +------------+      |
             *       |OutgoingDataMixer|----- >> -----|RecordDataMixer|   |SpeakerMixer|--<<--/
             *       +-----------------+              +---------------+   +------------+
             *         ^^          ^^                       V                      |
             *+--------------+   +------------------+    +------------------+      |
             *|AudioProcessor|   |WaveStreamPlayback|    |WaveStreamRecorder|      V
             *+--------------+   +------------------+    +------------------+      V
             *        ^^                                                           |
             *    +----------+                                                 +-------+
             *    |Microphone|                                                 |Speaker|
             *    +----------+                                                 +-------+
             */
            var mediaHandlers = new Dictionary <string, VoIPMediaHandler>
            {
                { "AudioProcessor", audioProcessor },
                { "OutGoingDataMixer", outgoingDataMixer },
                { "RecordDataMixer", recordDataMixer },
                { "SpeakerMixer", speakerMixer },
                { "DTMF", dtmf },
                { "Ringtones", ringtones },

                { "AudioSender", phoneCallAudioSender },
                { "AudiReceiver", phoneCallAudioReceiver },
            };

            if (microphone != null)
            {
                mediaHandlers.Add("Microphone", microphone);
            }
            if (speaker != null)
            {
                mediaHandlers.Add("Speaker", speaker);
            }


            return(new MediaHandlerCollection(mediaConnector, mediaHandlers));
        }