コード例 #1
0
        public void NoMangleIPv6UnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            SIPURI uri     = SIPURI.ParseSIPURI("sip:user@[2001:730:3ec2::10]:5060?Replaces=xyz");
            SIPURI mangled = SIPURI.Mangle(uri, IPSocket.Parse("67.222.131.147:5060"));

            Assert.Null(mangled);

            logger.LogDebug("-----------------------------------------");
        }
コード例 #2
0
        public void NoMangleSameAddressUnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            SIPURI uri     = SIPURI.ParseSIPURI("sip:[email protected]:5060?Replaces=xyz");
            SIPURI mangled = SIPURI.Mangle(uri, IPSocket.Parse("192.168.0.50:5060"));

            Assert.Null(mangled);

            logger.LogDebug("-----------------------------------------");
        }
コード例 #3
0
        public void MangleReceiveOnIPv6UnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            SIPURI uri     = SIPURI.ParseSIPURI("sip:[email protected]:5060?Replaces=xyz");
            SIPURI mangled = SIPURI.Mangle(uri, IPSocket.Parse("[2001:730:3ec2::10]:5090"));

            logger.LogDebug($"Mangled URI {mangled}.");

            Assert.NotNull(mangled);
            Assert.Equal("sip:user@[2001:730:3ec2::10]:5090?Replaces=xyz", mangled.ToString());

            logger.LogDebug("-----------------------------------------");
        }
コード例 #4
0
        public void MangleNoPortUnitTest()
        {
            logger.LogDebug("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
            logger.BeginScope(System.Reflection.MethodBase.GetCurrentMethod().Name);

            SIPURI uri     = SIPURI.ParseSIPURI("sip:[email protected]?Replaces=xyz");
            SIPURI mangled = SIPURI.Mangle(uri, IPSocket.Parse("67.222.131.147:5090"));

            logger.LogDebug($"Mangled URI {mangled}.");

            Assert.NotNull(mangled);
            Assert.Equal("sip:[email protected]:5090?Replaces=xyz", mangled.ToString());

            logger.LogDebug("-----------------------------------------");
        }