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 with displayName. 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. default userId is null.
  • video enable/disable SIP video. only valid when sipUri is set
  • codecs audio and video codecs to use for dialout. The first codec in the arrays is used for dialout. Supported video codecs are H264 and VP8. Default is H.264. Supported audio codecs are PCMU, OPUS, G722,PCMA. Default is OPUS.

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.