public SmsDeliver(long smscNumber, AddressField.Address destinationNumber, string message) { string result = PduEncoder.EncodeServiceCenterNumber(new AddressField.Address(smscNumber)); //result += ((int)m_MessageTypeIndicator + // (int)m_RejectDuplicates + // (int)m_ValidityPeriodFormat + // (int)m_StatusReportRequest + // (int)m_UserDataHeaderIndicator + // (int)m_ReplyPath).ToString("X2"); //result += ((int)m_MessageReferece).ToString("X2"); //result += destinationNumber.ToString(); //result += ((int)m_ProtocolIdentifier).ToString("X2"); //result += m_DataCodingScheme.OctetRepresentation; //result += m_ValidityPeriod.OctetRepresentation; ////in the case of UCS2 //result += (message.Length * 2).ToString("X2"); //result += PduEncoder.EncodeUCS2(message); //this.pduCode = result; }
/// <summary> /// SMSC Number /// </summary> /// <param name="number"></param> /// <returns></returns> public static string EncodeServiceCenterNumber(AddressField.Address number) { string temp = number.ToString(); int length = (int.Parse(temp.Substring(0, 2), System.Globalization.NumberStyles.HexNumber) + 2) / 2; temp = temp.Remove(0, 2); return(length.ToString("X2") + temp); }