Beispiel #1
0
        /// <summary>
        /// Gets a single PDU based on the response bytes.
        /// </summary>
        /// <param name="response">The SMSC response.</param>
        /// <returns>The PDU corresponding to the bytes.</returns>
        private Pdu GetPDU(byte[] response)
        {
            var commandID = Pdu.DecodeCommandId(response);

            Pdu packet;
            switch(commandID)
            {
                case CommandId.alert_notification:
                    packet = new SmppAlertNotification(response);
                    break;
                case CommandId.bind_receiver_resp:
                case CommandId.bind_transceiver_resp:
                case CommandId.bind_transmitter_resp:
                    packet = new SmppBindResp(response);
                    break;
                case CommandId.cancel_sm_resp:
                    packet = new SmppCancelSmResp(response);
                    break;
                case CommandId.data_sm_resp:
                    packet = new SmppDataSmResp(response);
                    break;
                case CommandId.deliver_sm:
                    packet = new SmppDeliverSm(response);
                    break;
                case CommandId.enquire_link:
                    packet = new SmppEnquireLink(response);
                    break;
                case CommandId.enquire_link_resp:
                    packet = new SmppEnquireLinkResp(response);
                    break;
                case CommandId.outbind:
                    packet = new SmppOutbind(response);
                    break;
                case CommandId.query_sm_resp:
                    packet = new SmppQuerySmResp(response);
                    break;
                case CommandId.replace_sm_resp:
                    packet = new SmppReplaceSmResp(response);
                    break;
                case CommandId.submit_multi_resp:
                    packet = new SmppSubmitMultiResp(response);
                    break;
                case CommandId.submit_sm_resp:
                    packet = new SmppSubmitSmResp(response);
                    break;
                case CommandId.unbind_resp:
                    packet = new SmppUnbindResp(response);
                    break;
                case CommandId.generic_nack:
                    packet = new SmppGenericNack(response);
                    break;
                default:
                    packet = null;
                    break;
            }

            return packet;
        }
 /// <summary>
 /// Sets up the EnquireLinkEventArgs.
 /// </summary>
 /// <param name="response">The PDU from the ESME.</param>
 internal EnquireLinkEventArgs(SmppEnquireLink response)
     : base(response)
 {
     _response = response;
 }