/// <summary> /// Decodes the bind response from the SMSC. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; SystemId = SmppStringUtil.GetCStringFromBody(ref remainder); //fill the TLV table if applicable TranslateTlvDataIntoTable(remainder); }
/// <summary> /// Decodes the non-TLV bytes. Needed for the submit_multi_resp. /// </summary> protected void DecodeNonTlv() { //header byte[] remainder = BytesAfterHeader; MessageId = SmppStringUtil.GetCStringFromBody(ref remainder); _ResponseAfterMsgId = remainder; }
/// <summary> /// Decodes the query_sm response from the SMSC. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; MessageId = SmppStringUtil.GetCStringFromBody(ref remainder); FinalDate = SmppStringUtil.GetCStringFromBody(ref remainder); MessageStatus = (MessageStateType)remainder[0]; ErrorCode = remainder[1]; //fill the TLV table if applicable TranslateTlvDataIntoTable(remainder, 2); }
/// <summary> /// This decodes the query_sm Pdu. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; MessageId = SmppStringUtil.GetCStringFromBody(ref remainder); SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); TranslateTlvDataIntoTable(remainder); }
/// <summary> /// Decodes the alert_notification from the SMSC. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); EsmeAddressTon = (TonType)remainder[0]; EsmeAddressNpi = (NpiType)remainder[1]; EsmeAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); //fill the TLV table if applicable TranslateTlvDataIntoTable(remainder); }
/// <summary> /// This decodes the submit_sm Pdu. The Pdu has basically the same format as /// the submit_sm Pdu, but in this case it is a response. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; BindType = (SmppBind.BindingType)CommandId; SystemId = SmppStringUtil.GetCStringFromBody(ref remainder); Password = SmppStringUtil.GetCStringFromBody(ref remainder); SystemType = SmppStringUtil.GetCStringFromBody(ref remainder); InterfaceVersion = (SmppVersionType)remainder[0]; AddressTon = (TonType)remainder[1]; AddressNpi = (NpiType)remainder[2]; AddressRange = SmppStringUtil.GetCStringFromBody(ref remainder, 3); TranslateTlvDataIntoTable(remainder); }
/// <summary> /// This decodes the submit_sm Pdu. The Pdu has basically the same format as /// the submit_sm Pdu, but in this case it is a response. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; MessageId = SmppStringUtil.GetCStringFromBody(ref remainder); SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); ScheduleDeliveryTime = SmppStringUtil.GetCStringFromBody(ref remainder); ValidityPeriod = SmppStringUtil.GetCStringFromBody(ref remainder); RegisteredDelivery = (RegisteredDeliveryType)remainder[0]; SmDefaultMessageId = remainder[1]; _SmLength = remainder[2]; ShortMessage = SmppStringUtil.GetStringFromBody(ref remainder, 3, 3 + _SmLength); TranslateTlvDataIntoTable(remainder); }
/// <summary> /// Decodes the submit_multi response from the SMSC. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; ServiceType = SmppStringUtil.GetCStringFromBody(ref remainder); SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); //the SMSC might not send back the number of destinations, //so check if it did if (remainder.Length > 0) { _numberOfDests = remainder[0]; DestinationAddresses = new DestinationAddress[NumberOfDestinations]; //trim off the number of destinations long length = remainder.Length - 1; byte[] newRemainder = new byte[length]; Array.Copy(remainder, 1, newRemainder, 0, length); remainder = newRemainder; newRemainder = null; for (int i = 0; i < _destinationAddresses.Length; i++) { _destinationAddresses[i] = new DestinationAddress(ref remainder); } } EsmClass = remainder[0]; ProtocolId = remainder[1]; PriorityFlag = (PriorityType)remainder[2]; ScheduleDeliveryTime = SmppStringUtil.GetCStringFromBody(ref remainder, 3); ValidityPeriod = SmppStringUtil.GetCStringFromBody(ref remainder); RegisteredDelivery = (RegisteredDeliveryType)remainder[0]; ReplaceIfPresentFlag = (remainder[1] == 0)? false : true; DataCoding = (DataCoding)remainder[2]; SmDefaultMessageId = remainder[3]; _SmLength = remainder[4]; ShortMessage = SmppStringUtil.GetStringFromBody(ref remainder, 5, 5 + _SmLength); //fill the TLV table if applicable TranslateTlvDataIntoTable(remainder); }
/// <summary> /// This decodes the cancel_sm Pdu. /// </summary> protected override void DecodeSmscResponse() { #if DEBUG Console.WriteLine("In DecodeSmscResponse of EsmppDataSm"); #endif byte[] remainder = BytesAfterHeader; ServiceType = SmppStringUtil.GetCStringFromBody(ref remainder); SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); DestinationAddressTon = (TonType)remainder[0]; DestinationAddressNpi = (NpiType)remainder[1]; DestinationAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); EsmClass = remainder[0]; RegisteredDelivery = (RegisteredDeliveryType)remainder[1]; DataCoding = (DataCodingType)remainder[2]; TranslateTlvDataIntoTable(remainder, 3); }
/// <summary> /// This decodes the deliver_sm Pdu. The Pdu has basically the same format as /// the submit_sm Pdu, but in this case it is a response. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; ServiceType = SmppStringUtil.GetCStringFromBody(ref remainder); SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); DestinationAddressTon = (TonType)remainder[0]; DestinationAddressNpi = (NpiType)remainder[1]; DestinationAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); EsmClass = remainder[0]; ProtocolId = remainder[1]; PriorityFlag = (PriorityType)remainder[2]; ScheduleDeliveryTime = SmppStringUtil.GetCStringFromBody(ref remainder, 3); ValidityPeriod = SmppStringUtil.GetCStringFromBody(ref remainder); RegisteredDelivery = (RegisteredDeliveryType)remainder[0]; //replace_if_present is always null, so don't bother reading it DataCoding = (DataCoding)remainder[2]; //sm_default_msg_id is always null, so don't bother reading it _smLength = remainder[4]; ShortMessage = SmppStringUtil.GetStringFromBody(ref remainder, 5, 5 + _smLength); TranslateTlvDataIntoTable(remainder); }
/// <summary> /// This decodes the submit_sm Pdu. The Pdu has basically the same format as /// the submit_sm Pdu, but in this case it is a response. /// </summary> protected override void DecodeSmscResponse() { byte[] remainder = BytesAfterHeader; ServiceType = SmppStringUtil.GetCStringFromBody(ref remainder); SourceAddressTon = (TonType)remainder[0]; SourceAddressNpi = (NpiType)remainder[1]; SourceAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); DestinationAddressTon = (TonType)remainder[0]; DestinationAddressNpi = (NpiType)remainder[1]; DestinationAddress = SmppStringUtil.GetCStringFromBody(ref remainder, 2); EsmClass = remainder[0]; ProtocolId = remainder[1]; PriorityFlag = (PriorityType)remainder[2]; ScheduleDeliveryTime = SmppStringUtil.GetCStringFromBody(ref remainder, 3); ValidityPeriod = SmppStringUtil.GetCStringFromBody(ref remainder); RegisteredDelivery = (RegisteredDeliveryType)remainder[0]; ReplaceIfPresentFlag = (remainder[1] == 0)? false : true; DataCoding = (DataCoding)remainder[2]; SmDefaultMessageId = remainder[3]; _SmLength = remainder[4]; ShortMessage = SmppStringUtil.GetStringFromBody(ref remainder, 5, 5 + _SmLength); TranslateTlvDataIntoTable(remainder); }