Class BinaryMessage

java.lang.Object
com.vonage.client.sms.messages.Message
com.vonage.client.sms.messages.BinaryMessage
All Implemented Interfaces:
QueryParamsRequest

public class BinaryMessage extends Message
A binary message to be submitted via the Vonage SMS API.
  • Constructor Details

    • BinaryMessage

      public BinaryMessage(String from, String to, byte[] messageBody, byte[] udh)
      Instantiate a new binary sms message request.
      Parameters:
      from - the 'from' address that will be seen on the handset when this message arrives, typically either a valid short-code / long code that can be replied to, or a short text description of the application sending the message (Max 11 chars)
      to - the phone number of the handset that you wish to send the message to
      messageBody - The raw binary message data to be sent to a handset. This api, and the Vonage sms service will send this data 'as-is' (in conjunction with the binary UDH) and will not make any corrections. so you should ensure that it is a correctly constructed message
      udh - Most binary content will require a UserDataHeader portion of the message containing commands to enable the handset to interpret the binary data (for example, a binary ringtone, a wap-push, OverTheAir configuration etc.). Additionally, if you are sending a long text message as multiple concatenated messages and are performing this operation manually rather than using the automated long sms handling in the Vonage sms service, then you will need to construct and include here an appropriate UserDataHeader field that describes the segmentation/re-assembly fields required to successfully concatenate multiple short messages.
  • Method Details

    • getMessageBody

      public byte[] getMessageBody()
      Returns:
      byte[] The raw binary message data to be sent to a handset. This api, and the Vonage sms service will send this data 'as-is' (in conjunction with the binary UDH) and will not make any corrections. so you should ensure that it is a correctly constructed message
    • getUdh

      public byte[] getUdh()
      Returns:
      byte[] Most binary content will require a UserDataHeader portion of the message containing commands to enable the handset to interpret the binary data (for example, a binary ringtone, a wap-push, OverTheAir configuration, etc.). Additionally, if you are sending a long text message as multiple concatenated messages and are performing this operation manually rather than using the automated long sms handling in the Vonage sms service, then you will need to construct and include here an appropriate UserDataHeader field that describes the segmentation/re-assembly fields required to successfully concatenate multiple short messages.
    • getProtocolId

      public int getProtocolId()
      Returns:
      Integer The value of the GSM Protocol ID field to be submitted with this message. Ordinarily this should be left as the default value of 0
    • setProtocolId

      public void setProtocolId(int protocolId)
    • makeParams

      Description copied from interface: QueryParamsRequest
      Internal method for serializing the fields of this class into query parameters. The Map should be mutable so that subclasses can add fields, otherwise the method or implementing class should be marked as final. Duplicate entries can be handled by mapping the key to a list of the entries.
      Specified by:
      makeParams in interface QueryParamsRequest
      Overrides:
      makeParams in class Message
      Returns:
      The query parameters as unique key-value pairs.