protected override void Given()
 {
     _contextSource = new FakeSipContextSource();
     _sipStack = new SipStack();
     _provider = new SipProvider(_sipStack, _contextSource);
     _inviteRequest = CreateInviteRequest();
     BeforeCreateInviteTransaction();
     _inviteTransaction = _provider.CreateClientTransaction(_inviteRequest).As<SipInviteClientTransaction>();
     _dialog = _provider.CreateClientDialog(_inviteTransaction);
     _inviteTransaction.SendRequest();
     GivenOverride();
 }
Exemplo n.º 2
0
        public SipInviteClientDialog CreateClientDialog(ISipClientTransaction transaction)
        {
            var inviteTx = transaction as SipInviteClientTransaction;

            Check.Require(transaction, "transaction");
            Check.IsTrue(inviteTx != null, "The transaction must be of type 'SipInviteClientTransaction'");
            Check.Require(inviteTx.Request, "The request can not be null");
            Check.Require(inviteTx.Request.From, "The From header can not be null");
            Check.NotNullOrEmpty(inviteTx.Request.From.Tag, "From tag");

            var dialog = new SipInviteClientDialog(
                inviteTx,
                _dialogTable,
                _stack.CreateHeaderFactory(),
                _stack.CreateMessageFactory(),
                _stack.CreateAddressFactory(),
                this,
                _sipListener,
                _contextSource.ListeningPoint);

            inviteTx.SetDialog(dialog);

            return dialog;
        }
        protected override void Given()
        {
            //setup the Request property of the inc inviteserver
            InvitingRequest = CreateInviteRequest();
            var tfb = new TimerFactoryStubBuilder();
            InviteCtx = new Mock<ISipClientTransaction>();
            InviteCtx.Setup((tx) => tx.Request).Returns(InvitingRequest);

            //create the dialog;
            ClientDialog = new SipInviteClientDialog(InviteCtx.Object,
                                                     DialogTable,
                                                     new SipHeaderFactory(),
                                                     new SipMessageFactory(),
                                                     new SipAddressFactory(),
                                                     Sender.Object,
                                                     Listener.Object,
                                                     TestConstants.IpEndPoint1);

            GivenOverride();
        }
Exemplo n.º 4
0
 private void SendAck(SipInviteClientDialog dialog)
 {
     var ackRequest = dialog.CreateAck();
     dialog.SendAck(ackRequest);
 }