Beispiel #1
0
        public void ParseRouteWithDoubleQuotedDisplayNameTest()
        {
            Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

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

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

            Assert.AreEqual(route.Host, "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.AreEqual(route.ToString(), "\"Joe Bloggs\" <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.");
        }
Beispiel #2
0
        public void ParseRouteTest()
        {
            Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

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

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

            Assert.True(route.Host == "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.True(route.ToString() == "<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.");
        }
Beispiel #3
0
        public void ParseRouteWithDoubleQuotedDisplayNameTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

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

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

            Assert.True(route.Host == "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.True(route.ToString() == "\"Joe Bloggs\" <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.");
        }
Beispiel #4
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.");
        }
Beispiel #5
0
        public void RemoveLooseRouterTest()
        {
            Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);

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

            route.IsStrictRouter = true;

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

            Assert.AreEqual(route.Host, "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.AreEqual(route.ToString(), "<sip:127.0.0.1:5060>", "The SIP route string was not correct.");
            Assert.IsTrue(route.IsStrictRouter, "Route was not correctly settable as a strict router.");
        }
Beispiel #6
0
        public void RemoveLooseRouterTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

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

            route.IsStrictRouter = true;

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

            Assert.True(route.Host == "127.0.0.1:5060", "The SIP route host was not parsed correctly.");
            Assert.True(route.ToString() == "<sip:127.0.0.1:5060>", "The SIP route string was not correct.");
            Assert.True(route.IsStrictRouter, "Route was not correctly settable as a strict router.");
        }
Beispiel #7
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.");
        }
Beispiel #8
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.");
        }