SIPSorcery.SIP.SIPTransport.FindSIPChannel C# (CSharp) Method

FindSIPChannel() public method

Attempts to match a SIPChannel for this process that has the specified local end point and protocol.
public FindSIPChannel ( SIPEndPoint localSIPEndPoint ) : SIPChannel
localSIPEndPoint SIPEndPoint
return SIPChannel
        public SIPChannel FindSIPChannel(SIPEndPoint localSIPEndPoint)
        {
            //bool isEqual = (localSIPEndPoint == m_sipChannels.Keys.First<SIPEndPoint>());
            //logger.Debug("Searching for SIP channel for endpoint " + localSIPEndPoint.ToString() + ". First channel in transport list is " + m_sipChannels.Keys.First().ToString() + ". " + m_sipChannels.Keys.Contains(localSIPEndPoint) + ", " + isEqual);
            if (localSIPEndPoint == null)
            {
                return null;
            }
            else
            {
                if (m_sipChannels.ContainsKey(localSIPEndPoint.ToString()))
                {
                    return m_sipChannels[localSIPEndPoint.ToString()];
                }
                else
                {
                    logger.Warn("No SIP channel could be found for local SIP end point " + localSIPEndPoint.ToString() + ".");
                    return null;
                }
            }
        }