Configuration Options

The ProvisionPhone() method accepts a configuration object that controls how the phone UI behaves, what features are enabled, and how it integrates with your application. This article documents all available options and how to use them.

ProvisionPhone() Options

Pass a configuration object to ProvisionPhone() with any or all of the following options:

OptionTypeRequiredDescription
ProvisioningobjectYesThe provisioning object from GetProvisioning() or a manually constructed object with SIP credentials
PhoneFrameHTMLIFrameElementYesThe <iframe> element where the phone UI will render
ProfileUserIdstringYesA unique identifier for this phone instance (e.g., a session ID or user identifier)
SessionIdstringYesThe session identifier, typically the SessionToken from Login()
UserIdstringYesThe user identifier from your session
EnableAvatarbooleanNoShow user avatar in the phone UI (default: true)
EnableSettingsbooleanNoShow settings panel accessible from the phone UI (default: false)
EnableDialPadbooleanNoShow dial pad for manual number entry (default: true)
EnableCallTransferbooleanNoEnable call transfer functionality (default: true)
EnableCallHoldbooleanNoEnable call hold functionality (default: true)
EnableCallMutebooleanNoEnable microphone mute during calls (default: true)
EnableCallRecordingbooleanNoEnable call recording (if your account supports it) (default: true)
EnableDeviceSelectorbooleanNoShow audio device (microphone/speaker) selector in settings (default: true)
UiThemeStylestringNoUI theme: 'light', 'dark', or 'system' (follows OS preference) (default: 'light')
LanguagestringNoUI language code (e.g., 'en', 'es', 'fr') or 'auto' to detect from browser (default: 'auto')
OnLoadfunctionNoCallback function invoked when the phone is fully loaded and ready to use

ProvisionPhone() Example

const phone = await window.Siperb."ProvisionPhone"({
    Provisioning: provisioning,
    PhoneFrame: document.getElementById("phone-iframe"),
    ProfileUserId: "user-session-001",
    SessionId: session.SessionToken,
    UserId: session.UserId,
    EnableAvatar: true,
    EnableSettings: true,
    EnableDialPad: true,
    EnableCallTransfer: true,
    EnableCallMute: true,
    UiThemeStyle: 'dark',
    Language: 'en',
    OnLoad: () => {
        // Phone is ready
        console.log('Phone loaded');
    }
});

Manual Provisioning Object

For direct PBX connections (bypassing the Siperb proxy), you can construct a manual provisioning object instead of calling GetProvisioning(). This object contains SIP credentials and connection details.

PropertyTypeDescription
RegistrationModestringConnection type: "Socket" for direct PBX connection, "Proxy" for Siperb proxy
profileNamestringDisplay name for this phone profile (e.g., “Office Phone”)
SipWssServerstringThe PBX server address (hostname or IP)
SipUsernamestringThe SIP username for authentication
SipPasswordstringThe SIP password for authentication
SipDomainstringThe SIP domain (usually the same as the server address)
ProfileUserNamestringThe caller ID display name (appears on inbound calls)
SipContactstringContact user parameter; leave empty string if not needed
SipWebsocketPortnumberThe WebSocket port for SIP over WebSocket (e.g., 8089)
SipServerPathstringThe WebSocket path on the server (e.g., "/ws")

Manual Provisioning Example

Here’s how to use a manually constructed provisioning object for a direct connection:

const manualProvisioning = {
    RegistrationMode: "Socket",
    profileName: "Direct PBX",
    SipWssServer: "pbx.company.local",
    SipUsername: "user@company.local",
    SipPassword: "sip-password",
    SipDomain: "pbx.company.local",
    ProfileUserName: "John Doe",
    SipContact: "",
    SipWebsocketPort: 8089,
    SipServerPath: "/ws"
};

const phone = await window.Siperb."ProvisionPhone"({
    Provisioning: manualProvisioning,
    PhoneFrame: document.getElementById("phone-iframe"),
    ProfileUserId: "user-123",
    SessionId: "session-token",
    UserId: "user-id"
});

Comparison: Provisioned vs Manual

Use GetProvisioning() when:

  • You’re connecting through the Siperb proxy (most common case)
  • You want Siperb to manage SIP credentials and updates
  • Your account has transcoding, filtering, or other Siperb services enabled

Use manual provisioning when:

  • You’re connecting directly to your own PBX (Socket mode)
  • You want complete control over SIP parameters
  • Your PBX manages authentication directly

Common Configuration Patterns

Minimal Setup

const phone = await window.Siperb."ProvisionPhone"({
    Provisioning: provisioning,
    PhoneFrame: document.getElementById("phone"),
    ProfileUserId: "user",
    SessionId: session.SessionToken,
    UserId: session.UserId
});

Dark Mode with Callbacks

const phone = await window.Siperb."ProvisionPhone"({
    Provisioning: provisioning,
    PhoneFrame: document.getElementById("phone"),
    ProfileUserId: "user",
    SessionId: session.SessionToken,
    UserId: session.UserId,
    UiThemeStyle: 'dark',
    OnLoad: () => {
        console.log('Phone ready');
        phone.Toast('Welcome back');
    }
});

Feature Restrictions

const phone = await window.Siperb."ProvisionPhone"({
    Provisioning: provisioning,
    PhoneFrame: document.getElementById("phone"),
    ProfileUserId: "user",
    SessionId: session.SessionToken,
    UserId: session.UserId,
    EnableCallTransfer: false,
    // Disable call transfer for restricted users
    EnableCallRecording: false
    // Disable recording
});

See Also

For the core SDK methods and integration examples, see Web Phone SDK Reference. For step-by-step setup guides and troubleshooting, visit web-phone.org.