Generate header for concatenated messages?
Posted: Tue Aug 17, 2021 9:17 am
Hi,
My SMSC is devided into two parts. SMSC_Server to receive SMS messages from SMSC Client and SMSC Transmitter to send the SMS messages to the operator.
For example SMSC_Server receives and parse long message with UDH's 050003020401, 050003020402, 050003020403, 050003020404
Now my SMSC_Transmiiter collect the text and UDH for each part and need to send it to SMSC operator.
Question is how to add the UDH generated by the SMSC_Server to each part of the message in Header or along with the Text message.
I need concatenated messages for ASCII or Default and for UCS2.
Here is my code:
Thanks for any help,
AG
My SMSC is devided into two parts. SMSC_Server to receive SMS messages from SMSC Client and SMSC Transmitter to send the SMS messages to the operator.
For example SMSC_Server receives and parse long message with UDH's 050003020401, 050003020402, 050003020403, 050003020404
Now my SMSC_Transmiiter collect the text and UDH for each part and need to send it to SMSC operator.
Question is how to add the UDH generated by the SMSC_Server to each part of the message in Header or along with the Text message.
I need concatenated messages for ASCII or Default and for UCS2.
Here is my code:
Code: Select all
Inetlab.SMPP.Builders.ISubmitSmBuilder builder = SMS.ForSubmit()
.Data(ByteArrayHelper.FromHex(ByteArrayHelper.ConvertStringToHEX(msg.t42_msg_text)))
.From(msg.t42_originator, (AddressTON)msg.t42_originator_ton, (AddressNPI)msg.t42_originator_npi)
.To(msg.t42_destination, (AddressTON)msg.t42_destination_ton, (AddressNPI)msg.t42_destination_npi)
.Coding(Enum.Parse<DataCodings>(msg.t42_encoding))
.DeliveryReceipt()
.Set(esmclass => esmclass.EsmClass = 0x40)
.ExpireIn(TimeSpan.FromDays(3))
.Set(sm => sm.Header.Sequence = (uint)msg.t42_seq_number);
IList<SubmitSmResp> resp = await _client.SubmitAsync(builder);
Code: Select all
public static string ConvertStringToHEX(string str)
{
string results = string.Empty;
uint iChar;
char[] cArray = str.ToCharArray();
foreach (char c in cArray)
{
iChar = c;
results += iChar.ToString("X4");
}
return results;
}
AG