Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

While the Camel component makes it as easy as possible to send messages to the SMS network, it can not offer an easy solution to these problems.

Data coding, alphabet and international character sets

Data coding and alphabet can be specified on a per-message basis.  Default values can be specified for the endpoint.  It is important to understand the relationship between these options and the way the component acts when more than one value is set.

Data coding is an 8 bit field in the SMPP wire format.

Alphabet corresponds to bits 0-3 of the data coding field.  For some types of message, where a message class is used (by setting bit 5 of the data coding field), the lower two bits of the data coding field are not interpreted as alphabet and only bits 2 and 3 impact the alphabet.

Furthermore, current versions of the JSMPP library only seems to support bits 2 and 3, assuming that bits 0 and 1 are used for message class.  This is why the Alphabet class in JSMPP doesn't support the value 3 (binary 0011) which indicates ISO-8859-1.

When setting the data coding field in the outgoing message, the Camel component considers the following values and uses the first one it can find:

  • the data coding specified in a header
  • the alphabet specified in a header
  • the data coding specified in the endpoint configuration (URI parameter)

Older versions of Camel had bugs in support for international character sets.  This feature only worked when a single encoding was used for all messages and was troublesome when users wanted to change it on a per-message basis.  Users who require this to work should ensure their version of Camel includes the fix for CAMEL-7224.

In addition to trying to send the data coding value to the SMSC, the Camel component also tries to analyze the message body, convert it to a Java String (Unicode) and convert that to a byte array in the corresponding alphabet.  If some characters in the String can't be represented in the chosen alphabet, they may be replaced by the question mark ( ? ) symbol.  Users of the API may want to consider checking if their message body can be converted to ISO-8859-1 before passing it to the component and if not, setting the alphabet header to request UCS-2 encoding.  If the alphabet and data coding options are not specified at all then the component may try to detect the required encoding and set the data coding for you.

URI format

Code Block
smpp://[username@]hostname[:port][?options]
smpps://[username@]hostname[:port][?options]

...