startDialOut()
Starts a Dialout to SIP or PSTN. Note that the participant who initiates this must be an owner or an admin.
startDialOut(params)
Parameters
sipUri
is a string used to define the SIP URI of the user being called.- This needs to conform to a SIP URI as defined in the RFC.
phoneNumber
is a string that references the phone number to call. This must be a valid E.164 number (example +12268077097).displayName
When the SIP or PSTN user joins the call, user is shown withdisplayName
. In case displayName is not given SIP user is shown as username in the SIP URI and PSTN user is shown as phone number.callerId
determine the phone number used for outbound call (i.e. phone number displayed on the called phone). default is the oldest purchased phone number on the platform.userId
userId to assign to the participant. defaultuserId
is null.video
enable/disable SIP video. only valid whensipUri
is setcodecs
audio and video codecs to use for dialout. The first codec in the arrays is used for dialout. Supported video codecs areH264
andVP8
. Default isH.264
. Supported audio codecs arePCMU
,OPUS
,G722
,PCMA
. Default isOPUS
.
Return Value
A dialoutSessionId
, which is a UUID string identifying the initiated SIP session.
Compatibility:
Prebuilt
Custom
Errors
Below are the possible errors that the caller of startDialOut()
can expect to be thrown:
NOT_ALLOWED
: will be thrown in case SIP/PSTN is not allowed for the room.DIALOUT_IN_PROGRESS
: will be thrown in case the user tries to invoke dialOut more than once.TEMPORARILY_NOT_AVAILABLE
: will be thrown in case there are no workers available, usually while we are scaling up.