Exemple #1
0
        IStateMachine makeIncomingCallWithAnswer(int sessionId)
        {
            string number = "1234";

            //CStateMachine sm1 = new CStateMachine(null);
            //CStateMachine sm1 = _manager.createSession(sessionId, number);
            MockSipCallProxy.OnCallStateChanged(sessionId, ESessionState.SESSION_STATE_INCOMING, "");
            MockSipCallProxy.onIncomingCall(sessionId, number, "");
            IStateMachine sm1 = _manager.getCall(sessionId);

            //sm1.State.incomingCall(number, "");

            //sm1.changeState(EStateId.INCOMING);
            Assert.AreEqual(EStateId.INCOMING, sm1.StateId);
            Assert.AreEqual(true, sm1.Incoming);

            Assert.AreEqual(sm1.RuntimeDuration, TimeSpan.Zero);

            _manager.onUserAnswer(sm1.Session);
            //sm1.State.acceptCall(sm1.Session);
            //sm1.changeState(EStateId.ACTIVE);
            Assert.AreEqual(EStateId.ACTIVE, sm1.StateId);
            Assert.AreEqual(true, sm1.Incoming);
            Assert.AreNotSame(sm1.RuntimeDuration, TimeSpan.Zero);

            return(sm1);
        }
Exemple #2
0
        IStateMachine makeIncomingCall(int sessionId)
        {
            string number = "1234";

            MockSipCallProxy.OnCallStateChanged(sessionId, ESessionState.SESSION_STATE_INCOMING, "");
            MockSipCallProxy.onIncomingCall(sessionId, number, "");
            IStateMachine sm1 = _manager.getCall(sessionId);

            //sm1.State.incomingCall(number,"");

            //sm1.changeState(EStateId.INCOMING);
            Assert.AreEqual(EStateId.INCOMING, sm1.StateId);
            Assert.AreEqual(true, sm1.Incoming);

            Assert.AreEqual(sm1.RuntimeDuration, TimeSpan.Zero);

            return(sm1);
        }
Exemple #3
0
        public void testCallPendingOnUserAnswer()
        {
            IStateMachine call = this.makeOutgoingCall();

            //CStateMachine inccall = _manager.createSession(2, "1234");
            MockSipCallProxy.OnCallStateChanged(2, ESessionState.SESSION_STATE_INCOMING, "");
            MockSipCallProxy.onIncomingCall(2, "1234", "");
            IStateMachine inccall = _manager.getCall(2);

            //inccall.State.incomingCall("1234", "");
            // nothing changed yet (waiting Hold Conf)
            Assert.AreEqual(EStateId.ACTIVE, call.StateId);
            Assert.AreEqual(EStateId.INCOMING, inccall.StateId);

            _manager.onUserAnswer(inccall.Session); // set pending action
            // hold conf
            call.State.onHoldConfirm();
            // states changed
            Assert.AreEqual(EStateId.HOLDING, call.StateId);
            Assert.AreEqual(EStateId.ACTIVE, inccall.StateId);

            call.destroy();
            inccall.destroy();
        }