GetFilterDescription() public method

public GetFilterDescription ( ) : string
return string
            public void UsernameWithAndFilterUnitTest()
            {
                Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

                SIPMonitorFilter filter = new SIPMonitorFilter("user testandtest   and  event full");
                Console.WriteLine(filter.GetFilterDescription());

                Assert.IsTrue(filter != null, "The filter was not correctly instantiated.");
                Assert.AreEqual(filter.Username, "testandtest", "The filter username was not correctly set.");
                Assert.AreEqual(filter.EventFilterDescr, "full", "The filter event full was not correctly set.");
            }
            public void BlockIPAddressUnitTest()
            {
                Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

                SIPMonitorFilter filter = new SIPMonitorFilter("ipaddress 127.0.0.1 and event full");
                Console.WriteLine(filter.GetFilterDescription());

                Assert.IsTrue(filter != null, "The filter was not correctly instantiated.");
                Assert.AreEqual(filter.IPAddress, "127.0.0.1", "The filter ip address was not correctly set.");

                SIPMonitorEvent monitorEvent = new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.FullSIPTrace, "blah blah", String.Empty, SIPEndPoint.ParseSIPEndPoint("127.0.0.2"), null);
                bool showEventResult = filter.ShowSIPMonitorEvent(monitorEvent);

                Assert.IsFalse(showEventResult, "The filter should not have shown this event.");
            }
            public void FullTraceSIPSwitchUnitTest()
            {
                Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

                SIPMonitorFilter filter = new SIPMonitorFilter("event full and regex :test@");
                Console.WriteLine(filter.GetFilterDescription());

                Assert.IsTrue(filter != null, "The filter was not correctly instantiated.");
                //Assert.AreEqual(filter.Username, "test", "The filter username was not correctly set.");
                Assert.AreEqual(filter.EventFilterDescr, "full", "The filter event full was not correctly set.");
                Assert.AreEqual(filter.RegexFilter, ":test@", "The regex was not correctly set.");

                string inviteRequest =
                    "INVITE sip:213.200.94.181 SIP/2.0" + m_CRLF +
                    "Via: SIP/2.0/UDP 192.168.1.32:10254;branch=z9hG4bK-d87543-eb7c9f44883c5955-1--d87543-;rport;received=89.100.104.191" + m_CRLF +
                    "To: aaronxten <sip:[email protected]>" + m_CRLF +
                    "From: test <sip:[email protected]>;tag=774d2561" + m_CRLF +
                    "Call-ID: MTBhNGZjZmQ2OTc3MWU5MTZjNWUxMDYxOTk1MjdmYzk." + m_CRLF +
                    "CSeq: 2 REGISTER" + m_CRLF +
                    "Contact: <sip:[email protected]:10254;rinstance=6d2bbd8014ca7a76>;expires=0" + m_CRLF +
                    "Max-Forwards: 69" + m_CRLF +
                    "User-Agent: X-Lite release 1006e stamp 34025" + m_CRLF +
                    "Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO" + m_CRLF + m_CRLF;

                SIPMonitorEvent monitorEvent = new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.FullSIPTrace, inviteRequest, null);
                bool showEventResult = filter.ShowSIPMonitorEvent(monitorEvent);

                Assert.IsTrue(showEventResult, "The filter should have shown this event.");
            }
        /// <summary>
        /// Simple state machine that processes commands from the client.
        /// </summary>
        private void ProcessCommand(string command)
        {
            try
            {
                if (command.IsNullOrBlank())
                {
                    command = DEFAULT_FILTER;
                }

                string subscribeError = null;
                m_notificationsSessionID = Guid.NewGuid().ToString();
                m_publisher.Subscribe(Username, AdminId, m_notificationsAddress, m_notificationsSessionID, SIPMonitorClientTypesEnum.Console.ToString(), command, DEFAULT_SESSION_LENGTH, null, out subscribeError);

                if (subscribeError != null)
                {
                    throw new ApplicationException(subscribeError);
                }
                else
                {
                    m_lastMonitorSessionRenewal = DateTime.Now;
                    ThreadPool.QueueUserWorkItem(delegate { RenewSession(); });
                    SIPMonitorFilter filter = new SIPMonitorFilter(command);
                    WriteFilterDescription(filter.GetFilterDescription());

                    /*if (m_publisher is SIPSorcery.Servers.SIPMonitorClientManager)
                    {
                        logger.Debug("VT100Server is connected to a publisher that fires an event when a notification is ready.");
                        // The publisher will fire an event when a new notification is ready.
                        m_publisher.NotificationReady += (address) => { GetNotifications(); };
                    }
                    else
                    {
                        logger.Debug("VT100Server is connected to a publisher that needs to be polled for events.");

                        // The publisher does not supply an event when a notification is ready and must be polled instead.
                        StopPolling = false;
                        ThreadPool.QueueUserWorkItem(delegate
                        {
                            try
                            {
                                while (!HasClosed && !StopPolling)
                                {
                                    GetNotifications();
                                    Thread.Sleep(POLL_FOR_NOTIFICATIONS_PERIOD);
                                }

                                logger.Debug("Stopped polling for events for address " + m_notificationsAddress + ".");
                            }
                            catch (ApplicationException appExcp)
                            {
                                WriteError(appExcp.Message);
                            }
                            catch (Exception excp)
                            {
                                logger.Error("Exception SIPSorceryVT100Server ProcessCommand on GetNotifications. " + excp.Message);
                            }
                        });
                    }*/
                }
            }
            catch (ApplicationException appExcp)
            {
                WriteError(appExcp.Message);
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPSorceryVT100Server ProcessCommand. " + excp.Message);
            }
        }