Parses and creates headers.
 public MessageFactoryContext(MessageFactory msgFactory, HeaderFactory factory, SipParser parser)
 {
     _msgFactory = msgFactory;
     _factory = factory;
     _parser = parser;
     parser.HeaderParsed += OnHeader;
     parser.MessageComplete += OnMessageComplete;
     parser.RequestLineParsed += OnRequestLine;
     parser.ResponseLineParsed += OnResponseLine;
 }
Example #2
0
        public MessageFactoryTest()
        {
            LogFactory.Assign(new ConsoleLogFactory(null));

            _headerFactory = new HeaderFactory();
            _headerFactory.AddDefaultParsers();
            _factory = new MessageFactory(_headerFactory);
            _factory.RequestReceived += OnRequest;
            _factory.ResponseReceived += OnResponse;
        }
Example #3
0
        public TcpTransportTest()
        {
            LogFactory.Assign(new ConsoleLogFactory(null));

            var headerFactory = new HeaderFactory();
            headerFactory.AddDefaultParsers();
            _messageFactory = new MessageFactory(headerFactory);
            _messageFactory.RequestReceived += OnRequest;
            _messageFactory.ResponseReceived += OnResponse;
            var pool = new ObjectPool<byte[]>(CreateBuffer);
            _transport = new TcpTransport(new IPEndPoint(IPAddress.Any, 1324), _messageFactory)
                             {BufferPool = _bufferPool};
            _transport.Start();
            _transport.UnhandledException += OnUnhandledException;
        }
Example #4
0
 public MessageFactory(HeaderFactory factory)
 {
     _factory = factory;
     _builders = new ObjectPool<MessageFactoryContext>(CreateBuilder);
 }
Example #5
0
 public SipStack()
 {
     var hf = new HeaderFactory();
     hf.AddDefaultParsers();
     _messageFactory = new MessageFactory(hf);
     _transportLayer = new TransportLayer(MessageFactory);
     _transportLayer.RequestReceived += OnRequest;
     _transportLayer.ResponseReceived += OnResponse;
     _transactionManager = new TransactionManager(_transportLayer);
     _dialogManager = new DialogManager(this);
     _authenticator = new Authenticator();
 }