Skip to main content

@enreachde/swyx-web-extension-sdk - v1.0.1 / Exports / IWebExtensionHub

Interface: IWebExtensionHub

Main request interface for the Swyx WebExtension hub.

Table of contents​

Call Control​

Call Journal​

Groups​

Notification Calls​

Number Conversion​

Phonebook​

User Avatar​

User Information​

User Presence​

Version and Feature Information​

Call Control​

ActivateCall​

▸ ActivateCall(lineIndex): Promise<void>

Activates the current call on the specified line.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line on which to activate the call.

Returns​

Promise<void>


Dial​

▸ Dial(lineIndex, dialString, processNumber?): Promise<void>

Starts a call on the specified line.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line on which to start the call. Use -1 for next free line.
dialStringstringThe number or contact identifier to call.
processNumber?booleanWhen true, applies number processing rules to the dial string. Defaults to false.

Returns​

Promise<void>


GetLineDetails​

▸ GetLineDetails(): Promise<LineDetails[]>

Gets details for all lines.

Returns​

Promise<LineDetails[]>

List of line details.


GetSelectedLine​

▸ GetSelectedLine(): Promise<number>

Gets the currently selected line index.

Returns​

Promise<number>

The zero-based index of the currently selected line.


HoldCall​

▸ HoldCall(lineIndex): Promise<void>

Places the current call on hold on the specified line.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line on which to place the call on hold.

Returns​

Promise<void>


HookOff​

▸ HookOff(lineIndex): Promise<void>

Switches the specified line off-hook.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line to switch off-hook.

Returns​

Promise<void>


HookOn​

▸ HookOn(lineIndex): Promise<void>

Switches the specified line on-hook.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line to switch on-hook.

Returns​

Promise<void>


SendDtmfDigit​

▸ SendDtmfDigit(lineIndex, dtmfDigit): Promise<void>

Sends a DTMF digit on the specified active line.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line on which to send the digit.
dtmfDigitstringThe DTMF digit to send.

Returns​

Promise<void>


SetSelectedLine​

▸ SetSelectedLine(lineIndex): Promise<void>

Sets the currently selected line index.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line to select.

Returns​

Promise<void>


TransferToLine​

▸ TransferToLine(lineIndexFrom, lineIndexTo): Promise<void>

Transfers an active call from one line to another line.

Parameters​

NameTypeDescription
lineIndexFromnumberThe zero-based index of the source line.
lineIndexTonumberThe zero-based index of the destination line.

Returns​

Promise<void>


TransferToNumber​

▸ TransferToNumber(lineIndexFrom, dialNumber): Promise<void>

Transfers an active call from a line to a dialed number.

Parameters​

NameTypeDescription
lineIndexFromnumberThe zero-based index of the source line.
dialNumberstringThe number or address to transfer the call to.

Returns​

Promise<void>


TransferToVoicebox​

▸ TransferToVoicebox(lineIndexFrom): Promise<void>

Transfers an active call from a line to the voicebox.

Parameters​

NameTypeDescription
lineIndexFromnumberThe zero-based index of the source line.

Returns​

Promise<void>

Call Journal​

GetCallJournal​

▸ GetCallJournal(part): Promise<CallJournalItem[]>

Gets call journal entries for the specified journal part.

Parameters​

NameTypeDescription
partCallJournalPartThe journal part to retrieve (missed, received, or outgoing calls).

Returns​

Promise<CallJournalItem[]>

List of call journal entries.

Groups​

GetUserGroups​

▸ GetUserGroups(): Promise<UserGroup[]>

Gets groups that are visible to the current user.

Returns​

Promise<UserGroup[]>

List of user groups.

Notification Calls​

GetNotificationCalls​

▸ GetNotificationCalls(): Promise<NotificationCallDetails[]>

Gets pending notification calls.

Returns​

Promise<NotificationCallDetails[]>

List of pending notification call details.


PickupNotificationCall​

▸ PickupNotificationCall(lineIndex, callRefId): Promise<void>

Picks up a notification call on the specified line.

Parameters​

NameTypeDescription
lineIndexnumberThe zero-based index of the line on which to pick up the call.
callRefIdnumberThe reference ID of the call to pick up.

Returns​

Promise<void>

Number Conversion​

ConvertNumber​

▸ ConvertNumber(number, numberStyle): Promise<string>

Converts a number to the requested number style.

Parameters​

NameTypeDescription
numberstringThe number to convert.
numberStyleNumberStyleThe desired number style format.

Returns​

Promise<string>

The converted number in the requested style.

Phonebook​

GetPhonebook​

▸ GetPhonebook(): Promise<PhoneBookEntry[]>

Gets phonebook entries for the specified phonebook kind.

Returns​

Promise<PhoneBookEntry[]>

List of phonebook entries.

User Avatar​

▸ GetAvatarBitmapLink(userId, siteId): Promise<string>

Gets the avatar bitmap link for a specific user.

Parameters​

NameTypeDescription
userIdnumberThe ID of the user.
siteIdnumberThe ID of the site.

Returns​

Promise<string>

The URL of the user's avatar bitmap.

User Information​

GetLoggedInUser​

▸ GetLoggedInUser(): Promise<LoggedInUser>

Gets the currently logged-in user.

Returns​

Promise<LoggedInUser>

The currently logged-in user information.

User Presence​

GetUserPresenceList​

▸ GetUserPresenceList(): Promise<UserPresence[]>

Gets presence information for users visible to the current user.

Returns​

Promise<UserPresence[]>

List of user presence information.

Version and Feature Information​

GetLanguage​

▸ GetLanguage(): Promise<string>

Gets the current language code from the WebExtension layer.

Returns​

Promise<string>

The current language code.