Package com.opentok
Class SipProperties.Builder
- java.lang.Object
-
- com.opentok.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 Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SipProperties
build()
Builds the SipProperties object.SipProperties.Builder
from(java.lang.String from)
Call this method to set the SIPfrom
field (optional).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.SipProperties.Builder
observeForceMute(boolean observeForceMute)
Call this method and pass intrue
to have the SIP end point observe force mute moderation.SipProperties.Builder
password(java.lang.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 intrue
to indicate that the media must be transmitted encrypted.SipProperties.Builder
sipUri(java.lang.String sipUri)
Call this method to set the SIP URI.SipProperties.Builder
streams(java.lang.String... streams)
The stream IDs of the participants' which will be subscribed by the SIP participant.SipProperties.Builder
userName(java.lang.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 intrue
to enable video in the SIP call.
-
-
-
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 thesecure
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 SIPfrom
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 intrue
to indicate that the media must be transmitted encrypted. Pass infalse
, 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 intrue
to enable video in the SIP call. The default isfalse
.- 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 intrue
to have the SIP end point observe force mute moderation. The default isfalse
.- Parameters:
observeForceMute
- Whether to observe force mute moderation.- Returns:
- The SipProperties.Builder object with the observeForceMute setting.
-
streams
public SipProperties.Builder streams(java.lang.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.
-
-