Message encoding & submit mode detection

.NET library for SMPP protocol
Locked
shazia1
Posts: 12
Joined: Wed Nov 16, 2011 10:22 am

Message encoding & submit mode detection

Post by shazia1 » Thu Nov 24, 2011 6:28 am

Is there any way to detect the submit mode & encoding of sending sms?
Actually I have a scenario in which sms details are saved in a database table, and my service is pulling the details from table and sending the sms to intended recipients. In this case, is there any way that I could detect that the message text I have just pulled from DB, is actually a short message or a long one, based on its encoding. The database can contain english as well as arabic text messages.

Urgent reply needed.
alt
Site Admin
Posts: 985
Joined: Tue Apr 25, 2006 9:45 am

Re: Message encoding & submit mode detection

Post by alt » Fri Nov 25, 2011 1:21 pm

Hi shazia1,

Submit mode is just a way how SMSC expects SubmtiSm to be formated. Usually it is short_message filed with UDH, but sometimes they prefer to have message in TLV parameter message_payload, more rare short_message field plus concatenation data in SAR TLV parameters.
Encoding is just a way how text converted to bytes. As we know each SMS part cannot be more than 140 bytes, therefore for UCS2 you can send only 70 symbols, in ASCII 140 symbols and in packed GSM encoding 160 symbols. Every SMS part usually charged as one SMS. So for long text you can pay two or more times, because of concatenation.

What SMS details do you store in database? And who is originator of these messages? Do you receive them as SubmitSm in your SMPP server? or as DeliverSM from SMSC? or as Text from Web request?
shazia1
Posts: 12
Joined: Wed Nov 16, 2011 10:22 am

Re: Message encoding & submit mode detection

Post by shazia1 » Mon Nov 28, 2011 5:20 am

The SMS details are entered in DB from application. There is a windows service which pulls the details from DB and send them to nos. saved in database against each sms. Now I am just looking for a method to which i pass my text message, and it tell me that, for example, the message is UC2 encoded and according to this encoding and message length, it will make either the long or short sms. .. Well, not exactly but something like that.
EroHumanzemN
Posts: 1
Joined: Fri Nov 11, 2011 3:18 am
Contact:

Re: Message encoding & submit mode detection

Post by EroHumanzemN » Fri Jan 27, 2012 6:42 pm

I consider, that you commit an error. Let's discuss.
NickAskew
Posts: 60
Joined: Tue Oct 07, 2008 1:35 pm

Re: Message encoding & submit mode detection

Post by NickAskew » Sun Jan 29, 2012 10:46 pm

Hi Shazia1,

You need to determine before you send the message whether it requires a unicode character set or whether the characters used could be sent via GSM character set. Arabic would need to be UCS2, which allows you to send 70 symbols at a time, so a message using 150 Arabic characters would take 3 messages in UCS2 format to send. The english messages could be sent using GSM, giving you a maximum of 160 characters providing the message doesn't feature some special characters that need 2 GSM characters to represent them.

I use the following code to determine how many SMS's will be required to send a message:

Dim listOfSubmitSm As List(Of SubmitSm) = m_SmppClient.PrepareSubmit(SubmitMode.ShortMessage, m_SourceAddrTon, m_SourceAddrNpi, SourceMobileNum, m_DestAddrTon, m_DestAddrNpi, DestMobileNum, DataCodings.Default, TextMessageBody)
Dim numberOfMessagesUsed As Integer = listOfSubmitSm.Count

The parameter in BOLD dictates what character set is used, you can use DataCodings.Default for your English messages and DataCodings.UCS2 for your Arabic messages.

Regards

Nick
ProcessFlows UK Ltd
http://www.processflows.co.uk/
Locked