Пример #1
0
        internal void ConnectIndication(ConnectIndication indication)
        {
            Connection connection = Connections.GetConnectionByPLCI(indication.Identifier.PLCI);

            if (connection == null)
            {
                connection = new Connection(_application,
                                            this,
                                            indication.Identifier.PLCI,
                                            indication.CalledPartyNumber,
                                            indication.CallingPartyNumber);
                Connections.InternalAdd(connection);
            }

            AlertRequest request = new AlertRequest();

            request.Identifier.Value = indication.Identifier.Value;
            _application.SendMessage(request);

            // Notify user application....
            connection.Status = ConnectionStatus.D_ConnectPending;
            connection.ConnectIndication(indication);
            IncomingPhysicalConnectionEventArgs args = new IncomingPhysicalConnectionEventArgs(connection);

            _application.OnIncomingPhysicalConnection(args);
        }
Пример #2
0
        public void Answer(Reject reject, B1Protocol b1, B2Protocol b2, B3Protocol b3)
        {
            Debug.Assert(_status == ConnectionStatus.D_ConnectPending);
            if (_connectIndication == null || _status != ConnectionStatus.D_ConnectPending)
            {
                throw new NotSupportedException("Connection is not in the right state.");
            }
            ConnectResponse response = new ConnectResponse(_connectIndication);

            _connectIndication    = null;
            response.Reject       = reject;
            response.BPtotocol.B1 = b1;
            response.BPtotocol.B2 = b2;
            response.BPtotocol.B3 = b3;
            _application.SendMessage(response);
        }
Пример #3
0
        public ConnectResponse(ConnectIndication indication)
            : base(new PLCIParameter(), indication)
        {
            // Reject
            ParameterCollection.Add(new Parameter <Int16>());

            // B protocol
            ParameterCollection.Add(new BProtocol());

            // Connected Number
            ParameterCollection.Add(new PrefixedStringParameter(new byte[] { 0, 128 }));

            // Connected Subaddress
            ParameterCollection.Add(new PrefixedStringParameter(new byte[] { 128 }));

            // LLC
            ParameterCollection.Add(new Parameter <byte>());

            // Additional Info
            ParameterCollection.Add(new Parameter <byte>());
        }
Пример #4
0
 internal void ConnectIndication(ConnectIndication indication)
 {
     _connectIndication = indication;
 }
Пример #5
0
 /// <summary>
 /// Indicates an incoming physical connection.
 /// </summary>
 /// <param name="header"></param>
 /// <param name="indication"></param>
 internal abstract void ConnectIndication(ConnectIndication indication);