예제 #1
0
        public override string ToCSV()
        {
            try
            {
                string serverEndPointValue = (ServerEndPoint != null) ? ServerEndPoint.ToString() : null;
                string remoteEndPointValue = (RemoteEndPoint != null) ? RemoteEndPoint.ToString() : null;
                string dstEndPointValue    = (DestinationEndPoint != null) ? DestinationEndPoint.ToString() : null;

                string csvEvent =
                    SERIALISATION_PREFIX + "|" +
                    SessionID + "|" +
                    MonitorServerID + "|" +
                    ServerType + "|" +
                    EventType + "|" +
                    Created.ToString(SERIALISATION_DATETIME_FORMAT) + "|" +
                    serverEndPointValue + "|" +
                    remoteEndPointValue + "|" +
                    dstEndPointValue + "|" +
                    Username + "|" +
                    ProcessID + "|" +
                    Message + END_MESSAGE_DELIMITER;

                return(csvEvent);
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPMonitorConsoleEvent ToCSV. " + excp.Message);
                return(null);
            }
        }
예제 #2
0
        public static ConnectionId Generate(ServerEndPoint reflexive, IPEndPoint local)
        {
            if (sha1 == null)
                sha1 = new HMACSHA1(sha1Key);

            string hashData = reflexive.ToString() + local.ToString() + Interlocked.Increment(ref count).ToString();

            var bytes = sha1.ComputeHash(Encoding.UTF8.GetBytes(hashData));

            return new ConnectionId()
            {
                Value1 = BitConverter.ToInt64(bytes, 0),
                Value2 = BitConverter.ToInt64(bytes, 8),
                Value3 = BitConverter.ToInt32(bytes, 16),
            };
        }
예제 #3
0
        public static ConnectionId Generate(ServerEndPoint reflexive, IPEndPoint local)
        {
            if (sha1 == null)
            {
                sha1 = new HMACSHA1(sha1Key);
            }

            string hashData = reflexive.ToString() + local.ToString() + Interlocked.Increment(ref count).ToString();

            var bytes = sha1.ComputeHash(Encoding.UTF8.GetBytes(hashData));

            return(new ConnectionId()
            {
                Value1 = BitConverter.ToInt64(bytes, 0),
                Value2 = BitConverter.ToInt64(bytes, 8),
                Value3 = BitConverter.ToInt32(bytes, 16),
            });
        }
예제 #4
0
 private string GetKey(ServerEndPoint local, IPEndPoint remote)
 {
     return local.ToString() + @"|" + remote.ToString();
 }
예제 #5
0
 private string GetKey(ServerEndPoint local, IPEndPoint remote)
 {
     return(local.ToString() + @"|" + remote.ToString());
 }