GetDefaultSIPEndPoint() публичный Метод

public GetDefaultSIPEndPoint ( ) : SIPEndPoint
Результат SIPEndPoint
Пример #1
0
        /*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;
            }
        }
Пример #2
0
        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;
                }
            }
        }