Package com.opentok

Class SipProperties.Builder

  • Enclosing class:
    SipProperties

    public static class SipProperties.Builder
    extends java.lang.Object
    Use this class to create a SipProperties object.
    See Also:
    SipProperties
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • sipUri

        public SipProperties.Builder sipUri​(java.lang.String sipUri)
        Call this method to set the SIP URI.
        Parameters:
        sipUri - ​(required) — The SIP URI to be used as destination of the SIP call initiated from OpenTok to your SIP platform. If the SIP URI contains a ​ transport=tls​ header, the negotiation between OpenTok and the SIP endpoint will be done securely. Note that this will only apply to the negotiation itself, and not to the transmission of audio. If you also audio transmission to be encrypted, set the ​secure​ property to ​true
        Returns:
        The SipProperties.Builder object with the SIP URI set.
      • from

        public SipProperties.Builder from​(java.lang.String from)
        Call this method to set the SIP from field (optional).
        Parameters:
        from - The number or string that will be sent to the final SIP number as the caller. It must be a string in the form of from@example.com, where from can be a string or a number. If from is set to a number (for example, "14155550101@example.com"), it will show up as the incoming number on PSTN phones. If from is undefined or set to a string (for example, "joe@example.com"), +00000000 will show up as the incoming number on PSTN phones.
        Returns:
        The SipProperties.Builder object with the from number set.
      • userName

        public SipProperties.Builder userName​(java.lang.String userName)
        Call this method to set the username for the SIP gateway provider (optional).
        Parameters:
        userName - The username.
        Returns:
        The SipProperties.Builder object with the username set.
      • password

        public SipProperties.Builder password​(java.lang.String password)
        Call this method to set the password for the SIP gateway provider (optional).
        Parameters:
        password - The password.
        Returns:
        The SipProperties.Builder object with the password set.
      • headersJsonStartingWithXDash

        public SipProperties.Builder headersJsonStartingWithXDash​(java.lang.String headersJsonStartingWithXDash)
        Call this method to define custom headers to be added to the SIP ​INVITE​ initiated from OpenTok to your SIP platform.
        Parameters:
        headersJsonStartingWithXDash - This JSON string defines custom headers to be added to the SIP ​INVITE​ request initiated from OpenTok to your SIP platform.

        Note: You no longer need to append the ​"X-"​ prefix to the beginning of custom headers. This restriction, which applied previously, has been removed.

        Returns:
        The SipProperties.Builder object.
      • secure

        public SipProperties.Builder secure​(boolean secure)
        Call this method and pass in true to indicate that the media must be transmitted encrypted. Pass in false​, the default, if encryption is not required.
        Parameters:
        secure - A Boolean flag that indicates whether the media must be transmitted encrypted (​true​) or not (​false​, the default).
        Returns:
        The SipProperties.Builder object with the media security setting.
      • video

        public SipProperties.Builder video​(boolean video)
        Call this method and pass in true to enable video in the SIP call. The default is false.
        Parameters:
        video - Whether video should be enabled in the SIP call.
        Returns:
        The SipProperties.Builder object with the SIP video setting.
      • observeForceMute

        public SipProperties.Builder observeForceMute​(boolean observeForceMute)
        Call this method and pass in true to have the SIP end point observe force mute moderation. The default is false.
        Parameters:
        observeForceMute - Whether to observe force mute moderation.
        Returns:
        The SipProperties.Builder object with the observeForceMute setting.
      • build

        public SipProperties build()
        Builds the SipProperties object.
        Returns:
        The SipProperties object.