Esempio n. 1
0
 /// <summary>
 /// Registers itself as a receiver to the network
 /// </summary>
 /// <param name="network"></param>
 public void AddToNetwork(FakeNetwork network)
 {
     _network = network;
     _network.AddReceiver(this.ListeningPoint, FireNewContextReceivedEvent);
 }
Esempio n. 2
0
 /// <summary>
 /// Registers itself as a receiver to the network
 /// </summary>
 /// <param name="network"></param>
 public void AddToNetwork(FakeNetwork network)
 {
     _network = network;
     _network.AddReceiver(this.ListeningPoint, FireNewContextReceivedEvent);
 }
        protected override void Given()
        {
            //create invite that is addresses to the phone's sipuri
            _invite = CreateInviteRequest(_testClientUaUri, _phoneUaUri);
            //create phone that is located at IpEndPoint2
            var phoneCs = new FakeSipContextSource(_phoneUaEndPoint);

            _network = new FakeNetwork();
            _sipProvider1 = new SipProvider(new SipStack(), phoneCs);

            _phone = new SoftPhone(_sipProvider1, new SipMessageFactory(), new SipHeaderFactory(), new SipAddressFactory(), _stateProvider, _timerFactory, new SipListeningPoint(_phoneUaEndPoint));
            phoneCs.AddToNetwork(_network);
            _network.AddReceiver(_testClientUaEndPoint, OnTestClientUaReceive);
            _phone.InternalStateChanged += new EventHandler<EventArgs>(_calleePhone_InternalStateChanged);
            _phone.IncomingCall += new EventHandler<VoipEventArgs<IPhoneCall>>(_calleePhone_IncomingCall);
            _phone.Start();

            GivenOverride();
        }