Package com.opentok
Class SipProperties.Builder
java.lang.Object
com.opentok.SipProperties.Builder
- Enclosing class:
- SipProperties
Use this class to create a SipProperties object.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the SipProperties object.Call this method to set the SIPfrom
field (optional).headersJsonStartingWithXDash
(String headersJsonStartingWithXDash) Call this method to define custom headers to be added to the SIP INVITE initiated from OpenTok to your SIP platform.observeForceMute
(boolean observeForceMute) Call this method and pass intrue
to have the SIP end point observe force mute moderation.Call this method to set the password for the SIP gateway provider (optional).secure
(boolean secure) Call this method and pass intrue
to indicate that the media must be transmitted encrypted.Call this method to set the SIP URI.The stream IDs of the participants' which will be subscribed by the SIP participant.Call this method to set the username for the SIP gateway provider (optional).video
(boolean video) Call this method and pass intrue
to enable video in the SIP call.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
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
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
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
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
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
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
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
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
Builds the SipProperties object.- Returns:
- The SipProperties object.
-