Esempio n. 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);
        }
Esempio n. 2
0
 /// <summary>
 /// Sets up the EnquireLinkEventArgs.
 /// </summary>
 /// <param name="response">The PDU from the ESME.</param>
 internal EnquireLinkEventArgs(SmppEnquireLink response) : base(response)
 {
     _response = response;
 }
Esempio n. 3
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.AlertNotification:
                packet = new SmppAlertNotification(response);
                break;

            case CommandId.BindReceiverResp:
            case CommandId.BindTransceiverResp:
            case CommandId.BindTransmitterResp:
                packet = new SmppBindResp(response);
                break;

            case CommandId.CancelSmResp:
                packet = new SmppCancelSmResp(response);
                break;

            case CommandId.DataSmResp:
                packet = new SmppDataSmResp(response);
                break;

            case CommandId.DeliverSm:
                packet = new SmppDeliverSm(response);
                break;

            case CommandId.EnquireLink:
                packet = new SmppEnquireLink(response);
                break;

            case CommandId.EnquireLinkResp:
                packet = new SmppEnquireLinkResp(response);
                break;

            case CommandId.Outbind:
                packet = new SmppOutbind(response);
                break;

            case CommandId.QuerySmResp:
                packet = new SmppQuerySmResp(response);
                break;

            case CommandId.ReplaceSmResp:
                packet = new SmppReplaceSmResp(response);
                break;

            case CommandId.SubmitMultiResp:
                packet = new SmppSubmitMultiResp(response);
                break;

            case CommandId.SubmitSmResp:
                packet = new SmppSubmitSmResp(response);
                break;

            case CommandId.UnbindResp:
                packet = new SmppUnbindResp(response);
                break;

            case CommandId.GenericNack:
                packet = new SmppGenericNack(response);
                break;

            default:
                packet = null;
                break;
            }

            return(packet);
        }