Package 

Class CallInvite

  • All Implemented Interfaces:
    android.os.Parcelable

    
    public class CallInvite
     implements Parcelable
                        

    Represents an incoming call message from Twilio. This object is used to respond to an incoming call by calling accept or

    • Method Detail

      • getCustomParameters

        @NonNull() Map<String, String> getCustomParameters()

        Returns the custom parameters.

        {@code * // Pass custom parameters in TwiML *  * *    
             * * }
        `callInvite.getCustomParameters()` returns a map of key-value pair passed in the TwiML.
        {@code * "caller_first_name" -> "alice" * "caller_last_name" -> "smith" * }
        NOTE: While the value field passed into <Parameter> gets URI encoded by the Twilioinfrastructure and URI decoded when parsed during the creation of a CallInvite, the name doesnot get URI encoded or decoded. As a result, it is recommended that the name field only useASCII characters.
      • sendMessage

         String sendMessage(CallMessage message)

        Sends a user-defined message to endpoints that have subscribed for user-defined messages. Theresult will be raised to the Call.CallMessageListener provided as either a callbackargument to the handleMessage method and/or asan accept option when a call invite is either accepted or rejected. Calling the `sendMessage`method without subscribing first will result in an error in your Twilio developer console.Sending a call message with content size that exceeds 10 KB or sending more than 10 callmessages within one minute will result in the callback. Whenattempting to send a message larger than 10k, the error will not show in the developerconsole. A call message with content that does not match the content type will not result inthe onMessageFailure callback but will generate an error in your Twilio developer console. For example, a callmessage with content type "application/json" but with the content "Hello World", which is nota valid JSON object, will result in such error.

        Parameters:
        message - The call message to send.
      • isValid

         static boolean isValid(Context context, Bundle data)

        Validates whether the payload is a valid notification sent by Twilio. A valid notificationpayload will result in a CallInvite being raised via callback when passed to {@code * Voice.handleMessage(...)}.

        Parameters:
        context - An Android context.
        data - Push notification payload.
      • isValid

         static boolean isValid(Context context, Map<String, String> data)

        Validates whether the payload is a valid notification sent by Twilio. A valid notificationpayload will result in a CallInvite being raised via callback when passed to {@code * Voice.handleMessage(...)}.

        Parameters:
        context - An Android context.
        data - Push notification payload.