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); } }
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), }; }
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), }); }
private string GetKey(ServerEndPoint local, IPEndPoint remote) { return local.ToString() + @"|" + remote.ToString(); }
private string GetKey(ServerEndPoint local, IPEndPoint remote) { return(local.ToString() + @"|" + remote.ToString()); }