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


C# SIP.SIPTransport类代码示例

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


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

示例1: 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

示例2: AppServerDispatcher

        public AppServerDispatcher(SIPTransport sipTransport, XmlNode configNode)
            : base(sipTransport, configNode)
        {
            try
            {

                XmlNodeList appServerNodes = configNode.SelectNodes("appserver");
                foreach (XmlNode appServerNode in appServerNodes)
                {
                    int priority = Convert.ToInt32(appServerNode.Attributes.GetNamedItem("priority").Value);
                    SIPURI serverURI = SIPURI.ParseSIPURIRelaxed(appServerNode.InnerText);
                    AppServerEntry appServerEntry = new AppServerEntry(priority, serverURI);
                    m_appServerEntries.Add(appServerEntry);
                }

                //if (configNode.SelectSingleNode("outboundproxy") != null && !configNode.SelectSingleNode("outboundproxy").InnerText.IsNullOrBlank()) {
                //    m_outboundProxy = SIPEndPoint.ParseSIPEndPoint(configNode.SelectSingleNode("outboundproxy").InnerText);
                //}

                if (configNode.SelectSingleNode("interval") != null && !configNode.SelectSingleNode("interval").InnerText.IsNullOrBlank())
                {
                    if (!TimeSpan.TryParse(configNode.SelectSingleNode("interval").InnerText, out m_interval))
                    {
                        logger.Warn("AppServerDispatcher interval could not be parsed from " + configNode.SelectSingleNode("interval").InnerText + ".");
                    }
                }
            }
            catch (Exception excp)
            {
                logger.Error("Exception AppServerDispatcher. " + excp.Message);
                throw;
            }
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:33,代码来源:AppServerDispatcher.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: CreateJob

        public static SIPDispatcherJob CreateJob(string jobClass, XmlNode configNode, SIPTransport sipTransport) {

            SIPDispatcherJob job = null;

            if (jobClass != null) {
                try {
                    Type jobType = Type.GetType(jobClass);
                    job = (SIPDispatcherJob)Activator.CreateInstance(jobType, new object[] { sipTransport, configNode });
                    logger.Debug("A SIPDispatcherJob of type, " + jobClass + ", was created.");
                }
                catch (ArgumentNullException nullExcp) {
                    logger.Error("ArgumentNullException attempting to create a SIPDispatcherJob instance of type, " + jobClass + ". " + nullExcp.Message);
                    throw new ApplicationException("Unable to create SIPDispatcherJob of type " + jobClass + ". Check that the assembly is available and the class exists.");
                }
                catch (Exception excp) {
                    logger.Error("Exception attempting to create a SIPDispatcherJobinstance of type, " + jobClass + ". " + excp.Message);
                    throw excp;
                }
            }
            else {
                throw new ApplicationException("No class element existed to create a SIPDispatcherJob from.");
            }

            return job;
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:25,代码来源:SIPDispatcherJobFactory.cs

示例5: Start

        public void Start()
        {
            try
            {
                logger.Debug("WatchTowerDaemon starting...");

                // Send events from this process to the monitoring socket.
                if (m_monitorEventLoopbackPort != 0)
                {
                    m_monitorEventWriter = new SIPMonitorEventWriter(m_monitorEventLoopbackPort);
                }

                List<SIPChannel> sipChannels = SIPTransportConfig.ParseSIPChannelsNode(m_transportNode);
                m_sipTransport = new SIPTransport(SIPDNSManager.ResolveSIPService, new SIPTransactionEngine());
                m_sipTransport.AddSIPChannel(sipChannels);

                if (m_sipAppServerWorkersNode != null)
                {
                    m_appServerManager = new SIPAppServerManager(
                        FireSIPMonitorEvent,
                        m_sipTransport,
                        m_sipAppServerWorkersNode,
                        m_proxyAppServerEndPointsPath);
                }

                //m_sipTransport.SIPTransportRequestReceived += GotRequest;
                //m_sipTransport.SIPTransportResponseReceived += GotResponse;
            }
            catch (Exception excp)
            {
                logger.Error("Exception WatchTowerDaemon Start. " + excp.Message);
            }
        }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:33,代码来源:WatchTowerDaemon.cs

示例6: Start

        public void Start()
        {
            try
            {
                logger.Debug("RTCC Daemon starting...");

                // Pre-flight checks.
                if (m_rtccSIPSocketsNode == null || m_rtccSIPSocketsNode.ChildNodes.Count == 0)
                {
                    throw new ApplicationException("The RTCC server cannot start without a SIP socket, please check config file.");
                }

                // Send events from this process to the monitoring socket.
                if (m_monitorLoopbackPort != 0)
                {
                    // Events will be sent by the monitor channel to the loopback interface and this port.
                    m_monitorEventWriter = new SIPMonitorEventWriter(m_monitorLoopbackPort);
                    logger.Debug("Monitor channel initialised for 127.0.0.1:" + m_monitorLoopbackPort + ".");
                }

                // Configure the SIP transport layer.
                m_sipTransport = new SIPTransport(SIPDNSManager.ResolveSIPService, new SIPTransactionEngine(), false);
                List<SIPChannel> sipChannels = SIPTransportConfig.ParseSIPChannelsNode(m_rtccSIPSocketsNode);
                m_sipTransport.AddSIPChannel(sipChannels);

                if (m_cdrDataLayer != null)
                {
                    SIPCDR.CDRCreated += m_cdrDataLayer.Add;
                    SIPCDR.CDRAnswered += m_cdrDataLayer.Update;
                    SIPCDR.CDRHungup += m_cdrDataLayer.Update;
                    SIPCDR.CDRUpdated += m_cdrDataLayer.Update;
                }

                m_sipDialogueManager = new SIPDialogueManager(
                     m_sipTransport,
                     m_outboundProxy,
                     FireSIPMonitorEvent,
                     m_sipSorceryPersistor.SIPDialoguePersistor,
                     m_sipSorceryPersistor.SIPCDRPersistor,
                     SIPRequestAuthenticator.AuthenticateSIPRequest,
                     m_sipSorceryPersistor.SIPAccountsPersistor.Get,
                     m_sipSorceryPersistor.SIPDomainManager.GetDomain);

                m_rtccCore = new RTCCCore(
                    FireSIPMonitorEvent,
                    m_sipDialogueManager,
                    m_sipSorceryPersistor.SIPDialoguePersistor);
                m_rtccCore.Start();

                m_rateUpdater = new RateBulkUpdater(FireSIPMonitorEvent);
                m_rateUpdater.Start();

                logger.Debug("RTCC Daemon successfully started.");
            }
            catch (Exception excp)
            {
                logger.Error("Exception RTCCDaemon Start. " + excp.Message);
            }
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:59,代码来源:RTCCDaemon.cs

示例7: 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

示例8: SIPProxyScriptFacade

 public SIPProxyScriptFacade(
     SIPMonitorLogDelegate proxyLogger,
     SIPTransport sipTransport,
     SIPProxyDispatcher dispatcher,
     GetAppServerDelegate getAppServer)
 {
     m_proxyLogger = proxyLogger;
     m_sipTransport = sipTransport;
     m_dispatcher = dispatcher;
     GetAppServer_External = getAppServer;
 }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:11,代码来源:SIPProxyScriptFacade.cs

示例9: 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

示例10: SIPToXMPPCall

        public SIPToXMPPCall(SIPServerUserAgent uas, XMPPPhoneSession xmppCall, SIPTransport sipTransport, IPAddress ipAddress)
        {
            m_uas = uas;
            m_xmppCall = xmppCall;
            m_sipTransport = sipTransport;
            m_ipAddress = ipAddress;

            m_uas.CallCancelled += SIPCallCancelled;
            m_xmppCall.Accepted += Answered;
            m_xmppCall.Rejected += CallFailed;
            m_xmppCall.Hungup += Hangup;
        }
开发者ID:sipsorcery,项目名称:sipsorcery,代码行数:12,代码来源:SIPToXMPPCall.cs

示例11: 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

示例12: 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

示例13: GoogleVoiceCall

 public GoogleVoiceCall(
     SIPTransport sipTransport,
     ISIPCallManager callManager,
     SIPMonitorLogDelegate logDelegate,
     string username,
     string adminMemberId,
     SIPEndPoint outboundProxy)
 {
     m_sipTransport = sipTransport;
     m_callManager = callManager;
     Log_External = logDelegate;
     m_username = username;
     m_adminMemberId = adminMemberId;
     m_outboundProxy = outboundProxy;
 }
开发者ID:akalafrancis,项目名称:sipsorcery-mono,代码行数:15,代码来源:GoogleVoiceCall.cs

示例14: 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

示例15: 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


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