And we are use UserDataHeader and Esmclass as below code
Code: Select all
clsSMS objSMS = (clsSMS)obj;
byte[] aaa = new byte[6];
aaa[0] = 0x05; // Field 1 (1 octet): Length of User Data Header, in this case 05.
aaa[1] = 0x08;// Field 2 (1 octet): Information Element Identifier, equal to 00 (Concatenated short messages, 8-bit reference number) equal to 08 (Concatenated short messages, 16-bit reference number)
aaa[2] = 0x03;// Field 3 (1 octet): Length of the header, excluding the first two fields; equal to 03
//aaa[3] = 0000;// Field 4 (1 octet): 00-FF, CSMS reference number, must be same for all the SMS parts in the CSMS / (2 octets): 0000-FFFF, CSMS reference number, must be same for all the SMS parts in the CSMS
aaa[3] = 0xCC; //Convert.ToByte(objSMS.referencenumber);// Field 5 (1 octet): 00-FF, total number of parts.
aaa[4] = 0x02 ;//Convert.ToByte(objSMS.totalnumber);// Field 5 (1 octet): 00-FF, total number of parts.
aaa[5] = 0x01; //Convert.ToByte(objSMS.partnumber);// Field 6 (1 octet): 00-FF, this part's number in the sequence.
UserDataHeader udh = new UserDataHeader();
udh.Data = aaa;
//code for send multiple message asynchronously
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
ISubmitSmBuilder builder = SMS.ForSubmit()
.Text(objSMS.Message)
.From(SourcePrefix + objSMS.StrSenderId, (byte)SourceTon, (byte)SourceNPI)
.To(DestinationPrefix + objSMS.MobileNo, (byte)DestinationTon, (byte)DestinationNPI)
.Coding((DataCodings)Enum.Parse(typeof(DataCodings), objSMS.messageType.ToString()))
.Set(delegate(SubmitSm sm) { sm.UserDataPdu.Headers.Add(udh); sm.EsmClass = 64; })
.DeliveryReceipt();
_client.SubmitAsync(builder);
System.Windows.Forms.Application.DoEvents();