Example #1
0
 internal QuerySmResp(PduHeader header)
     : base(header)
 {
     _vMessageId    = "";
     _vFinalDate    = "";
     _vMessageState = MessageState.Unknown;
     _vErrorCode    = 0;
 }
Example #2
0
 internal SendSmPdu(PduHeader header)
     : base(header)
 {
     VServiceType        = "";
     VEsmClass           = EsmClass.Default;
     VRegisteredDelivery = RegisteredDelivery.None;
     VDataCoding         = DataCoding.Ascii;
 }
Example #3
0
        public virtual GenericNack GenericNack(SmppErrorCode errorCode)
        {
            PduHeader header = new PduHeader(CommandType.GenericNack, VHeader.SequenceNumber);

            header.ErrorCode = errorCode;
            GenericNack gNack = (GenericNack)CreatePdu(header);

            return(gNack);
        }
Example #4
0
 public ReplaceSm(PduHeader header)
     : base(header)
 {
     _vScheduleDeliveryTime = "";
     _vValidityPeriod       = "";
     _vRegisteredDelivery   = RegisteredDelivery.None;
     _vSmDefaultMessageId   = 0;
     _vShortMessage         = "";
     _vSmLength             = 0;
 }
Example #5
0
 internal BindRequest(PduHeader header)
     : base(header)
 {
     _vSystemId         = "";
     _vPassword         = "";
     _vSystemType       = "";
     _vAddressTon       = TypeOfNumber.International;  //International
     _vAddressNpi       = NumberingPlanIndicator.Isdn; //ISDN
     _vInterfaceVersion = 34;                          //SMPP 3.4 version
     _vAddressRange     = "";
 }
Example #6
0
        public static GenericNack GenericNack(PduHeader header, SmppErrorCode errorCode)
        {
            if (header == null)
            {
                throw new ArgumentNullException("header");
            }
            GenericNack gNack = (GenericNack)CreatePdu(header);

            gNack.Header.ErrorCode = errorCode;
            return(gNack);
        }
Example #7
0
 public SubmitSm(PduHeader header)
     : base(header)
 {
     VServiceType           = Protocol.ServiceType.Default;
     _vProtocolId           = 0;
     _vPriorityFlag         = PriorityFlag.Level0;
     _vScheduleDeliveryTime = "";
     _vValidityPeriod       = "";
     VRegisteredDelivery    = RegisteredDelivery.None;
     _vReplaceIfPresent     = false;
     VDataCoding            = DataCoding.Ascii;
     _vSmDefalutMessageId   = 0;
 }
Example #8
0
        public static PduHeader Parse(ByteBuffer buffer)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }
            if (buffer.Length < 16)
            {
                throw new ArgumentException("Buffer length must not be less than 16 bytes");
            }
            uint          cmdLength = SmppEncodingUtil.GetIntFromBytes(buffer.Remove(4));
            CommandType   cmdType   = (CommandType)SmppEncodingUtil.GetIntFromBytes(buffer.Remove(4));
            SmppErrorCode errorCode = (SmppErrorCode)SmppEncodingUtil.GetIntFromBytes(buffer.Remove(4));
            uint          seqNumber = SmppEncodingUtil.GetIntFromBytes(buffer.Remove(4));
            PduHeader     header    = new PduHeader(cmdType, seqNumber, errorCode, cmdLength);

            return(header);
        }
Example #9
0
        public override ResponsePdu CreateDefaultResponce()
        {
            CommandType cmdType = CommandType.BindTransceiverResp;

            switch (VHeader.CommandType)
            {
            case CommandType.BindReceiver:
                cmdType = CommandType.BindReceiverResp;
                break;

            case CommandType.BindTransmitter:
                cmdType = CommandType.BindTransmitterResp;
                break;
            }
            PduHeader header = new PduHeader(cmdType, VHeader.SequenceNumber);

            return((BindResponse)CreatePdu(header));
        }
Example #10
0
 internal AlertNotification(PduHeader header)
     : base(header)
 {
     _vEsmeAddress = new SmppAddress();
 }
Example #11
0
        public override ResponsePdu CreateDefaultResponce()
        {
            PduHeader header = new PduHeader(CommandType.BindTransceiver, VHeader.SequenceNumber);

            return(new BindTransceiverResp(header));
        }
Example #12
0
 internal CancelSm(PduHeader header)
     : base(header)
 {
     _vDestinationAddress = new SmppAddress();
 }
Example #13
0
 internal Pdu(PduHeader header)
 {
     VHeader = header;
     VTlv    = new TlvCollection();
 }
Example #14
0
        public static Pdu CreatePdu(PduHeader header)
        {
            if (header == null)
            {
                throw new ArgumentNullException("header");
            }
            switch (header.CommandType)
            {
            case CommandType.BindReceiver:
                return(new BindReceiver(header));

            //--
            case CommandType.BindTransceiver:
                return(new BindTransceiver(header));

            //--
            case CommandType.BindTransmitter:
                return(new BindTransmitter(header));

            //--
            case CommandType.BindTransmitterResp:
                return(new BindTransmitterResp(header));

            //--
            case CommandType.BindTransceiverResp:
                return(new BindTransceiverResp(header));

            //--
            case CommandType.BindReceiverResp:
                return(new BindReceiverResp(header));

            //--
            case CommandType.OutBind:
                return(new Outbind(header));

            //--
            case CommandType.EnquireLink:
                return(new EnquireLink(header));

            //--
            case CommandType.EnquireLinkResp:
                return(new EnquireLinkResp(header));

            //--
            case CommandType.UnBind:
                return(new Unbind(header));

            //--
            case CommandType.UnBindResp:
                return(new UnbindResp(header));

            //--
            case CommandType.GenericNack:
                return(new GenericNack(header));

            //--
            case CommandType.SubmitSm:
                return(new SubmitSm(header));

            //--
            case CommandType.SubmitSmResp:
                return(new SubmitSmResp(header));

            //--
            case CommandType.DataSm:
                return(new DataSm(header));

            //--
            case CommandType.DataSmResp:
                return(new DataSmResp(header));

            //--
            case CommandType.DeliverSm:
                return(new DeliverSm(header));

            //--
            case CommandType.DeliverSmResp:
                return(new DeliverSmResp(header));

            //--
            case CommandType.CancelSm:
                return(new CancelSm(header));

            //--
            case CommandType.CancelSmResp:
                return(new CancelSmResp(header));

            //--
            case CommandType.ReplaceSm:
                return(new ReplaceSm(header));

            //--
            case CommandType.ReplaceSmResp:
                return(new ReplaceSmResp(header));

            //--
            case CommandType.QuerySm:
                return(new QuerySm(header));

            //--
            case CommandType.QuerySmResp:
                return(new QuerySmResp(header));

            //--
            default:
                throw new InvalidPduCommandException();
            }
        }
Example #15
0
 internal QuerySm(PduHeader header)
     : base(header)
 {
 }
Example #16
0
 internal DataSm(PduHeader header)
     : base(header)
 {
 }
Example #17
0
 internal Outbind(PduHeader header)
     : base(header)
 {
     _vSystemId = "";
     _vPassword = "";
 }
Example #18
0
        public override ResponsePdu CreateDefaultResponce()
        {
            PduHeader header = new PduHeader(CommandType.DeliverSmResp, VHeader.SequenceNumber);

            return(new SubmitSmResp(header));
        }
Example #19
0
 internal DeliverSmResp(PduHeader header)
     : base(header)
 {
 }
Example #20
0
 internal SubmitSmResp(PduHeader header)
     : base(header)
 {
     _vMessageId = "";
 }
Example #21
0
        public override ResponsePdu CreateDefaultResponce()
        {
            PduHeader header = new PduHeader(CommandType.ReplaceSm, VHeader.SequenceNumber);

            return(new ReplaceSmResp(header));
        }
Example #22
0
 internal BindResponse(PduHeader header)
     : base(header)
 {
     _vSystemId = "";
 }
Example #23
0
 internal DataSmResp(PduHeader header)
     : base(header)
 {
     _vMessageId = "";
 }