SMS Notification module. Not send UNICODE message

For sms notifications were purchased module sms notifications and AirLink gateways LS300.
After talking with the technical support I was informed that the work on finalizing the module may not be as Sierra Wireless equipment maker reported inability to send a message in Unicode format, at the same time, the document 4114768_ALEOS 4.3.5 Software Configuration User Guide_r1

Interested in your ideas on sending messages in their native language.
:question: :scratch: :bulb:

We have this problem as well.

Using the Sierra Wireless equipment is not the only option for sending texts from Ignition.

One possibility is to use a service like Twilio, which does support Unicode in SMS. Kevin’s on vacation so I can’t check with him, but I’m fairly certain he said the Twilio module supports this. If not, one could certainly write one that does using the Ignition SDK.

I’m sure there are other services that would work, too. As long as they have a public API, odds are good you could write a module to integrate it.

[quote=“KathyApplebaum”]Using the Sierra Wireless equipment is not the only option for sending texts from Ignition.

One possibility is to use a service like Twilio, which does support Unicode in SMS. Kevin’s on vacation so I can’t check with him, but I’m fairly certain he said the Twilio module supports this. If not, one could certainly write one that does using the Ignition SDK.

I’m sure there are other services that would work, too. As long as they have a public API, odds are good you could write a module to integrate it.[/quote]
Your message to the Sierra Wireless Developer Forum

[quote]which gets called via byte[] bs = buildPayload(to, message).getBytes(“US-ASCII”); and sent to the Airlink using DatagramPacket and DatagramSocket.

The above code works great, but only allows ASCII messages. If we try to change buildPayload to use getBytes(“UTF-8”) and String.format("<<<%s,8-bit,%d,%s>>>", to, message.length(), hexBody); or String.format("<<<%s,Unicode,%d,%s>>>", to, message.length(), hexBody); we get ACK203ACK which is “Parse Error on field #3 (Data type and separator)”.

I sent a message to tech support a week ago with no response. Anyone have a pointer on how to build a message that allows non-ASCII characters?
Kathy Applebaum
Software Developer
Inductive Automation[/quote]
field # 3 as I understand number of hex characters in message
в public class AirlinkUdpConnection sms notifications module

[code]private String buildPayload(String to, String message) {
StringBuilder sb = new StringBuilder();

for (int i = 0; i < message.length(); ++i) {
  sb.append(String.format("%02x", new Object[] { Byte.valueOf((byte)message.charAt(i)) }));
}

String hexBody = sb.toString();

return String.format("<<<%s,ASCII,%d,%s>>>", new Object[] { to, Integer.valueOf(message.length()), hexBody });

}
[/code]

I found a mistake, you are using an incorrect method of calculating the number of number of hex characters in message. In UNICODE message coding each of the characters in two bytes, while your function Integer.valueOf (message.length ()) returns the number of two-byte characters, hence the number of hex character in UNICODE message encoding should be Integer.valueOf (message.length ()) * 2

System.out.println(message.getBytes(Charset.forName("UTF-16")).length-2);
returns the correct amount of hex characters