コード例 #1
0
        private bool UpdateSecurity()
        {
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.TLS_PRIV_KEY_FILE, this.textBoxTLSPrivateKey.Text);
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.TLS_PUB_KEY_FILE, this.textBoxTLSPublicKey.Text);
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.TLS_CA_FILE, this.textBoxTLSCA.Text);

            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.IPSEC_SEC_AGREE, this.checkBoxIPSecSecAgreeEnabled.IsChecked.Value);
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.IPSEC_ALGO, (this.comboBoxIPSecAlgorithm.SelectedValue as System.Windows.Controls.ComboBoxItem).Tag.ToString());
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.IPSEC_EALGO, (this.comboBoxIPSecEAlgorithm.SelectedValue as System.Windows.Controls.ComboBoxItem).Tag.ToString());
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.IPSEC_MODE, (this.comboBoxIPSecMode.SelectedValue as System.Windows.Controls.ComboBoxItem).Tag.ToString());
            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.IPSEC_PROTO, (this.comboBoxIPSecProtocol.SelectedValue as System.Windows.Controls.ComboBoxItem).Tag.ToString());

            tmedia_srtp_mode_t srtpMode = (this.comboBoxSRTPModes.SelectedValue as SRtpMode).Mode;

            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.SRTP_MODE, srtpMode.ToString());

            tmedia_srtp_type_t srtpType = (this.comboBoxSRTPTypes.SelectedValue as SRtpType).Type;

            this.configurationService.Set(Configuration.ConfFolder.SECURITY, Configuration.ConfEntry.SRTP_TYPE, srtpType.ToString());

            // Transmit values to the native part (global)
            MediaSessionMgr.defaultsSetSRtpMode(srtpMode);
            MediaSessionMgr.defaultsSetSRtpType(srtpType);
            if (this.sipService.SipStack != null)
            {
                this.sipService.SipStack.WrappedStack.setSSLCertificates(this.textBoxTLSPrivateKey.Text, this.textBoxTLSPublicKey.Text, this.textBoxTLSCA.Text);
            }

            return(true);
        }