• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SIP.SIPEndPoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



SIPEndPoint类属于SIPSorcery.SIP命名空间,在下文中一共展示了SIPEndPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RecordDispatch

        public void RecordDispatch(SIPRequest sipRequest, SIPEndPoint internalEndPoint)
        {
            lock(m_transactionEndPoints)
            {
                if (m_transactionEndPoints.ContainsKey(sipRequest.Header.CallId))
                {
                    if (m_transactionEndPoints[sipRequest.Header.CallId] == internalEndPoint.ToString())
                    {
                        // The application server end point has not changed for this Call-Id
                        return;
                    }
                    else
                    {
                        // The application server end point has changed within the lifetime of the Call-Id. Remove the old mapping.
                        lock (m_transactionEndPoints)
                        {
                            m_transactionEndPoints.Remove(sipRequest.Header.CallId);
                        }
                    }
                }

                m_transactionEndPoints.Add(sipRequest.Header.CallId, internalEndPoint.ToString());
                m_transactionIDAddedAt.Add(sipRequest.Header.CallId, DateTime.Now);
                //ProxyLogger_External(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.SIPProxy, SIPMonitorEventTypesEnum.CallDispatcher, "Record dispatch for " + sipRequest.Method + " " + sipRequest.URI.ToString() + " to " + internalEndPoint.ToString() + " (id=" + transactionID + ").", null));
            }

            if (m_lastRemove < DateTime.Now.AddSeconds(REMOVE_EXPIREDS_SECONDS * -1))
            {
                RemoveExpiredDispatchRecords();
            }
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:31,代码来源:SIPProxyDispatcher.cs


示例2: IncomingMessage

		public IncomingMessage(SIPChannel sipChannel, SIPEndPoint remoteEndPoint, byte[] buffer)
		{
            LocalSIPChannel = sipChannel;
            RemoteEndPoint = remoteEndPoint;
			Buffer = buffer;
            ReceivedAt = DateTime.Now;
		}
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:7,代码来源:SIPChannel.cs


示例3: UASInviteTransaction

        internal UASInviteTransaction(
            SIPTransport sipTransport,
            SIPRequest sipRequest,
            SIPEndPoint dstEndPoint,
            SIPEndPoint localSIPEndPoint,
            SIPEndPoint outboundProxy)
            : base(sipTransport, sipRequest, dstEndPoint, localSIPEndPoint, outboundProxy)
        {
            TransactionType = SIPTransactionTypesEnum.Invite;
            m_remoteTag = sipRequest.Header.From.FromTag;

            if (sipRequest.Header.To.ToTag == null)
            {
                // This UAS needs to set the To Tag.
                m_localTag = CallProperties.CreateNewTag();
            }
            else
            {
                // This is a re-INVITE.
                m_localTag = sipRequest.Header.To.ToTag;
            }

            //logger.Debug("New UASTransaction (" + TransactionId + ") for " + TransactionRequest.URI.ToString() + " to " + RemoteEndPoint + ".");

            CDR = new SIPCDR(SIPCallDirection.In, sipRequest.URI, sipRequest.Header.From, sipRequest.Header.CallId, LocalSIPEndPoint, dstEndPoint);

            //UpdateTransactionState(SIPTransactionStatesEnum.Proceeding);

            TransactionRequestReceived += UASInviteTransaction_TransactionRequestReceived;
            TransactionInformationResponseReceived += UASInviteTransaction_TransactionResponseReceived;
            TransactionFinalResponseReceived += UASInviteTransaction_TransactionResponseReceived;
            TransactionTimedOut += UASInviteTransaction_TransactionTimedOut;
            TransactionRemoved += UASInviteTransaction_TransactionRemoved;
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:34,代码来源:UASInviteTransaction.cs


示例4: SIPNonInviteTransaction_TransactionRequestReceived

 private void SIPNonInviteTransaction_TransactionRequestReceived(SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPTransaction sipTransaction, SIPRequest sipRequest)
 {
     if (NonInviteRequestReceived != null)
     {
         NonInviteRequestReceived(localSIPEndPoint, remoteEndPoint, this, sipRequest);
     }
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:7,代码来源:SIPNonInviteTransaction.cs


示例5: SIPTCPChannel

        private Dictionary<string, DateTime> m_connectionFailures = new Dictionary<string, DateTime>(); // Tracks sockets that have had a connection failure on them to avoid endless re-connect attmepts.

        public SIPTCPChannel(IPEndPoint endPoint)
        {
            m_localSIPEndPoint = new SIPEndPoint(SIPProtocolsEnum.tcp, endPoint);
            LocalTCPSockets.Add(endPoint.ToString());
            m_isReliable = true;
            Initialise();
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:9,代码来源:SIPTCPChannel.cs


示例6: SIPCancelTransaction_TransactionRequestReceived

        private void SIPCancelTransaction_TransactionRequestReceived(SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPTransaction sipTransaction, SIPRequest sipRequest)
        {
            try
            {
                //logger.Debug("CANCEL request received, attempting to locate and cancel transaction.");

                //UASInviteTransaction originalTransaction = (UASInviteTransaction)GetTransaction(GetRequestTransactionId(sipRequest.Header.Via.TopViaHeader.Branch, SIPMethodsEnum.INVITE));

                SIPResponse cancelResponse;

                if (m_originalTransaction != null)
                {
                    //logger.Debug("Transaction found to cancel " + originalTransaction.TransactionId + " type " + originalTransaction.TransactionType + ".");
                    m_originalTransaction.CancelCall();
                    cancelResponse = GetCancelResponse(sipRequest, SIPResponseStatusCodesEnum.Ok);
                }
                else
                {
                    cancelResponse = GetCancelResponse(sipRequest, SIPResponseStatusCodesEnum.CallLegTransactionDoesNotExist);
                }

                //UpdateTransactionState(SIPTransactionStatesEnum.Completed);
                SendFinalResponse(cancelResponse);
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPCancelTransaction GotRequest. " + excp.Message);
            }
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:29,代码来源:SIPCancelTransaction.cs


示例7: SIPAppServerWorker

 public SIPAppServerWorker(XmlNode xmlConfigNode)
 {
     WorkerProcessPath = xmlConfigNode.SelectSingleNode("workerprocesspath").InnerText;
     WorkerProcessArgs = xmlConfigNode.SelectSingleNode("workerprocessargs").InnerText;
     AppServerEndpoint = SIPEndPoint.ParseSIPEndPoint(xmlConfigNode.SelectSingleNode("sipsocket").InnerText);
     CallManagerAddress = new EndpointAddress(xmlConfigNode.SelectSingleNode("callmanageraddress").InnerText);
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:7,代码来源:SIPAppServerManager.cs


示例8: SIPAppServerCore

        //private SIPNotifyManager m_notifyManager;

        public SIPAppServerCore(
            SIPTransport sipTransport,
            GetCanonicalDomainDelegate getCanonicalDomain,
            SIPAssetGetDelegate<SIPAccount> getSIPAccount,
            SIPMonitorLogDelegate proxyLog,
            SIPCallManager callManager,
            SIPDialogueManager sipDialogueManager,
            //SIPNotifyManager notifyManager,
            SIPAuthenticateRequestDelegate sipAuthenticateRequest,
            SIPEndPoint outboundProxy)
        {
            try
            {
                m_sipTransport = sipTransport;
                m_callManager = callManager;
                m_sipDialogueManager = sipDialogueManager;
                //m_notifyManager = notifyManager;

                m_sipTransport.SIPTransportRequestReceived += GotRequest;
                m_sipTransport.SIPTransportResponseReceived += GotResponse;

                m_outboundProxy = outboundProxy;

                GetCanonicalDomain_External = getCanonicalDomain;
                GetSIPAccount_External = getSIPAccount;
                SIPMonitorLogEvent_External = proxyLog;
                SIPRequestAuthenticator_External = sipAuthenticateRequest;
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPAppServerCore (ctor). " + excp.Message);
                throw excp;
            }
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:36,代码来源:SIPAppServerCore.cs


示例9: ParseNATKeepAliveMessage

        public static NATKeepAliveMessage ParseNATKeepAliveMessage(byte[] buffer)
        {
            if (buffer != null && buffer.Length == 20)
            {
                byte[] sendToAddrBuffer = new byte[4];
                Buffer.BlockCopy(buffer, 0, sendToAddrBuffer, 0, 4);
                IPAddress sendToAddress = new IPAddress(sendToAddrBuffer);
                int sendToPort = BitConverter.ToInt32(buffer, 4);

                int proxyProtocol = BitConverter.ToInt32(buffer, 8);
                byte[] proxyFromAddrBuffer = new byte[4];
                Buffer.BlockCopy(buffer, 12, proxyFromAddrBuffer, 0, 4);
                int sendFromPort = BitConverter.ToInt32(buffer, 16);
                SIPEndPoint proxySendFrom = new SIPEndPoint((SIPProtocolsEnum)proxyProtocol, new IPEndPoint(new IPAddress(proxyFromAddrBuffer), sendFromPort));


                //SIPProtocolsEnum protocol = SIPProtocolsType.GetProtocolTypeFromId(BitConverter.ToInt32(buffer, 16));
                //SIPProtocolsEnum protocol = SIPProtocolsEnum.udp;

                NATKeepAliveMessage natKeepAliveMsg = new NATKeepAliveMessage(proxySendFrom, new IPEndPoint(sendToAddress, sendToPort));
                return natKeepAliveMsg;
            }
            else
            {
                return null;
            }
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:27,代码来源:NATKeepAliveRelay.cs


示例10: NATKeepAliveJob

            public bool Cancel;                 // If set to true indicates the NAT keep alive job should be removed.

            public NATKeepAliveJob(SIPEndPoint proxyEndPoint, SIPEndPoint remoteEndPoint, DateTime endTime, string owner)
            {
                ProxyEndPoint = proxyEndPoint;
                RemoteEndPoint = remoteEndPoint;
                NextSendTime = null;
                EndTime = endTime;
                Owner = owner;
                Cancel = false;
            }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:11,代码来源:SIPRegistrarBindingsManager.cs


示例11: SIPCancelTransaction

 internal SIPCancelTransaction(SIPTransport sipTransport, SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, UASInviteTransaction originalTransaction)
     : base(sipTransport, sipRequest, dstEndPoint, localSIPEndPoint, originalTransaction.OutboundProxy)
 {
     m_originalTransaction = originalTransaction;
     TransactionType = SIPTransactionTypesEnum.NonInvite;
     TransactionRequestReceived += SIPCancelTransaction_TransactionRequestReceived;
     TransactionFinalResponseReceived += SIPCancelTransaction_TransactionFinalResponseReceived;
     TransactionRemoved += SIPCancelTransaction_TransactionRemoved;
 }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:9,代码来源:SIPCancelTransaction.cs


示例12: SIPNonInviteTransaction

 internal SIPNonInviteTransaction(SIPTransport sipTransport, SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy)
     : base(sipTransport, sipRequest, dstEndPoint, localSIPEndPoint, outboundProxy)
 {
     TransactionType = SIPTransactionTypesEnum.NonInvite;
     TransactionRequestReceived += SIPNonInviteTransaction_TransactionRequestReceived;
     TransactionInformationResponseReceived += SIPNonInviteTransaction_TransactionInformationResponseReceived;
     TransactionFinalResponseReceived += SIPNonInviteTransaction_TransactionFinalResponseReceived;
     TransactionTimedOut += SIPNonInviteTransaction_TransactionTimedOut;
     TransactionRemoved += SIPNonInviteTransaction_TransactionRemoved;
     TransactionRequestRetransmit += SIPNonInviteTransaction_TransactionRequestRetransmit;
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:11,代码来源:SIPNonInviteTransaction.cs


示例13: IsAppServerEndPoint

 public bool IsAppServerEndPoint(SIPEndPoint remoteEndPoint)
 {
     if (m_appServerEndPoints == null || m_appServerEndPoints.Count == 0)
     {
         return false;
     }
     else
     {
         return m_appServerEndPoints.ContainsKey(remoteEndPoint.ToString());
     }
 }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:11,代码来源:SIPCallDispatcherFile.cs


示例14: GoogleVoiceUserAgent

 public GoogleVoiceUserAgent(
     SIPTransport sipTransport,
     ISIPCallManager callManager,
     SIPMonitorLogDelegate logDelegate,
     string username,
     string adminMemberId,
     SIPEndPoint outboundProxy)
 {
     Owner = username;
     AdminMemberId = adminMemberId;
     m_googleVoiceCall = new GoogleVoiceCall(sipTransport, callManager, logDelegate, username, adminMemberId, outboundProxy);
     m_googleVoiceCall.CallProgress += new CallProgressDelegate(CallProgress);
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:13,代码来源:GoogleVoiceUserAgent.cs


示例15: UACInviteTransaction

        internal UACInviteTransaction(SIPTransport sipTransport, SIPRequest sipRequest, SIPEndPoint dstEndPoint, SIPEndPoint localSIPEndPoint, SIPEndPoint outboundProxy)
            : base(sipTransport, sipRequest, dstEndPoint, localSIPEndPoint, outboundProxy)
        {
            TransactionType = SIPTransactionTypesEnum.Invite;
            m_localTag = sipRequest.Header.From.FromTag;
            CDR = new SIPCDR(SIPCallDirection.Out, sipRequest.URI, sipRequest.Header.From, sipRequest.Header.CallId, localSIPEndPoint, dstEndPoint);

            TransactionFinalResponseReceived += UACInviteTransaction_TransactionFinalResponseReceived;
            TransactionInformationResponseReceived += UACInviteTransaction_TransactionInformationResponseReceived;
            TransactionTimedOut += UACInviteTransaction_TransactionTimedOut;
            TransactionRequestReceived += UACInviteTransaction_TransactionRequestReceived;
            TransactionRemoved += UACInviteTransaction_TransactionRemoved;
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:13,代码来源:UACInviteTransaction.cs


示例16: SIPCancelTransaction_TransactionFinalResponseReceived

 private void SIPCancelTransaction_TransactionFinalResponseReceived(SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPTransaction sipTransaction, SIPResponse sipResponse)
 {
     if (sipResponse.StatusCode < 200)
     {
         logger.Warn("A SIP CANCEL transaction received an unexpected SIP information response " + sipResponse.ReasonPhrase + ".");
     }
     else
     {
         if (CancelTransactionFinalResponseReceived != null)
         {
             CancelTransactionFinalResponseReceived(localSIPEndPoint, remoteEndPoint, sipTransaction, sipResponse);
         }
     }
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:14,代码来源:SIPCancelTransaction.cs


示例17: IsSIPEndPointMonitored

        public override bool IsSIPEndPointMonitored(SIPEndPoint sipEndPoint)
        {
            lock (m_activeAppServerEntry)
            {
                foreach (AppServerEntry appServerEntry in m_appServerEntries)
                {
                    if (new SIPEndPoint(appServerEntry.AppServerURI).ToString() == sipEndPoint.ToString())
                    {
                        return true;
                    }
                }
            }

            return false;
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:15,代码来源:AppServerDispatcher.cs


示例18: DialPlanScriptContext

 public DialPlanScriptContext(           
     SIPMonitorLogDelegate monitorLogDelegate,
     SIPTransport sipTransport,
     DialogueBridgeCreatedDelegate createBridge,
     SIPEndPoint outboundProxy,
     ISIPServerUserAgent sipServerUserAgent,
     SIPDialPlan dialPlan,
     List<SIPProvider> sipProviders,
     string traceDirectory,
     string callersNetworkId,
     Guid customerId)
     : base(monitorLogDelegate, sipTransport, createBridge, outboundProxy, sipServerUserAgent, dialPlan, sipProviders, traceDirectory, callersNetworkId, customerId)
 {
     ContextType = DialPlanContextsEnum.Script;
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:15,代码来源:DialPlanScriptContext.cs


示例19: SIPNonInviteClientUserAgent

        public SIPNonInviteClientUserAgent(
            SIPTransport sipTransport,
            SIPEndPoint outboundProxy,
            SIPCallDescriptor callDescriptor,
            string owner,
            string adminMemberID,
            SIPMonitorLogDelegate logDelegate)
        {
            m_sipTransport = sipTransport;
            m_outboundProxy = outboundProxy;
            m_callDescriptor = callDescriptor;
            m_owner = owner;
            m_adminMemberID = adminMemberID;

            Log_External = logDelegate;
        }
开发者ID:TilmannBach,项目名称:sipsorcery-fork,代码行数:16,代码来源:SIPNonInviteClientUserAgent.cs


示例20: DialPlanLineContext

 public DialPlanLineContext(
     SIPMonitorLogDelegate monitorLogDelegate,
     SIPTransport sipTransport,
     DialogueBridgeCreatedDelegate createBridge,
     SIPEndPoint outboundProxy,
     ISIPServerUserAgent sipServerUserAgent,
     SIPDialPlan dialPlan,
     List<SIPProvider> sipProviders,
     string traceDirectory,
     string callersNetworkId,
     Customer customer)
     : base(monitorLogDelegate, sipTransport, createBridge, outboundProxy, sipServerUserAgent, dialPlan, sipProviders, traceDirectory, callersNetworkId, customer, null, null)
 {
     ContextType = DialPlanContextsEnum.Line;
      string[] dialPlanEntries = dialPlan.DialPlanScript.Split(new char[] { '\n' });
      ParseDialPlan(dialPlanEntries);
 }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:17,代码来源:DialPlanLineContext.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SIP.SIPRequest类代码示例发布时间:2022-05-26
下一篇:
C# Entities.SIPSorceryEntities类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap