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


C# SIP.SIPEndPoint类代码示例

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


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


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