protected override void AppendPduData(ArrayList pdu)
 {
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(FinalDate)));
     pdu.Add((byte)MessageStatus);
     pdu.Add(ErrorCode);
 }
 protected override void AppendPduData(ArrayList pdu)
 {
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
     pdu.Add((byte)SourceAddressTon);
     pdu.Add((byte)SourceAddressNpi);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
 }
Beispiel #3
0
        /// <summary>
        /// Creates the bytes after the destination address bytes.  This also inserts the TLV
        /// table data.  Common to both submit and submit multiple.
        /// </summary>
        /// <returns>The bytes in the Pdu before the destination address(es).</returns>
        protected ArrayList GetBytesAfterDestination()
        {
            ArrayList pdu = new ArrayList();

            pdu.Add(EsmClass);
            pdu.Add((byte)ProtocolId);
            pdu.Add((byte)PriorityFlag);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ScheduleDeliveryTime)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ValidityPeriod)));
            pdu.Add((byte)RegisteredDelivery);

            if (ReplaceIfPresentFlag == true)
            {
                pdu.Add((byte)0x01);
            }
            else
            {
                pdu.Add((byte)0x00);
            }

            pdu.Add((byte)DataCoding);
            pdu.Add(SmDefaultMessageId);
            _SmLength = PduUtil.InsertShortMessage(pdu, ShortMessage);

            pdu.TrimToSize();

            return(pdu);
        }
Beispiel #4
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ServiceType)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            pdu.Add((byte)DestinationAddressTon);
            pdu.Add((byte)DestinationAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(DestinationAddress)));
            pdu.Add(EsmClass);
            pdu.Add((byte)ProtocolId);
            pdu.Add((byte)PriorityFlag);
            //schedule_delivery_time and validity_period are null, so set them to zero
            pdu.Add((byte)0);
            pdu.Add((byte)0);
            pdu.Add((byte)RegisteredDelivery);
            //replace_if_present is always null, so set it to zero
            pdu.Add((byte)0);
            pdu.Add((byte)DataCoding);
            //sm_default_msg_id is always null, so set it to zero
            pdu.Add((byte)0);
            _SmLength = PduUtil.InsertShortMessage(pdu, ShortMessage);

            PacketBytes = EncodePduForTransmission(pdu);
        }
Beispiel #5
0
        protected override void AppendPduData(ArrayList pdu)
        {
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ServiceType)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            //number of destinations.
            pdu.Add(NumberOfDestinations);

            //and their addresses
            foreach (DestinationAddress address in _destinationAddresses)
            {
                if (!address.IsDistributionList)
                {
                    //pack up the byte array for this address
                    ArrayList sme = new ArrayList();
                    pdu.Add((byte)0x01);
                    pdu.Add((byte)address.DestinationAddressTon);
                    pdu.Add((byte)address.DestinationAddressNpi);
                    pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(
                                     Encoding.ASCII.GetBytes(address.DestAddress)));
                }
                else
                {
                    ArrayList dln = new ArrayList();
                    pdu.Add((byte)0x02);
                    pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(
                                     Encoding.ASCII.GetBytes(address.DistributionList)));
                }
            }

            pdu.AddRange(base.GetBytesAfterDestination());
        }
Beispiel #6
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SystemId)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(Password)));
            PacketBytes = EncodePduForTransmission(pdu);
        }
Beispiel #7
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            PacketBytes = EncodePduForTransmission(pdu);
        }
 protected override void AppendPduData(ArrayList pdu)
 {
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SystemId)));
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(Password)));
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SystemType)));
     pdu.Add((byte)InterfaceVersion);
     pdu.Add((byte)AddressTon);
     pdu.Add((byte)AddressNpi);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(AddressRange)));
 }
Beispiel #9
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(FinalDate)));
            pdu.Add((byte)MessageStatus);
            pdu.Add(ErrorCode);

            PacketBytes = EncodePduForTransmission(pdu);
        }
 protected override void AppendPduData(ArrayList pdu)
 {
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ServiceType)));
     pdu.Add((byte)SourceAddressTon);
     pdu.Add((byte)SourceAddressNpi);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
     pdu.Add((byte)DestinationAddressTon);
     pdu.Add((byte)DestinationAddressNpi);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(DestinationAddress)));
     pdu.AddRange(GetBytesAfterDestination());
 }
        protected override void AppendPduData(ArrayList pdu)
        {
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ScheduleDeliveryTime)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ValidityPeriod)));
            pdu.Add((byte)RegisteredDelivery);
            pdu.Add(_SmDefaultMessageId);

            _SmLength = PduUtil.InsertShortMessage(pdu, DataCoding.SMSCDefault, ShortMessage);
        }
Beispiel #12
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SystemId)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(Password)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SystemType)));
            pdu.Add((byte)InterfaceVersion);
            pdu.Add((byte)AddressTon);
            pdu.Add((byte)AddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(AddressRange)));

            PacketBytes = EncodePduForTransmission(pdu);
        }
Beispiel #13
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ServiceType)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            pdu.Add((byte)DestinationAddressTon);
            pdu.Add((byte)DestinationAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(DestinationAddress)));
            pdu.Add(EsmClass);
            pdu.Add((byte)RegisteredDelivery);
            pdu.Add((byte)DataCoding);

            PacketBytes = EncodePduForTransmission(pdu);
        }
        protected override void AppendPduData(ArrayList pdu)
        {
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
            pdu.Add(NumberUnsuccessful);
            //add the unsuccess addresses
            UnsuccessAddress[] unsuccessfulAddresses = UnsuccessfulAddresses;

            for (int i = 0; i < NumberUnsuccessful; i++)
            {
                pdu.Add((byte)unsuccessfulAddresses[i].DestinationAddressTon);
                pdu.Add((byte)unsuccessfulAddresses[i].DestinationAddressNpi);
                pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(
                                 Encoding.ASCII.GetBytes(unsuccessfulAddresses[i].DestinationAddress)));
                pdu.AddRange(BitConverter.GetBytes(
                                 UnsignedNumConverter.SwapByteOrdering(unsuccessfulAddresses[i].ErrorStatusCode)));
            }
        }
Beispiel #15
0
        /// <summary>
        /// Generates the hex encoded bytes for a replace_sm Pdu.
        /// </summary>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ScheduleDeliveryTime)));
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ValidityPeriod)));
            pdu.Add((byte)RegisteredDelivery);
            pdu.Add(_SmDefaultMessageId);

            _SmLength = PduUtil.InsertShortMessage(pdu, ShortMessage);

            PacketBytes = EncodePduForTransmission(pdu);
        }
        /// <summary>
        /// Creates the byte encoding for this Pdu.
        /// </summary>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(MessageId)));
            pdu.Add(NumberUnsuccessful);
            //add the unsuccess addresses
            UnsuccessAddress[] unsuccessfulAddresses = UnsuccessfulAddresses;

            for (int i = 0; i < NumberUnsuccessful; i++)
            {
                pdu.Add((byte)unsuccessfulAddresses[i].DestinationAddressTon);
                pdu.Add((byte)unsuccessfulAddresses[i].DestinationAddressNpi);
                pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(
                                 Encoding.ASCII.GetBytes(unsuccessfulAddresses[i].DestinationAddress)));
                pdu.AddRange(BitConverter.GetBytes(
                                 UnsignedNumConverter.SwapByteOrdering(unsuccessfulAddresses[i].ErrorStatusCode)));
            }
//
            PacketBytes = EncodePduForTransmission(pdu);
        }
Beispiel #17
0
 protected override void AppendPduData(ArrayList pdu)
 {
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ServiceType)));
     pdu.Add((byte)SourceAddressTon);
     pdu.Add((byte)SourceAddressNpi);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
     pdu.Add((byte)DestinationAddressTon);
     pdu.Add((byte)DestinationAddressNpi);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(DestinationAddress)));
     pdu.Add(EsmClass);
     pdu.Add((byte)ProtocolId);
     pdu.Add((byte)PriorityFlag);
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ScheduleDeliveryTime)));
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ValidityPeriod)));
     pdu.Add((byte)RegisteredDelivery);
     //replace_if_present is always null, so set it to zero
     pdu.Add((byte)0);
     pdu.Add((byte)DataCoding);
     //sm_default_msg_id is always null, so set it to zero
     pdu.Add((byte)0);
     _smLength = PduUtil.InsertShortMessage(pdu, DataCoding, ShortMessage);
 }
Beispiel #18
0
        ///<summary>
        /// Gets the hex encoding(big-endian)of this Pdu.
        ///</summary>
        ///<return>The hex-encoded version of the Pdu</return>
        public override void ToMsbHexEncoding()
        {
            ArrayList pdu = GetPduHeader();

            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(ServiceType)));
            pdu.Add((byte)SourceAddressTon);
            pdu.Add((byte)SourceAddressNpi);
            pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SourceAddress)));
            //number of destinations.
            pdu.Add(NumberOfDestinations);

            //and their addresses
            foreach (DestinationAddress address in _DestinationAddresses)
            {
                if (!address.IsDistributionList)
                {
                    //pack up the byte array for this address
                    ArrayList sme = new ArrayList();
                    pdu.Add((byte)0x01);
                    pdu.Add((byte)address.DestinationAddressTon);
                    pdu.Add((byte)address.DestinationAddressNpi);
                    pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(
                                     Encoding.ASCII.GetBytes(address.DestAddress)));
                }
                else
                {
                    ArrayList dln = new ArrayList();
                    pdu.Add((byte)0x02);
                    pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(
                                     Encoding.ASCII.GetBytes(address.DistributionList)));
                }
            }

            pdu.AddRange(base.GetBytesAfterDestination());

            PacketBytes = EncodePduForTransmission(pdu);
        }
Beispiel #19
0
 protected override void AppendPduData(ArrayList pdu)
 {
     pdu.AddRange(SmppStringUtil.ArrayCopyWithNull(Encoding.ASCII.GetBytes(SystemId)));
 }