public MonitoringConsole(
            ActivityMessageDelegate logActivityMessage,
            SIPSorceryNotificationClient notificationsClient)
        {
            InitializeComponent();

            LogActivityMessage_External = logActivityMessage;
            m_sipNotifierClient = notificationsClient;
            m_sipNotifierClient.ControlEventReceived += (eventStr) => { AppendMonitorText(eventStr); };
            //m_owner = owner;
            //m_authID = authId;
            //m_notificationsURL = notificationsURL;
            //m_monitorHost = host;
            //m_monitorPort = port;

            //m_sipConsoleEndPoint = new DnsEndPoint(m_monitorHost, m_monitorPort);
            //m_sipConsoleClient = new SocketClient(m_sipConsoleEndPoint);
            //m_sipConsoleClient.SocketDataReceived += new SocketDataReceivedDelegate(SIPConsoleClient_MonitorEventReceived);
            //m_sipConsoleClient.SocketConnectionChange += new SocketConnectionChangeDelegate(SIPConsoleClient_MonitorConnectionChange);

            UIHelper.SetVisibility(m_closeSocketButton, Visibility.Collapsed);
            UIHelper.SetVisibility(m_connectSocketButton, Visibility.Visible);
        }
Пример #2
0
        public UserPage(
            SIPSorceryPersistor persistor, 
            LogoutDelegate logoutDelegate, 
            string owner, 
            string authId, 
            string notificationsURL)
        {
            InitializeComponent();

            App.AppUnhandledException += new AppUnhandledExceptionDelegate(AppUnhandledException);

            m_persistor = persistor;
            //m_sipEventMonitorClient = sipEventMonitorClient;
            Logout_External = logoutDelegate;
            m_owner = owner;
            m_authId = authId;
            m_notificationsURL = notificationsURL;
            //m_monitorHost = monitorHost;
            //m_monitorPort = monitorPort;
            m_sessionTimer = new Timer(delegate { UIHelper.SetVisibility(m_extendSessionButton, Visibility.Visible); }, null, INITIAL_DISPLAY_EXTEND_SESSION, Timeout.Infinite);
            m_expiredTimer = new Timer(delegate { SessionExpired(); }, null, SUBSEQUENT_DISPLAY_EXTEND_SESSION, Timeout.Infinite);

            this.m_activityPorgressBar.Visibility = Visibility.Collapsed;
            this.TabNavigation = KeyboardNavigationMode.Cycle;
            this.m_extendSessionButton.Visibility = Visibility.Collapsed;
            m_persistor.ExtendSessionComplete += ExtendSessionComplete;
            m_persistor.IsAliveComplete += PersistorIsAliveComplete;

            m_sipNotifierClient = new SIPSorceryNotificationClient(LogActivityMessage, m_notificationsURL, m_authId);
            m_sipNotifierClient.StatusChanged += NotificationsServiceStatusChanged;
            m_sipNotifierClient.MachineEventReceived += SIPEventMonitorClient_MonitorEventReceived;

            //if (m_sipEventMonitorClient != null)
            //{
            //    m_sipEventMonitorClient.SocketDataReceived += new SocketDataReceivedDelegate(SIPEventMonitorClient_MonitorEventReceived);
            //    m_sipEventMonitorClient.SocketConnectionChange += new SocketConnectionChangeDelegate(SIPEventMonitorClient_MonitorConnectionChange);
            //}

            m_dialPlanManager = new DialPlanManager(LogActivityMessage, ShowActivityProgress, m_persistor, m_owner);
            m_dialPlanManager.Visibility = Visibility.Collapsed;
            m_mainCanvas.Children.Add(m_dialPlanManager);

            m_sipAccountManager = new SIPAccountManager(LogActivityMessage, ShowActivityProgress, m_persistor, m_dialPlanManager.GetDialPlanNames, m_owner);
            m_sipAccountManager.Visibility = Visibility.Collapsed;
            m_mainCanvas.Children.Add(m_sipAccountManager);

            m_sipProviderManager = new SIPProviderManager(LogActivityMessage, ShowActivityProgress, m_persistor, m_owner);
            m_sipProviderManager.Visibility = Visibility.Collapsed;
            m_mainCanvas.Children.Add(m_sipProviderManager);

            m_sipCallsManager = new SIPCallManager(LogActivityMessage, ShowActivityProgress, m_persistor, m_owner);
            m_sipCallsManager.Visibility = Visibility.Collapsed;
            m_mainCanvas.Children.Add(m_sipCallsManager);

            m_monitorConsole = new MonitoringConsole(LogActivityMessage, m_sipNotifierClient);
            m_monitorConsole.Visibility = Visibility.Collapsed;
            m_mainCanvas.Children.Add(m_monitorConsole);

            m_customerSettings = new CustomerSettingsControl(LogActivityMessage, Logout_External, m_persistor, m_owner);
            m_customerSettings.Visibility = Visibility.Collapsed;
            m_mainCanvas.Children.Add(m_customerSettings);

            SetActive(m_sipAccountManager);
            SetSelectedTextBlock(m_sipAccountsLink);

            m_persistor.IsAliveAsync();
            m_sipNotifierClient.Connect();
        }
 public void SetNotifierClient(SIPSorceryNotificationClient notificationsClient)
 {
     m_sipNotifierClient = notificationsClient;
     m_sipNotifierClient.ControlEventReceived += (eventStr) => { AppendMonitorText(eventStr); };
 }