Beispiel #1
0
        public SoundProxy(string branch, SipTransportBase sipProxy)
        {
            if (null == sipProxy)
            {
                throw new ArgumentNullException("settings");
            }
            if (null == branch)
            {
                throw new ArgumentNullException("branch");
            }
            if (0 == branch.Length)
            {
                throw new ArgumentException("Branch not specified.");
            }
            if (branch.Length > 250)
            {
                throw new ArgumentException("Branch is too long.", "branch");
            }

            m_SipTransport = sipProxy;
            m_BranchAscii  = SipTransportBase.g_Ascii.GetBytes(branch);

            m_udpClient = new System.Net.Sockets.UdpClient(
                new NET.IPEndPoint(m_SipTransport.LocalAddress, 0)
                );

            m_udpReceiveThread = new System.Threading.Thread(UdpReceiveProc);
            m_udpReceiveThread.Start();
        }
Beispiel #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         m_Transport.Dispose();
         m_Transport = null;
     }
 }
Beispiel #3
0
        protected void CreateTransport(ConnectorType transportType, ProgramSettings settings)
        {
            if (transportType == ConnectorType.UDP)
            {
                m_Transport = new SipTransportUdp(settings);
            }
            else if (transportType == ConnectorType.TCP)
            {
                m_Transport = new SipTransportTcp(settings);
            }

            m_Transport.PipeDead              += OnPipeDead;
            m_Transport.SipReceivedFromPipe   += OnSipReceivedFromPipe;
            m_Transport.SipReceivedFromClient += OnSipReceivedFromClient;
        }
Beispiel #4
0
 public SoundProxy(string sipServerHost, ushort sipServerPort, string branch, SipTransportBase sipProxy)
     : this(branch, sipProxy)
 {
     SetServer(sipServerHost, sipServerPort);
 }