本文整理汇总了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();
}
}
示例2: IncomingMessage
public IncomingMessage(SIPChannel sipChannel, SIPEndPoint remoteEndPoint, byte[] buffer)
{
LocalSIPChannel = sipChannel;
RemoteEndPoint = remoteEndPoint;
Buffer = buffer;
ReceivedAt = DateTime.Now;
}
示例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;
}
示例4: SIPNonInviteTransaction_TransactionRequestReceived
private void SIPNonInviteTransaction_TransactionRequestReceived(SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPTransaction sipTransaction, SIPRequest sipRequest)
{
if (NonInviteRequestReceived != null)
{
NonInviteRequestReceived(localSIPEndPoint, remoteEndPoint, this, sipRequest);
}
}
示例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();
}
示例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);
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例13: IsAppServerEndPoint
public bool IsAppServerEndPoint(SIPEndPoint remoteEndPoint)
{
if (m_appServerEndPoints == null || m_appServerEndPoints.Count == 0)
{
return false;
}
else
{
return m_appServerEndPoints.ContainsKey(remoteEndPoint.ToString());
}
}
示例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);
}
示例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;
}