Package com.twilio.voice
Class CallMessage
java.lang.Object
com.twilio.voice.CallMessage
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, String, VoiceException)
callback will be
triggered and no error will be logged in the Twilio developer console.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns he content body of the message.Returns the MIME type for the message.Returns the message type string.Returns the unique identifier of the message.
-
Method Details
-
getMessageType
Returns the message type string. -
getMessageContentType
Returns the MIME type for the message. Currently the only supported type is "application/json", which is also the default value. -
getContent
Returns he content body of the message. The format of the message body must match the content type. ACallMessage
with content that does not match the content type will not result in theCall.CallMessageListener.onMessageFailure(String, 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
Returns the unique identifier of the message.
-