#pragma warning restore CS0649
        //private AudioScope.AudioScope _audioScope0;
        //private AudioScope.AudioScopeOpenGL _audioScopeGL0;
        //private AudioScope.AudioScope _audioScope1;
        //private AudioScope.AudioScopeOpenGL _audioScopeGL1;
        //private AudioScope.AudioScope _onHoldAudioScope;
        //private AudioScope.AudioScopeOpenGL _onHoldAudioScopeGL;

        public SoftPhone()
        {
            InitializeComponent();

            //if(!m_useAudioScope)
            //{
            //    _audioScope0Border.Visibility = Visibility.Collapsed;
            //    //OpenGLDraw = "AudioScopeDraw0" OpenGLInitialized = "AudioScopeInitialized0"
            //    AudioScope0.IsEnabled = false;
            //    AudioScope0.Visibility = Visibility.Hidden;
            //}

            // Do some UI initialization.
            ResetToCallStartState(null);

            _sipTransportManager = new SIPTransportManager();
            _sipTransportManager.IncomingCall += SIPCallIncoming;

            _sipClients = new List <SIPClient>();

            // If a STUN server hostname has been specified start the STUN client to lookup and periodically
            // update the public IP address of the host machine.
            if (!SIPSoftPhoneState.STUNServerHostname.IsNullOrBlank())
            {
                _stunClient = new SoftphoneSTUNClient(SIPSoftPhoneState.STUNServerHostname);
                _stunClient.PublicIPAddressDetected += (ip) =>
                {
                    SIPSoftPhoneState.PublicIPAddress = ip;
                };
                _stunClient.Run();
            }
        }
Exemple #2
0
        public SoftPhone()
        {
            InitializeComponent();

            // Do some UI initialisation.
            m_uasGrid.Visibility      = Visibility.Collapsed;
            m_cancelButton.Visibility = Visibility.Collapsed;
            m_byeButton.Visibility    = Visibility.Collapsed;

            // Set up the SIP client. It can receive calls and initiate outgoing calls.
            _sipClient = new SIPClient();
            _sipClient.IncomingCall  += SIPCallIncoming;
            _sipClient.CallAnswer    += SIPCallAnswered;
            _sipClient.CallEnded     += ResetToCallStartState;
            _sipClient.StatusMessage += (message) => { SetStatusText(m_signallingStatus, message); };

            // If a STUN server hostname has been specified start the STUN client to lookup and periodically update the public IP address of the host machine.
            if (!SIPSoftPhoneState.STUNServerHostname.IsNullOrBlank())
            {
                _stunClient = new SoftphoneSTUNClient(SIPSoftPhoneState.STUNServerHostname);
                _stunClient.PublicIPAddressDetected += (ip) =>
                {
                    SIPSoftPhoneState.PublicIPAddress = ip;
                    UIHelper.DoOnUIThread(this, delegate
                    {
                        publicIPAddress.Content = $"Public IP: {ip}";
                    });
                };
                _stunClient.Run();
            }

            Initialise();
        }
        public SoftPhone()
        {
            InitializeComponent();

            // Do some UI initialization.
            ResetToCallStartState(null);

            _sipTransportManager = new SIPTransportManager();
            _sipTransportManager.IncomingCall += SIPCallIncoming;

            _sipClients = new List <SIPClient>();

            // If a STUN server hostname has been specified start the STUN client to lookup and periodically
            // update the public IP address of the host machine.
            if (!SIPSoftPhoneState.STUNServerHostname.IsNullOrBlank())
            {
                _stunClient = new SoftphoneSTUNClient(SIPSoftPhoneState.STUNServerHostname);
                _stunClient.PublicIPAddressDetected += (ip) =>
                {
                    SIPSoftPhoneState.PublicIPAddress = ip;
                };
                _stunClient.Run();
            }
        }