Page 1 of 1

DeliverSm.Concatenation is null in long mesage

Posted: Sat Jan 09, 2016 9:27 am
by ashish
when we send long message as below method

if ((DataCodings)Enum.Parse(typeof(DataCodings), objSMS.messageType.ToString()) == DataCodings.Default)
_client.MapEncoding(DataCodings.Default, Encoding.Default);

//code for send multiple message asynchronously
byte[] b = Encoding.ASCII.GetBytes(ID);
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()))
.AddParameter(OptionalTags.ReceiptedMessageId, b)
.DeliveryReceipt();

_client.SubmitAsync(builder);

we want use OnFullMessageReceived when we send long message but on client_evDeliverSm event data.Concatenation is null
so how can we get Concatenation message

Re: DeliverSm.Concatenation is null in long mesage

Posted: Thu Jul 28, 2016 9:30 am
by tera
I have the same problem, messageLong is 180 char
this is my code :

string ID = "1";
//code for send multiple message asynchronously
byte[] b = Encoding.ASCII.GetBytes(ID);
ISubmitSmBuilder builder = SMS.ForSubmit()
.Text(messageLong)
.From("mittente", AddressTON.International, AddressNPI.ISDN)
.To("3333333333", AddressTON.International, AddressNPI.ISDN)
.Coding(DataCodings.Default)
.AddParameter(OptionalTags.ReceiptedMessageId, b)
.DeliveryReceipt();

client.SubmitAsync(builder);

public static void client_evDeliverSm(object sender, DeliverSm data)
{
try
{
Concatenation concatenation = data.Concatenation;

// Receive incoming message and try to concatenate all parts
if (concatenation != null)
{

_composer.AddMessage(data);

string messageText = data.Client.GetMessageText(data);

Console.WriteLine("DeliverSm part received : "
+ " Sequence : " + data.Sequence
+ " SourceAddr : " + data.SourceAddr
+ " Concatenation ( " + concatenation + " )"
+ " Coding : " + data.DataCoding
+ " Text : " + messageText);


if (_composer.IsLastSegment(data))
{

string fullMessage = _composer.GetFullMessage(data);

Console.WriteLine("Full message text: " + fullMessage);
}

}
else
{ Console.WriteLine("single message "+ data.MessageText); }


}
catch (Exception ex)
{
data.Response.Status = CommandStatus.ESME_RX_T_APPN;

}
}

data.Concatenation in the event always is null.
Any answer?

Re: DeliverSm.Concatenation is null in long mesage

Posted: Thu Jul 28, 2016 10:09 am
by alt
what do you receive in evDeliverSm event? delivery receipt or message from mobile phone?
You should not expect concatenation parameter for delivery receipt.

Could you post here or send on support email the dump of this DeliverSm PDU?

Re: DeliverSm.Concatenation is null in long mesage

Posted: Thu Jul 28, 2016 11:32 am
by tera
Hi Alt,
This in my DeliverSm

{DeliverSm, Length: 174, Status: ESME_ROK, Sequence: 0, SourceAddr: 3333333333, DestAddr: mittente}
base {Inetlab.SMPP.PDU.SmppRequest<Inetlab.SMPP.PDU.DeliverSmResp>}: {DeliverSm, Length: 174, Status: ESME_ROK, Sequence: 0, SourceAddr: 3333333333, DestAddr: mittente}
Acknowledgement: NotRequested
Concatenation: null
ConcatenationKey: 'data.ConcatenationKey' threw an exception of type 'System.NullReferenceException'
DataCoding: Default
DestAddr: "mittente"
DestAddrNpi: 0
DestAddrTon: 0
EsmClass: 4
MessageFeature: No
MessageMode: Default
MessageText: "id:AGILE-8A664CEA87CB-B05897F55746 sub:001 dlvrd:001 submit date:1607281323 done date:1607281323 stat:DELIVRD err:000 Text:"
MessageType: SMSCDeliveryReceipt
Notification: NotRequested
Optional: {Inetlab.SMPP.Common.TLVCollection}
PacketBytes: {byte[174]}
PriorityFlag: 0
ProtocolId: 0
Receipt: {id:AGILE-8A664CEA87CB-B05897F55746 sub:001 dlvrd:001 submit date:1607281323 done date:1607281323 stat:DELIVRD err:000 Text:}
RegisteredDelivery: 0
Response: {DeliverSmResp, Length: 16, Status: ESME_ROK, Sequence: 0}
ServiceType: ""
SMSCReceipt: NotRequested
SourceAddr: "3333333333"
SourceAddrNpi: 0
SourceAddrTon: 0
UserDataPdu: {Inetlab.SMPP.Common.UserData}

Could you send me an example to send a long-text ?
In this case I set a Optional parameters OptionalTags.ReceiptedMessageId with .AddParameter(OptionalTags.ReceiptedMessageId, b) in SubmitSmBuilder How I can read it in DeliverSm TLV collections in empty.
Thanks

Re: DeliverSm.Concatenation is null in long mesage

Posted: Thu Jul 28, 2016 12:51 pm
by alt
You don't need to send you own id with the message.
Remove following line from your code:

.AddParameter(OptionalTags.ReceiptedMessageId, b)

How to detect delivery receipt that correspond to submitted message you can read at
http://wiki.inetlab.com/doku.php/smpp/delivery_receipt

Re: DeliverSm.Concatenation is null in long mesage

Posted: Thu Jul 28, 2016 2:07 pm
by tera
Thanks alt,
but data.Concatenation in DeliverSm data is null.

Re: DeliverSm.Concatenation is null in long mesage

Posted: Thu Jul 28, 2016 2:36 pm
by alt
for Delivery Receipt it is always null