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


C# SIPTransport.CreateNonInviteTransaction方法代码示例

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


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

示例1: GetDialogueId

        /*public static string GetDialogueId(string callId, string localTag, string remoteTag)
        {
            return Crypto.GetSHAHashAsString(callId + localTag + remoteTag);
        }

        public static string GetDialogueId(SIPHeader sipHeader)
        {
            return Crypto.GetSHAHashAsString(sipHeader.CallId + sipHeader.To.ToTag + sipHeader.From.FromTag);
        }*/

        public void Hangup(SIPTransport sipTransport, SIPEndPoint outboundProxy)
        {
            try
            {
                SIPEndPoint byeOutboundProxy = null;
                if (outboundProxy != null && IPAddress.IsLoopback(outboundProxy.Address))
                {
                    byeOutboundProxy = outboundProxy;
                }
                else if (!ProxySendFrom.IsNullOrBlank())
                {
                    byeOutboundProxy = new SIPEndPoint(new IPEndPoint(SIPEndPoint.ParseSIPEndPoint(ProxySendFrom).Address, m_defaultSIPPort));
                }
                else if (outboundProxy != null)
                {
                    byeOutboundProxy = outboundProxy;
                }

                SIPEndPoint localEndPoint = (byeOutboundProxy != null) ? sipTransport.GetDefaultSIPEndPoint(byeOutboundProxy.Protocol) : sipTransport.GetDefaultSIPEndPoint(GetRemoteTargetProtocol());
                SIPRequest byeRequest = GetByeRequest(localEndPoint);
                SIPNonInviteTransaction byeTransaction = sipTransport.CreateNonInviteTransaction(byeRequest, null, localEndPoint, byeOutboundProxy);
                byeTransaction.SendReliableRequest();
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPDialogue Hangup. " + excp.Message);
                throw;
            }
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:39,代码来源:SIPDialogue.cs

示例2: Transfer

        public void Transfer(SIPTransport sipTransport, SIPURI referTo, Boolean unattended, SIPEndPoint outboundProxy)
        {
            if (!unattended)
            {
                throw new NotImplementedException();
            }
            else
            {
                TransferMode = SIPDialogueTransferModesEnum.PassThru;
                try
                {
                    SIPEndPoint referOutboundProxy = null;
                    if (outboundProxy != null && IPAddress.IsLoopback(outboundProxy.Address))
                    {
                        referOutboundProxy = outboundProxy;
                    }
                    else if (!ProxySendFrom.IsNullOrBlank())
                    {
                        referOutboundProxy = new SIPEndPoint(new IPEndPoint(SIPEndPoint.ParseSIPEndPoint(ProxySendFrom).Address, m_defaultSIPPort));
                    }
                    else if (outboundProxy != null)
                    {
                        referOutboundProxy = outboundProxy;
                    }

                    SIPEndPoint localEndPoint = (referOutboundProxy != null) ? sipTransport.GetDefaultSIPEndPoint(referOutboundProxy.Protocol) : sipTransport.GetDefaultSIPEndPoint(GetRemoteTargetProtocol());
                    SIPRequest referRequest = GetReferRequest(localEndPoint, referTo);
                    SIPNonInviteTransaction referTransaction = sipTransport.CreateNonInviteTransaction(referRequest, null, localEndPoint, referOutboundProxy);
                    referTransaction.NonInviteTransactionFinalResponseReceived += referTransaction_NonInviteTransactionFinalResponseReceived;
                    referTransaction.SendReliableRequest();
                }
                catch (Exception excp)
                {
                    logger.Error("Exception SIPDialogue Transfer. " + excp.Message);
                    throw;
                }
            }
        }
开发者ID:TilmannBach,项目名称:sipsorcery-fork,代码行数:38,代码来源:SIPDialogue.cs


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