コード例 #1
0
 public SipParser2(SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
 {
     _logger.Trace("Constructor called.");
     _messageFactory = messageFactory;
     _headerFactory  = headerFactory;
     _message        = null;
 }
コード例 #2
0
ファイル: SipParserContext.cs プロジェクト: goupviet/Hallo
 public SipParserContext(SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
 {
     _logger.Trace("Constructor called.");
     _messageFactory = messageFactory;
     _headerFactory  = headerFactory;
     _sipParser      = new SipParser(this);
 }
コード例 #3
0
ファイル: SipParserContext.cs プロジェクト: HNeukermans/Hallo
 public SipParserContext(SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
 {
     _logger.Trace("Constructor called.");
     _messageFactory = messageFactory;
     _headerFactory = headerFactory;
     _sipParser = new SipParser(this);
 }
コード例 #4
0
ファイル: SipParser2.cs プロジェクト: HNeukermans/Hallo
 public SipParser2(SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
 {
     _logger.Trace("Constructor called.");
     _messageFactory = messageFactory;
     _headerFactory = headerFactory;
     _message = null;
 }
コード例 #5
0
ファイル: SipContextSource.cs プロジェクト: goupviet/Hallo
        internal SipContextSource(IPEndPoint ipEndPoint, SmartThreadPool threadPool, SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
        {
            Check.Require(ipEndPoint, "ipEndPoint");
            Check.Require(threadPool, "threadPool");
            Check.Require(messageFactory, "messageFactory");
            Check.Require(headerFactory, "headerFactory");

            _ipEndPoint     = ipEndPoint;
            _threadPool     = threadPool;
            _messageFactory = messageFactory;
            _headerFactory  = headerFactory;
            _logger.Trace("Constructor called.");

            _sender = new DatagramSender(_ipEndPoint);
        }
コード例 #6
0
ファイル: SipContextSource.cs プロジェクト: HNeukermans/Hallo
        internal SipContextSource(IPEndPoint ipEndPoint, SmartThreadPool threadPool, SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
        {
            Check.Require(ipEndPoint, "ipEndPoint");
            Check.Require(threadPool, "threadPool");
            Check.Require(messageFactory, "messageFactory");
            Check.Require(headerFactory, "headerFactory");

            _ipEndPoint = ipEndPoint;
            _threadPool = threadPool;
            _messageFactory = messageFactory;
            _headerFactory = headerFactory;
            _logger.Trace("Constructor called.");

            _sender = new DatagramSender(_ipEndPoint);
        }
コード例 #7
0
 public TxSpecificationBase()
 {
     MessageSenderMock = new Mock<ISipMessageSender>();
     TxTable = new SipClientTransactionTable();
     Request = new SipRequestBuilder()
         .WithRequestLine
         (
             new SipRequestLineBuilder()
             .WithMethod(SipMethods.Invite)
             .Build()
         ).Build();
     TimerFactory = new TimerFactoryMockBuilder().Build();
     ListenerMock = new Mock<ISipListener>();
     HeaderFactory = new SipHeaderFactory();
     MessageFactory = new SipMessageFactory();
 }
コード例 #8
0
ファイル: SoftPhone.cs プロジェクト: HNeukermans/Hallo
        internal SoftPhone(ISipProvider provider, SipMessageFactory messageFactory, SipHeaderFactory headerFactory,
            SipAddressFactory addressFactory, ISoftPhoneStateProvider stateProvider, ITimerFactory timerFactory, SipListeningPoint listeningPoint)
        {
            ListeningPoint = listeningPoint;
            _provider = provider;
            _messageFactory = messageFactory;
            _headerFactory = headerFactory;
            _addressFactory = addressFactory;
            _stateProvider = stateProvider;
            _timerFactory = timerFactory;

            InternalState = _stateProvider.GetIdle();
            InternalState.Initialize(this);
            RetransmitRingingTimer = _timerFactory.CreateRingingTimer(OnRetransmitRinging);
            EndWaitForAckTimer = _timerFactory.CreateInviteCtxTimeOutTimer(OnWaitForAckTimeOut);

            if(_logger.IsDebugEnabled) _logger.Debug("Initialized.");
        }
コード例 #9
0
ファイル: SipStack.cs プロジェクト: HNeukermans/Hallo
 public SipMessageFactory CreateMessageFactory()
 {
     return _messageFactory ?? (_messageFactory = new SipMessageFactory());
 }
コード例 #10
0
 public SipMessageFactory CreateMessageFactory()
 {
     return(_messageFactory ?? (_messageFactory = new SipMessageFactory()));
 }
コード例 #11
0
 public SipContextFactory(SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
 {
     _logger.Trace("Constructor called.");
     _messageFactory = messageFactory;
     _headerFactory = headerFactory;
 }
コード例 #12
0
 public SipContextFactory(SipMessageFactory messageFactory, SipHeaderFactory headerFactory)
 {
     _logger.Trace("Constructor called.");
     _messageFactory = messageFactory;
     _headerFactory  = headerFactory;
 }
コード例 #13
0
ファイル: FakeNetwork.cs プロジェクト: HNeukermans/Hallo
 public FakeNetwork()
 {
     _messageFactory = new SipMessageFactory();
     _headerFactory = new SipHeaderFactory();
 }
コード例 #14
0
        /// <summary>
        /// creates a ack. this is to be sent by the testclient UA
        /// </summary>
        /// <param name="invite"></param>
        /// <param name="ringing"></param>
        /// <returns></returns>
        protected SipRequest CreateAckRequest(SipRequest invite, SipResponse ringing)
        {
            var addressFactory = new SipAddressFactory();
            var headerFactory = new SipHeaderFactory();
            var messageFactory = new SipMessageFactory();

            var localSequenceNr = invite.CSeq.Sequence;
            /*_remoteSequenceNr remains empty */
            var callId = invite.CallId.Value;
            var localTag = invite.From.Tag;
            var remoteUri = invite.To.SipUri;
            var localUri = invite.From.SipUri;

            var remoteTag = ringing.To.Tag;
            var remoteTarget = ringing.Contacts.GetTopMost().SipUri;
            var routeSet = ringing.RecordRoutes.ToList();//refuse looseroutin-less recordroutes
            routeSet.Reverse();

            var cseqHeader = headerFactory.CreateSCeqHeader(SipMethods.Ack, localSequenceNr);
            var toAddress = addressFactory.CreateAddress(null, remoteUri);
            var toHeader = headerFactory.CreateToHeader(toAddress, remoteTag);
            var fromAddress = addressFactory.CreateAddress(null, localUri);
            var fromHeader = headerFactory.CreateFromHeader(fromAddress, localTag);
            var callIdheader = headerFactory.CreateCallIdHeader(callId);
            var viaHeader = invite.Vias.GetTopMost();
            var requestUri = remoteUri.Clone();

            var maxForwardsHeader = headerFactory.CreateMaxForwardsHeader();
            var request = messageFactory.CreateRequest(
                requestUri,
                SipMethods.Ack,
                callIdheader,
                cseqHeader,
                fromHeader,
                toHeader,
                viaHeader,
                maxForwardsHeader);

            foreach (var route in routeSet)
            {
                request.Routes.Add(new SipRouteHeader() { SipUri = route.SipUri, Parameters = route.Parameters });
            }

            return request;
        }
コード例 #15
0
        protected SipRequest CreateCancelRequest(SipRequest request)
        {
            var hf = new SipHeaderFactory();
            var mf = new SipMessageFactory();
            var requestUri = request.RequestLine.Uri.Clone();
            var callIdheader = (SipCallIdHeader)request.CallId.Clone();
            var cseqHeader = new SipHeaderFactory().CreateSCeqHeader(SipMethods.Cancel, request.CSeq.Sequence);
            var fromHeader = (SipFromHeader)request.From.Clone();
            var toHeader = (SipToHeader)request.To.Clone();
            var viaHeader = (SipViaHeader)request.Vias.GetTopMost().Clone();
            var maxForwardsHeader = hf.CreateMaxForwardsHeader();
            var cancelRequest = mf.CreateRequest(
                requestUri,
                SipMethods.Cancel,
                callIdheader,
                cseqHeader,
                fromHeader,
                toHeader,
                viaHeader,
                maxForwardsHeader);

            foreach (var route in request.Routes)
            {
                cancelRequest.Routes.Add((SipRouteHeader)route.Clone());
            }

            return cancelRequest;
        }