Class CallMessage

java.lang.Object
com.twilio.voice.CallMessage

public class CallMessage extends Object
Objects that represent messages that can be sent and received via Call.sendMessage(CallMessage) and Call.CallMessageListener respectively. The size limit of the message content is 10 KB. If a messages is attempted to be sent via Call.sendMessage(CallMessage) with message content that exceeds the size limitation, the Call.CallMessageListener.onMessageFailure(String, VoiceException) callback will be triggered and no error will be logged in the Twilio developer console.
  • Method Details

    • getMessageType

      @NonNull public CallMessage.MessageType getMessageType()
      Returns the message type
    • getMessageContentType

      @NonNull public String getMessageContentType()
      Returns the MIME type for the message. Currently the only supported type is "application/json", which is also the default value.
    • getContent

      @NonNull public String getContent()
      Returns he content body of the message. The format of the message body must match the content type. A CallMessage with content that does not match the content type will not result in the Call.CallMessageListener.onMessageFailure(String, VoiceException) callback being invoked and will instead generate an error in your Twilio developer console. For example, a call message with content type "application/json" but with the content "Hello World", which is not a valid JSON object, will result in such error.
    • getVoiceEventSID

      @NonNull public String getVoiceEventSID()
      Returns the unique identifier of the message.