public SIPEndPoint ToSIPEndPoint() { if (IPSocket.IsIPSocket(Host) || IPSocket.IsIPAddress(Host)) { if (Host.IndexOf(":") != -1) { return(new SIPEndPoint(Protocol, IPSocket.GetIPEndPoint(Host))); } else { if (Protocol == SIPProtocolsEnum.tls) { return(new SIPEndPoint(Protocol, IPSocket.GetIPEndPoint(Host + ":" + m_defaultSIPTLSPort))); } else { return(new SIPEndPoint(Protocol, IPSocket.GetIPEndPoint(Host + ":" + m_defaultSIPPort))); } } } else { return(null); } }