Use message types

<< Click to Display Table of Contents >>

Navigation:  How to... >

Use message types

Message types are used to specify what the message means and how it should be sent. Message types are gateway specific, not all messages types will be understood by all gateways. In those cases the gateway will resort to its default message handling to send the message. In the Paging Gateway the message type is used to select which service is used to send the message. The following message types are the standard message types used in Diafaan SMS Server.



Text messages

Text messages can be split and later recombined into multiple SMS messages to increase the message length. Splitting the messages takes a couple of character spaces from each message. The maximum number of characters sent in each SMS message also depends on the character set used for the message.



If possible the text is sent in the default GSM SMS alphabet. If the message contains characters that are not in the default alphabet the text is sent as unicode. Since an SMS unicode message has a maximum length of 70 characters and a text in the default GSM SMS alphabet has a maximum of 160 characters the number of characters that are sent to the phone will depend on the characters that are used in the message.



The default GSM SMS alphabet is always used to send the message. Characters that are not available in the default GSM SMS alphabet are converted to question marks. The message length of a message sent with the default alphabet is usually 160 characters but some characters, like the € symbol take the place of two normal characters and will decrease the maximum message length.



The message will always be sent in unicode text. This means that the maximum amount of characters in one message is always 70 characters, even if the message contains only characters from the default GSM SMS alphabet.


Flash message

If implemented on the GSM phone, flash messages are displayed directly on the phone's screen instead of being stored in the message inbox. You can send a flash message with one of the message types:






Binary messages

Binary message can contain up to 140 bytes per SMS message. In Diafaan SMS Server all bytes of the binary messages are encoded in two uppercase hexadecimal digits, for example the 'A' byte is encoded to 41. In addition to the data itself, a binary message can also contain a User Data Header. This UDH usually defines the purpose of the data.



Binary message can be sent in five ways: data only, with user data header, with data coding scheme, with user data length or with protocol identifier.


Data only:


Data message:



User Data Header plus Data:


Data message:



Data Coding Scheme plus User Data Header plus Data:

Usable for data or unicode messages


Unicode message:


Data message:



Data Coding Scheme plus User Data Length plus User Data Header plus Data:

Usable for data, text or unicode messages


Text message:


Unicode message:


Data message:



Data Coding Scheme plus Protocol Identifier plus User Data Length plus User Data Header plus Data:

Usable for data, text or unicode messages with a special protocol identifier


Text message:


Unicode message


Data message:


Empty text message with PID value 0x40 (Type 0, silent message):



See Send a WAP push message for an example of a binary messages.



Only available for GSM Modem Gateways

GSM modems send SMS messages as binary data strings called Packet Data Units. If you use the sms.pdu message type you can send a fully customized SMS PDU.



Only available for SMPP Gateways

The SMPP protocol uses a binary Packet Data Unit that is different from the SMS PDU format. If you use the smpp.pdu message type you can send a fully customized SMPP PDU.


USSD commands

USSD is a standard for transmitting information over GSM signaling channels. It is mostly used as a method to query the available balance and other similar information in pre-paid GSM services. The function that is triggered when sending USSD is network-dependent and depends on the specific services the operator is offering.



Only available for GSM Modem Gateways

The USSD code should be sent in the to field of the message. The response is sent back as a received SMS message.


Example USSD codes:

   * *101#

   * *109*72348937857623#