hello
i want to read message part header(UDH) .
and get it in string variable like :
050003CC0201
050003CC0202
how can i do that ?
how van i read Message part header
Re: how van i read Message part header
i send message in this way
Code: Select all
Dim resp As IList(Of SubmitSmResp)
resp = _client.Submit(SMS.ForSubmit().From(srcAdr, srcTon, srcNpi).To(dstAdr, dstTon, dstNpi).Coding(coding).Text(msg.Message).ExpireIn(TimeSpan.FromDays(1)).DeliveryReceipt())
For Each msg_Status As SubmitSmResp In resp
Dim m As New UserDataHeader
m = msg_Status.Request.UserDataPdu.Headers(0)
Next
Re: how van i read Message part header
any help ???
Re: how van i read Message part header
heeeeeeelp !!!! 

Re: how van i read Message part header
Hello mohdis,
Sorry for late response.
UserDataHeaderCollection has implicit conversion operator to byte array. So you can just assign UserDataPdu.Headers to byte array variable and then convert this array to hex string.
var req = SMS.ForSubmit().From(srcAdr, srcTon, srcNpi).To(dstAdr, dstTon, dstNpi).Coding(coding).Text(msg.Message).ExpireIn(TimeSpan.FromDays(1)).DeliveryReceipt().Create(_client);
foreach (var submitSm in req)
{
byte[] header = submitSm.UserDataPdu.Headers;
Console.WriteLine(ByteArray.ToHexString(header));
}
Sorry for late response.
UserDataHeaderCollection has implicit conversion operator to byte array. So you can just assign UserDataPdu.Headers to byte array variable and then convert this array to hex string.
var req = SMS.ForSubmit().From(srcAdr, srcTon, srcNpi).To(dstAdr, dstTon, dstNpi).Coding(coding).Text(msg.Message).ExpireIn(TimeSpan.FromDays(1)).DeliveryReceipt().Create(_client);
foreach (var submitSm in req)
{
byte[] header = submitSm.UserDataPdu.Headers;
Console.WriteLine(ByteArray.ToHexString(header));
}
Re: how van i read Message part header
thank you .
another last Question :
is this correct way to send long message by syncmode to check if any part failed and try to send again ?
Dim pduBuilder As Inetlab.SMPP.Builders.ISubmitSmBuilder
pduBuilder = SMS.ForSubmit() _
.From(srcAdr, srcTon, srcNpi) _
.To(dstAdr, dstTon, dstNpi) _
.Coding(coding) _
.Text(msg.Message) _
.ExpireIn(TimeSpan.FromDays(1)) _
.DeliveryReceipt()
For Each xpdu In pduBuilder.Create(_client)
x += 1
Dim m_resp As SubmitSmResp = _client.Submit(xpdu)
If m_resp.Status = CommandStatus.ESME_ROK Then
FinalMessageStatus = True
' m_MsgId = xpdu.
m_MsgStatus = Int(m_resp.Status)
Thread.Sleep(10)
Else
Thread.Sleep(50)
m_resp = _client.Submit(xpdu) 'another try to failed part
End If
Next
another last Question :
is this correct way to send long message by syncmode to check if any part failed and try to send again ?
Dim pduBuilder As Inetlab.SMPP.Builders.ISubmitSmBuilder
pduBuilder = SMS.ForSubmit() _
.From(srcAdr, srcTon, srcNpi) _
.To(dstAdr, dstTon, dstNpi) _
.Coding(coding) _
.Text(msg.Message) _
.ExpireIn(TimeSpan.FromDays(1)) _
.DeliveryReceipt()
For Each xpdu In pduBuilder.Create(_client)
x += 1
Dim m_resp As SubmitSmResp = _client.Submit(xpdu)
If m_resp.Status = CommandStatus.ESME_ROK Then
FinalMessageStatus = True
' m_MsgId = xpdu.
m_MsgStatus = Int(m_resp.Status)
Thread.Sleep(10)
Else
Thread.Sleep(50)
m_resp = _client.Submit(xpdu) 'another try to failed part
End If
Next
Re: how van i read Message part header
It depends on the response status.
For ESME_RTHROTTLED it will likely work, but could be possible that you need longer delay.
Also you need to take next xpdu.Sequence before repeat.
For ESME_RTHROTTLED it will likely work, but could be possible that you need longer delay.
Also you need to take next xpdu.Sequence before repeat.