Beispiel #1
0
        public void testCallPendingOnUserRetrieve()
        {
            IStateMachine call = this.makeOutgoingCall();

            call.State.holdCall();
            call.State.onHoldConfirm();
            Assert.AreEqual(EStateId.HOLDING, call.StateId);

            IStateMachine inccall = this.makeIncomingCallWithAnswer(2);

            Assert.AreEqual(EStateId.ACTIVE, inccall.StateId);

            // retrieve 1st call (HOLDING)
            _manager.OnUserHoldRetrieve(call.Session);
            Assert.AreEqual(EStateId.HOLDING, call.StateId);
            Assert.AreEqual(EStateId.ACTIVE, inccall.StateId);

            // hold conf
            inccall.State.onHoldConfirm();
            // states changed
            Assert.AreEqual(EStateId.ACTIVE, call.StateId);
            Assert.AreEqual(EStateId.HOLDING, inccall.StateId);

            call.Destroy();
            inccall.Destroy();
        }
Beispiel #2
0
        public void testCallFeaturesCallHoldConfirm()
        {
            IStateMachine inc = this.makeIncomingCallWithAnswer(1);

            // try hold confirmation without hold request
            inc.State.onHoldConfirm();
            // no effect
            Assert.AreEqual(EStateId.ACTIVE, inc.StateId);
            Assert.AreEqual(false, inc.HoldRequested);
            // hold request
            inc.State.holdCall();
            Assert.AreEqual(true, inc.HoldRequested);
            // no effect
            Assert.AreEqual(EStateId.ACTIVE, inc.StateId);
            inc.State.onHoldConfirm();
            Assert.AreEqual(EStateId.HOLDING, inc.StateId);

            inc.Destroy();
        }
Beispiel #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[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();
        }