combining concatenated message and sending further

.NET library for SMPP protocol
Locked
alexmed
Posts: 4
Joined: Wed Dec 16, 2015 11:12 am

combining concatenated message and sending further

Post by alexmed » Wed Dec 16, 2015 11:32 am

Hello!

Please advice is that will be possible with Inetlab.SMPP library:

1. create SMPP server, get async(!) parts of several concatenated messages, and send further full message(s) without splitting to parts

As I saw on forum and in examples - this is close to solution http://wiki.inetlab.com/doku.php/smpp/messagecomposer
So expect I will be able to send each full message on "OnFullMessageReceived" eventhandler no matter in what order all parts of each concatenated message arrived

2. receive Delivery Report for each full message, and pass DLR back to source of concatenated parts (?) or what will be the way to notify Originator (who send me multiple parts of concatenated message) the message was delivered, and will software automatically pass DLRs (for each part) back to Originator ?

Kindest regards, Alex


p.s. i understand i can potentially implement and test this by myself with Trial version but seems i have tracks of Inetlab Trial which i tried long time ago, so i have 2 options now - to ask or to buy full, so i decided to ask first :)
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: combining concatenated message and sending further

Post by alt » Fri Dec 18, 2015 4:24 pm

Hello Alex,

1. Yes, MessageComposer was made exactly for this purpose.

2. Your server receives DLRs for each part. You can forward them to the corresponding client. Possible you also need to change SMSC MessgeId in DLR to the Id that you sent to the client in SubmitSmResp. Library doesn't pass DLRs automatically to the client (Originator).
alexmed
Posts: 4
Joined: Wed Dec 16, 2015 11:12 am

Re: combining concatenated message and sending further

Post by alexmed » Mon Dec 21, 2015 8:14 am

thanks for reply!

i tried it with fresh trial and it really works like this but there appeared some problems, please advice if you can:

1. quite often
it happens both on your precompiled Bin in zip package and on my version compiled from scratch in Visual Studio
some screens are attached. I tried to dig deeper but seems it originates somewhere in Dll (may be) so I cant actualy define what's wrong

screens
2015-12-21_014047.png
exception
2015-12-21_014047.png (41.54 KiB) Viewed 12444 times
2015-12-21_014427.png
exception details
2015-12-21_014427.png (41.34 KiB) Viewed 12444 times
2. when I get args.text information and pass it further with SMS.ForSubmit() the Encoding goes wrong, i tried to decode the result to find out what conversion happens - seems the systems tries to submit Windows-1252 text as ISO-8859-3 or smth like that. can you advice how to keep or force right Encoding in case incoming message was UCS2 (i.e. originated from UTF8 ciryllic...)

screen and code below
encoding_2015-12-21_015815.png
encoding result of text фывфывфывфыв.... when received on Client
encoding_2015-12-21_015815.png (631 Bytes) Viewed 12444 times
private void OnFullMessageReceived(object sender, MessageEventHandlerArgs args)
{
.......
.......
SmppClient client = new SmppClient();
client.Connect("127.0.0.1", 2775);
if (client.Status == ConnectionStatus.Open)
{
_log.Info("Connected to SMPP server");
client.Bind("admin", "admin", ConnectionMode.Transceiver);
if (client.Status == ConnectionStatus.Bound)
{
_log.Info("Bound with SMPP server");
}
}


// this part is from WiKi

IList<SubmitSmResp> responses = client.Submit(
SMS.ForSubmit()
.Text(args.Text)
.From("1111")
.To("2222")
.DeliveryReceipt()
alexmed
Posts: 4
Joined: Wed Dec 16, 2015 11:12 am

Re: combining concatenated message and sending further

Post by alexmed » Tue Dec 22, 2015 8:41 am

#2 was easy solved by adding .coding(DataCoding.UCS2)
so this is not more an issue
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: combining concatenated message and sending further

Post by alt » Sat Dec 26, 2015 2:57 pm

Hi alexmed,

1. Could you post here full Stack Trace or describe how to reproduce this exception.
alexmed
Posts: 4
Joined: Wed Dec 16, 2015 11:12 am

Re: combining concatenated message and sending further

Post by alexmed » Sun Dec 27, 2015 9:52 pm

You can reproduce it this way (at least it work for me):
1. start server (and click Start Server)
2. start client and connect with default values (both from demo package - latest was v.1.1.21.5)
3. Client: on twe form switch DataCoding field to UCS2
4. insert insert this to Text field: фывфывфывфы фыв фыввфы вфыв ф фывфывфывфы фыв фыввфы вфыв ф фывфывфывфы фыв фыввфы вфыв ф фывфывфывфы фыв фыввфы вфыв ф фывфывфывфы фыв фыввфы вфыв ф

5. Submit

6. See in Server log:

ERROR: 13: (SmppServerClient) Processing SubmitSm failed, Exception: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at SmppServerDemo.SmppServerDemo.server_evClientSubmitSm(Object sender, SmppServerClient client, SubmitSm data)
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: combining concatenated message and sending further

Post by alt » Wed Dec 30, 2015 10:08 pm

Hi alexmed,

Thank you for pointing this bug to me.

It should be

Text = data.MessageText.Substring(0, Math.Min(20, data.MessageText.Length))
Locked