java.lang.Object

com.opentok.SipProperties.Builder

Enclosing class: : SipProperties


public static class SipProperties.Builder extends Object

Use this class to create a SipProperties object.

See Also: : - SipProperties

Constructor Summary

Constructors

Constructor

Description

Builder()

Method Summary

All MethodsInstance MethodsConcrete Methods

Modifier and Type

Method

Description

SipProperties

build()

Builds the SipProperties object.

SipProperties.Builder

from(String from)

Call this method to set the SIP from field (optional).

SipProperties.Builder

headersJsonStartingWithXDash(String headersJsonStartingWithXDash)

Call this method to define custom headers to be added to the SIP ​INVITE​ initiated from OpenTok to your SIP platform.

SipProperties.Builder

observeForceMute(boolean observeForceMute)

Call this method and pass in true to have the SIP end point observe force mute moderation.

SipProperties.Builder

password(String password)

Call this method to set the password for the SIP gateway provider (optional).

SipProperties.Builder

secure(boolean secure)

Call this method and pass in true to indicate that the media must be transmitted encrypted.

SipProperties.Builder

sipUri(String sipUri)

Call this method to set the SIP URI.

SipProperties.Builder

streams(String... streams)

The stream IDs of the participants' which will be subscribed by the SIP participant.

SipProperties.Builder

userName(String userName)

Call this method to set the username for the SIP gateway provider (optional).

SipProperties.Builder

video(boolean video)

Call this method and pass in true to enable video in the SIP call.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Builder

public Builder()

Method Details

sipUri

public SipProperties.Builder sipUri(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(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(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(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(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.

streams

public SipProperties.Builder streams(String... streams)

The stream IDs of the participants' which will be subscribed by the SIP participant. If not provided, all streams in session will be selected.

Parameters: : streams - Stream IDs to select.

Returns: : The SipProperties.Builder object with the streams setting.

build

public SipProperties build()

Builds the SipProperties object.

Returns: : The SipProperties object.