Exemplo n.º 1
0
        private bool UpdateNATT()
        {
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_SYMETRIC_RTP, this.checkBoxForceSymetricRtpEnabled.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_ICE, this.checkBoxIceEnabled.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_STUN_FOR_SIP, this.checkBoxStunForSIP.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_STUN_FOR_ICE, this.checkBoxStunForICE.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_TURN_FOR_ICE, this.checkBoxTurnForICE.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_DISCO, this.radioButtonStunDiscover.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_SERVER, this.textBoxStunServerAddress.Text);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_PORT, this.textBoxStunPort.Text);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_USERNAME, this.textBoxStunUsername.Text);
            this.configurationService.Set(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_PASSWORD, this.passwordBoxStunPassword.Password);

            // STUN informaions are checked before each registration which means that we don't need to pass the config to the native part
            // Pass other configs to the native part
            MediaSessionMgr.defaultsSetStunEnabled(this.checkBoxStunForSIP.IsChecked.Value);
            MediaSessionMgr.defaultsSetIceStunEnabled(this.checkBoxStunForICE.IsChecked.Value);
            MediaSessionMgr.defaultsSetIceTurnEnabled(this.checkBoxTurnForICE.IsChecked.Value);
            MediaSessionMgr.defaultsSetIceEnabled(this.checkBoxIceEnabled.IsChecked.Value);
            MediaSessionMgr.defaultsSetRtpSymetricEnabled(this.checkBoxForceSymetricRtpEnabled.IsChecked.Value);
            MediaSessionMgr.defaultsSetStunServer(this.textBoxStunServerAddress.Text, (ushort)Int32.Parse(this.textBoxStunPort.Text));
            MediaSessionMgr.defaultsSetStunCred(this.textBoxStunUsername.Text, this.passwordBoxStunPassword.Password);

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts the manager
        /// </summary>
        /// <returns></returns>
        public bool Start()
        {
            bool ret = true;

            LOG.Debug("Start Service Manager");


            ret &= this.LogService.Start();
            ret &= this.ConfigurationService.Start();

            ret &= this.Win32ScreenService.Start();
            ret &= this.SipService.Start();
            ret &= this.XcapService.Start();
            ret &= this.ContactService.Start();
            ret &= this.HistoryService.Start();
            ret &= this.SoundService.Start();
            ret &= this.StateMonitorService.Start();

            // Register plugins
            // MediaSessionMgr.registerAudioPluginFromFile("audio_webrtc.dll");

            // Set user preferences (global defaults)
            // could be changed per session
            MediaSessionMgr.defaultsSetAgcEnabled(true);
            MediaSessionMgr.defaultsSetEchoSuppEnabled(true);
            MediaSessionMgr.defaultsSetEchoTail(100);
            MediaSessionMgr.defaultsSetEchoSkew(0);
            MediaSessionMgr.defaultsSetNoiseSuppEnabled(true);
            MediaSessionMgr.defaultsSetVadEnabled(false);
            MediaSessionMgr.defaultsSetJbMaxLateRate(1);
            MediaSessionMgr.defaultsSetRtcpEnabled(true);
            MediaSessionMgr.defaultsSetRtcpMuxEnabled(true);
            MediaSessionMgr.defaultsSetOpusMaxCaptureRate(16000); /* Because of WebRTC AEC only 8000 and 16000 are supported */
            MediaSessionMgr.defaultsSetOpusMaxPlaybackRate(48000);
            MediaSessionMgr.defaultsSetAudioChannels(1, 1);       // mono for both
            MediaSessionMgr.defaultsSetAudioPtime(20);
            MediaSessionMgr.defaultsSetVideoFps(15);              // default video FPS. Will be updated using the SDP.
            MediaSessionMgr.defaultsSetAvpfMode(tmedia_mode_t.tmedia_mode_optional);
            MediaSessionMgr.defaultsSetBandwidthVideoDownloadMax(-1);
            MediaSessionMgr.defaultsSetBandwidthVideoUploadMax(-1);
            MediaSessionMgr.defaultsSetCongestionCtrlEnabled(true);

            tmedia_bandwidth_level_t bandwidthLevel = (tmedia_bandwidth_level_t)Enum.Parse(typeof(tmedia_bandwidth_level_t), this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.BANDWIDTH, Configuration.DEFAULT_QOS_BANDWIDTH));

            MediaSessionMgr.defaultsSetVideoMotionRank(Configuration.QoSMotionRankFromBandwidth(bandwidthLevel));

            MediaSessionMgr.defaultsSetVolume(this.ConfigurationService.Get(Configuration.ConfFolder.GENERAL, Configuration.ConfEntry.AUDIO_VOLUME, Configuration.DEFAULT_GENERAL_AUDIO_VOLUME));
            if (this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS, Configuration.DEFAULT_QOS_SESSION_TIMERS))
            {
                MediaSessionMgr.defaultsSetInviteSessionTimers(
                    this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_TIMEOUT, Configuration.DEFAULT_QOS_SESSION_TIMERS_TIMEOUT),
                    this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.SESSION_TIMERS_REFRESHER, Configuration.DEFAULT_QOS_SESSION_TIMERS_REFRESHER));
            }
            else
            {
                MediaSessionMgr.defaultsSetInviteSessionTimers(0, null);
            }
            MediaSessionMgr.defaultsSetVideoZeroArtifactsEnabled(this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.USE_ZERO_VIDEO_ARTIFACTS, Configuration.DEFAULT_QOS_USE_ZERO_VIDEO_ARTIFACTS));
            MediaSessionMgr.defaultsSetPrefVideoSize(
                (tmedia_pref_video_size_t)Enum.Parse(typeof(tmedia_pref_video_size_t), this.configurationService.Get(Configuration.ConfFolder.QOS, Configuration.ConfEntry.PREF_VIDEO_SIZE, Configuration.DEFAULT_QOS_PREF_VIDEO_SIZE), true)
                );

            MediaSessionMgr.defaultsSetSRtpMode(
                (tmedia_srtp_mode_t)Enum.Parse(typeof(tmedia_srtp_mode_t), this.configurationService.Get(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.SRTP_MODE, Configuration.DEFAULT_SECURITY_SRTP_MODE), true)
                );

            MediaSessionMgr.defaultsSetSRtpType(
                (tmedia_srtp_type_t)Enum.Parse(typeof(tmedia_srtp_type_t), this.configurationService.Get(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.SRTP_TYPE, Configuration.DEFAULT_SECURITY_SRTP_TYPE), true)
                );

            MediaSessionMgr.defaultsSetProfile(
                (tmedia_profile_t)Enum.Parse(typeof(tmedia_profile_t), this.configurationService.Get(Configuration.ConfFolder.MEDIA, Configuration.ConfEntry.PROFILE, Configuration.DEFAULT_MEDIA_PROFILE), true)
                );

            MediaSessionMgr.defaultsSetRtpSymetricEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_SYMETRIC_RTP, Configuration.DEFAULT_NATT_USE_SYMETRIC_RTP)
                );
            MediaSessionMgr.defaultsSetIceEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_ICE, Configuration.DEFAULT_NATT_USE_ICE)
                );
            MediaSessionMgr.defaultsSetStunEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_STUN_FOR_SIP, Configuration.DEFAULT_NATT_USE_STUN_FOR_SIP)
                );
            MediaSessionMgr.defaultsSetIceStunEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_STUN_FOR_ICE, Configuration.DEFAULT_NATT_USE_STUN_FOR_ICE)
                );
            MediaSessionMgr.defaultsSetIceTurnEnabled(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.USE_TURN_FOR_ICE, Configuration.DEFAULT_NATT_USE_TURN_FOR_ICE)
                );
            MediaSessionMgr.defaultsSetStunServer(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_SERVER, Configuration.DEFAULT_NATT_STUN_SERVER),
                (ushort)this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_PORT, Configuration.DEFAULT_NATT_STUN_PORT)
                );
            MediaSessionMgr.defaultsSetStunCred(
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_USERNAME, Configuration.DEFAULT_NATT_STUN_USERNAME),
                this.configurationService.Get(Configuration.ConfFolder.NATT, Configuration.ConfEntry.STUN_PASSWORD, Configuration.DEFAULT_NATT_STUN_PASSWORD)
                );

            return(ret);
        }