Beispiel #1
0
        public string GetFilterDescription()
        {
            string eventStr  = (EventTypeId == 0) ? EventFilterDescr : SIPMonitorEventTypes.GetProxyEventTypeForId(EventTypeId).ToString();
            string serverStr = (ServerTypeId == 0) ? WILDCARD : SIPMonitorServerTypes.GetProxyServerTypeForId(ServerTypeId).ToString();

            string filerDescription =
                "basetype=" + BaseType + ", ipaddress=" + IPAddress + ", user="******", event=" + eventStr + ", request=" + SIPRequestFilter + ", serveripaddress=" + ServerIPAddress + ", server=" + serverStr + ", regex=" + RegexFilter + ".";

            return(filerDescription);
        }
        public static SIPMonitorConsoleEvent ParseClientControlEventCSV(string eventCSV)
        {
            try
            {
                var monitorEvent = new SIPMonitorConsoleEvent();

                if (eventCSV.IndexOf(END_MESSAGE_DELIMITER) != -1)
                {
                    eventCSV.Remove(eventCSV.Length - 2, 2);
                }

                string[] eventFields = eventCSV.Split(new char[] { '|' });

                monitorEvent.SessionID       = eventFields[1];
                monitorEvent.MonitorServerID = eventFields[2];
                monitorEvent.ServerType      = SIPMonitorServerTypes.GetProxyServerType(eventFields[3]);
                monitorEvent.EventType       = SIPMonitorEventTypes.GetProxyEventType(eventFields[4]);
                monitorEvent.Created         = DateTimeOffset.ParseExact(eventFields[5], SERIALISATION_DATETIME_FORMAT,
                                                                         CultureInfo.InvariantCulture);

                string serverEndPointStr = eventFields[6];
                if (serverEndPointStr != null && serverEndPointStr.Trim().Length > 0)
                {
                    monitorEvent.ServerEndPoint = SIPEndPoint.ParseSIPEndPoint(serverEndPointStr);
                }

                string remoteEndPointStr = eventFields[7];
                if (remoteEndPointStr != null && remoteEndPointStr.Trim().Length > 0)
                {
                    monitorEvent.RemoteEndPoint = SIPEndPoint.ParseSIPEndPoint(remoteEndPointStr);
                }

                string dstEndPointStr = eventFields[8];
                if (dstEndPointStr != null && dstEndPointStr.Trim().Length > 0)
                {
                    monitorEvent.DestinationEndPoint = SIPEndPoint.ParseSIPEndPoint(dstEndPointStr);
                }

                monitorEvent.Username = eventFields[9];

                _ = int.TryParse(eventFields[10], out int _prcessID);

                monitorEvent.ProcessID = _prcessID;

                monitorEvent.Message = eventFields[11].Trim('#');

                return(monitorEvent);
            }
            catch (Exception excp)
            {
                Logger.Logger.Error("Exception SIPMonitorConsoleEvent ParseEventCSV. ->" + excp.Message);
                //logger.Error("Exception SIPMonitorConsoleEvent ParseEventCSV. " + excp.Message);
                return(null);
            }
        }