/// <summary>
        /// Default constructor.
        /// </summary>
        public SIP_Stack()
        {
            m_pCore = new SIP_ProxyCore(this);
            m_pTransportLayer = new SIP_TransportLayer(this);
            m_pTransactionLayer = new SIP_TransactionLayer(this);
            m_pNonceManager = new Auth_HttpDigest_NonceManager();

            m_pBinds  = new BindInfo[]{};
            m_pLogger = new Logger();
        }
Beispiel #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public SIP_Stack()
        {
            m_pTransportLayer = new SIP_TransportLayer(this);
            m_pTransactionLayer = new SIP_TransactionLayer(this);
            m_pNonceManager = new Auth_HttpDigest_NonceManager();
            m_pProxyServers = new List<SIP_Uri>();
            m_pRegistrations = new List<SIP_UA_Registration>();
            m_pCredentials = new List<NetworkCredential>();
            m_RegisterCallID = SIP_t_CallID.CreateCallID();

            m_pLogger = new Logger();

            m_pDnsClient = new Dns_Client();
        }
Beispiel #3
0
            /// <summary>
            /// Default constructor.
            /// </summary>
            /// <param name="owner">Owner transport layer.</param>
            /// <exception cref="ArgumentNullException">Is raised when <b>owner</b> is null reference.</exception>
            internal SIP_FlowManager(SIP_TransportLayer owner)
            {
                if(owner == null){
                    throw new ArgumentNullException("owner");
                }

                m_pOwner = owner;

                m_pFlows = new Dictionary<string,SIP_Flow>();

                m_pTimeoutTimer = new TimerEx(15000);
                m_pTimeoutTimer.AutoReset = true;
                m_pTimeoutTimer.Elapsed += new System.Timers.ElapsedEventHandler(m_pTimeoutTimer_Elapsed);
                m_pTimeoutTimer.Enabled = true;
            }
Beispiel #4
0
            /// <summary>
            /// Cleans up any resources being used.
            /// </summary>
            public void Dispose()
            {
                lock(m_pLock){
                    if(m_IsDisposed){
                        return;
                    }
                    m_IsDisposed = true;

                    foreach(SIP_Flow flow in this.Flows){
                        flow.Dispose();
                    }

                    m_pOwner = null;
                    m_pFlows = null;
                    m_pTimeoutTimer.Dispose();
                    m_pTimeoutTimer = null;
                }
            }
Beispiel #5
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public SIP_Stack()
        {            
            m_pTransportLayer = new SIP_TransportLayer(this);
            m_pTransactionLayer = new SIP_TransactionLayer(this);
            m_pNonceManager = new Auth_HttpDigest_NonceManager();
            m_pProxyServers = new List<SIP_Uri>();
            m_pRegistrations = new List<SIP_UA_Registration>();
            m_pCredentials = new List<NetworkCredential>();
            m_RegisterCallID = SIP_t_CallID.CreateCallID();
            
            m_pAllow = new List<string>();
            m_pAllow.AddRange(new string[]{"INVITE","ACK","CANCEL","BYE","MESSAGE"});

            m_pSupported = new List<string>();
                       
            m_pLogger = new Logger();

            m_pDnsClient = new Dns_Client();
        }
            /// <summary>
            /// Default constructor.
            /// </summary>
            /// <param name="owner">Owner SIP_TransportLayer.</param>
            /// <param name="remoteEP">Remote end point.</param>
            /// <param name="ssl">Specifies if SSL pipe.</param>
            public SipTcpPipe(SIP_TransportLayer owner,IPEndPoint remoteEP,bool ssl)
            {
                m_pTLayer = owner;

                m_pSocket = new SocketEx();
                m_pSocket.Connect(remoteEP,true);
                if(ssl){
                    m_Transport = SIP_Transport.TLS;
                    m_pSocket.SwitchToSSL_AsClient();
                }
                else{
                    m_Transport = SIP_Transport.TLS;
                }

                // Add this to TCP pipes collection.
                m_pTLayer.m_pTcpReceiviePipes.Add(this);

                Start();
            }
            /// <summary>
            /// Default constructor.
            /// </summary>
            /// <param name="owner">Owner SIP_TransportLayer.</param>
            /// <param name="socket">Connected socket.</param>
            public SipTcpPipe(SIP_TransportLayer owner,SocketEx socket)
            {
                m_pTLayer = owner;
                m_pSocket = socket;

                if(socket.SSL){
                    m_Transport = SIP_Transport.TLS;
                }
                else{
                    m_Transport = SIP_Transport.TCP;
                }

                Start();
            }