graylog-labs / graylog-plugin-twiliosms

Transport that sends alarms via the Twilio SMS API
http://www.graylog2.org/
Other
2 stars 6 forks source link

Could not send alarm via Twilio SMS - The message body exceeds the 160 character limit #2

Open chrissam opened 7 years ago

chrissam commented 7 years ago

My Test notification worked with Twilio but when I tried testing few alert notification based on conditions, I got the below error in my graylog server indicating message body exceeds the 160 character limit.

2017-03-16T18:39:28.747Z ERROR [TwilioSmsAlarmCallback] Could not send alarm via Twilio SMS
com.twilio.sdk.TwilioRestException: The message body exceeds the 160 character limit.
    at com.twilio.sdk.TwilioRestException.parseResponse(TwilioRestException.java:74) ~[?:?]
    at com.twilio.sdk.TwilioRestClient.safeRequest(TwilioRestClient.java:525) ~[?:?]
    at com.twilio.sdk.TwilioRestClient.safeRequest(TwilioRestClient.java:505) ~[?:?]
    at com.twilio.sdk.resource.list.SmsList.create(SmsList.java:70) ~[?:?]
    at org.graylog2.alarmcallbacks.twilio.TwilioSmsAlarmCallback.send(TwilioSmsAlarmCallback.java:142) ~[?:?]
    at org.graylog2.alarmcallbacks.twilio.TwilioSmsAlarmCallback.call(TwilioSmsAlarmCallback.java:122) ~[?:?]
    at org.graylog2.alarmcallbacks.twilio.TwilioSmsAlarmCallback.call(TwilioSmsAlarmCallback.java:75) ~[?:?]
    at org.graylog2.alerts.AlertNotificationsSender.send(AlertNotificationsSender.java:58) ~[graylog.jar:?]
    at org.graylog2.alerts.AlertScanner.handleTriggeredAlert(AlertScanner.java:45) ~[graylog.jar:?]

While checking Twilio website, it was stated that "This error is for the deprecated SMS/Messages resource. To increase your character limit to 1600, you can switch to using the supported Messages resource." Appreciate if you can update the code.