当前位置: 首页>>代码示例>>C#>>正文


C# SIPTransport.SendRequest方法代码示例

本文整理汇总了C#中SIPSorcery.SIP.SIPTransport.SendRequest方法的典型用法代码示例。如果您正苦于以下问题:C# SIPTransport.SendRequest方法的具体用法?C# SIPTransport.SendRequest怎么用?C# SIPTransport.SendRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SIPSorcery.SIP.SIPTransport的用法示例。


在下文中一共展示了SIPTransport.SendRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: B2BOptionsStatefulProxyTest

            public void B2BOptionsStatefulProxyTest()
            {
                SIPTransactionEngine transactionEngine1 = new SIPTransactionEngine();
                SIPTransport sipTransport1 = new SIPTransport(SIPDNSManager.Resolve, transactionEngine1, true, false);
                sipTransport1.AddSIPChannel(new SIPUDPChannel(new IPEndPoint(IPAddress.Loopback, 3000)));
                SIPAppServerCore appServerCore1 = new SIPAppServerCore(sipTransport1, null, statefulProxyCore1_StatefulProxyLogEvent, null, null, null);

                SIPTransactionEngine transactionEngine2 = new SIPTransactionEngine();
                SIPTransport sipTransport2 = new SIPTransport(SIPDNSManager.Resolve, transactionEngine2, true, false);
                sipTransport2.AddSIPChannel(new SIPUDPChannel(new IPEndPoint(IPAddress.Loopback, 3001)));
                SIPAppServerCore appServerCore2 = new SIPAppServerCore(sipTransport2, null, statefulProxyCore2_StatefulProxyLogEvent, null, null, null);

                sipTransport1.SIPRequestOutTraceEvent += sipTransport1_SIPRequestOutTraceEvent;
                sipTransport1.SIPResponseInTraceEvent += sipTransport1_SIPResponseInTraceEvent;
                sipTransport2.SIPRequestInTraceEvent += sipTransport2_SIPRequestInTraceEvent;

                SIPRequest optionsRequest = GetOptionsRequest(SIPURI.ParseSIPURI("sip:127.0.0.1:3001"), 1, sipTransport1.GetDefaultTransportContact(SIPProtocolsEnum.udp).SocketEndPoint);
                sipTransport1.SendRequest(optionsRequest);

                Thread.Sleep(200);

                // Check the NUnit Console.Out to make sure there are SIP requests and responses being displayed.

                sipTransport1.Shutdown();
                sipTransport2.Shutdown();
            }
开发者ID:TilmannBach,项目名称:sipsorcery-fork,代码行数:26,代码来源:SIPAppServerCore.cs

示例2: B2BInviteStatefulProxyTest

            public void B2BInviteStatefulProxyTest()
            {
                SIPTransactionEngine transactionEngine1 = new SIPTransactionEngine();
                SIPTransport sipTransport1 = new SIPTransport(SIPDNSManager.Resolve, transactionEngine1, true, false);
                IPEndPoint sipTransport1EndPoint = new IPEndPoint(IPAddress.Loopback, 3000);
                sipTransport1.AddSIPChannel(new SIPUDPChannel(sipTransport1EndPoint));
                SIPAppServerCore statefulProxyCore1 = new SIPAppServerCore(sipTransport1, null, statefulProxyCore1_StatefulProxyLogEvent, null, null, null);

                SIPTransactionEngine transactionEngine2 = new SIPTransactionEngine();
                SIPTransport sipTransport2 = new SIPTransport(SIPDNSManager.Resolve, transactionEngine2, true, false);
                IPEndPoint sipTransport2EndPoint = new IPEndPoint(IPAddress.Loopback, 3001);
                sipTransport2.AddSIPChannel(new SIPUDPChannel(sipTransport2EndPoint));
                SIPAppServerCore statefulProxyCore2 = new SIPAppServerCore(sipTransport2, statefulProxyCore2_GetCanonicalDomain, statefulProxyCore2_StatefulProxyLogEvent, null, null, null);

                sipTransport1.SIPRequestOutTraceEvent += sipTransport1_SIPRequestOutTraceEvent;
                sipTransport1.SIPResponseInTraceEvent += sipTransport1_SIPResponseInTraceEvent;
                sipTransport2.SIPRequestInTraceEvent += sipTransport2_SIPRequestInTraceEvent;
                sipTransport2.SIPResponseOutTraceEvent += sipTransport2_SIPResponseOutTraceEvent;

                SIPRequest inviteRequest = GetInviteRequest(sipTransport1EndPoint, null, sipTransport2EndPoint);
                sipTransport1.SendRequest(inviteRequest);

                Thread.Sleep(200);

                // Check the NUnit Console.Out to make sure there are SIP requests and responses being displayed.

                sipTransport1.Shutdown();
                sipTransport2.Shutdown();
            }
开发者ID:TilmannBach,项目名称:sipsorcery-fork,代码行数:29,代码来源:SIPAppServerCore.cs


注:本文中的SIPSorcery.SIP.SIPTransport.SendRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。