private static List<SIPEndPoint> GetSIPEndPoints(string sipSocketString, SIPProtocolsEnum sipProtocol)
{
if (sipSocketString == null)
{
return null;
}
else
{
int port = IPSocket.ParsePortFromSocket(sipSocketString);
if (port == 0)
{
port = (sipProtocol == SIPProtocolsEnum.tls) ? m_defaultSIPTLSPort : m_defaultSIPPort;
}
if (sipSocketString.StartsWith(m_allIPAddresses))
{
List<SIPEndPoint> sipEndPoints = new List<SIPEndPoint>();
foreach (IPAddress ipAddress in m_localIPAddresses)
{
sipEndPoints.Add(new SIPEndPoint(sipProtocol, new IPEndPoint(ipAddress, port)));
}
return sipEndPoints;
}
else
{
IPAddress ipAddress = IPAddress.Parse(IPSocket.ParseHostFromSocket(sipSocketString));
return new List<SIPEndPoint>() { new SIPEndPoint(sipProtocol, new IPEndPoint(ipAddress, port)) };
}
}
}