コード例 #1
0
        public void ParseRouteWithDisplayNameTest()
        {
            Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

            SIPRoute route = SIPRoute.ParseSIPRoute("12345656 <sip:127.0.0.1:5060;lr>");

            Console.WriteLine("SIP Route=" + route.ToString() + ".");
            Console.WriteLine("Route to SIPEndPoint=" + route.ToSIPEndPoint().ToString() + ".");

            Assert.AreEqual(route.Host, "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.AreEqual(route.ToString(), "\"12345656\" <sip:127.0.0.1:5060;lr>", "The SIP route string was not correct.");
            Assert.IsFalse(route.IsStrictRouter, "Route was not correctly passed as a loose router.");
            Assert.AreEqual(route.ToSIPEndPoint().ToString(), "udp:127.0.0.1:5060", "The SIP route did not produce the correct SIP End Point.");
        }
コード例 #2
0
        public void ParseRouteWithDisplayNameTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            SIPRoute route = SIPRoute.ParseSIPRoute("12345656 <sip:127.0.0.1:5060;lr>");

            logger.LogDebug("SIP Route=" + route.ToString() + ".");
            logger.LogDebug("Route to SIPEndPoint=" + route.ToSIPEndPoint().ToString() + ".");

            Assert.True(route.Host == "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.True(route.ToString() == "\"12345656\" <sip:127.0.0.1:5060;lr>", "The SIP route string was not correct.");
            Assert.False(route.IsStrictRouter, "Route was not correctly passed as a loose router.");
            Assert.True(route.ToSIPEndPoint().ToString() == "udp:127.0.0.1:5060", "The SIP route did not produce the correct SIP End Point.");
        }
コード例 #3
0
        public void ParseRouteWithUserPortionTest()
        {
            Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

            string   routeStr = "<sip:[email protected]:5060;lr;transport=udp>";
            SIPRoute route    = SIPRoute.ParseSIPRoute(routeStr);

            Console.WriteLine("SIP Route=" + route.ToString() + ".");
            Console.WriteLine("Route to SIPEndPoint=" + route.ToSIPEndPoint().ToString() + ".");

            Assert.AreEqual(route.Host, "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.AreEqual(route.ToString(), routeStr, "The SIP route string was not correct.");
            Assert.IsFalse(route.IsStrictRouter, "Route was not correctly passed as a loose router.");
            Assert.AreEqual(route.ToSIPEndPoint().ToString(), "udp:127.0.0.1:5060", "The SIP route did not produce the correct SIP End Point.");
        }
コード例 #4
0
        public void ParseRouteWithUserPortionTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            string   routeStr = "<sip:[email protected]:5060;lr;transport=udp>";
            SIPRoute route    = SIPRoute.ParseSIPRoute(routeStr);

            logger.LogDebug("SIP Route=" + route.ToString() + ".");
            logger.LogDebug("Route to SIPEndPoint=" + route.ToSIPEndPoint().ToString() + ".");

            Assert.True(route.Host == "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.True(route.ToString() == routeStr, "The SIP route string was not correct.");
            Assert.False(route.IsStrictRouter, "Route was not correctly passed as a loose router.");
            Assert.True(route.ToSIPEndPoint().ToString() == "udp:127.0.0.1:5060", "The SIP route did not produce the correct SIP End Point.");
        }