@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
- ActivateCall
- Dial
- GetLineDetails
- GetSelectedLine
- HoldCall
- HookOff
- HookOn
- SendDtmfDigit
- SetSelectedLine
- TransferToLine
- TransferToNumber
- TransferToVoicebox
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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The 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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The zero-based index of the line on which to start the call. Use -1 for next free line. |
dialString | string | The number or contact identifier to call. |
processNumber? | boolean | When 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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The 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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The 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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The 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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The zero-based index of the line on which to send the digit. |
dtmfDigit | string | The DTMF digit to send. |
Returns
Promise<void>
SetSelectedLine
▸ SetSelectedLine(lineIndex): Promise<void>
Sets the currently selected line index.
Parameters
| Name | Type | Description |
|---|---|---|
lineIndex | number | The 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
| Name | Type | Description |
|---|---|---|
lineIndexFrom | number | The zero-based index of the source line. |
lineIndexTo | number | The 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
| Name | Type | Description |
|---|---|---|
lineIndexFrom | number | The zero-based index of the source line. |
dialNumber | string | The 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
| Name | Type | Description |
|---|---|---|
lineIndexFrom | number | The 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
| Name | Type | Description |
|---|---|---|
part | CallJournalPart | The 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
| Name | Type | Description |
|---|---|---|
lineIndex | number | The zero-based index of the line on which to pick up the call. |
callRefId | number | The 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
| Name | Type | Description |
|---|---|---|
number | string | The number to convert. |
numberStyle | NumberStyle | The 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
▸ GetAvatarBitmapLink(userId, siteId): Promise<string>
Gets the avatar bitmap link for a specific user.
Parameters
| Name | Type | Description |
|---|---|---|
userId | number | The ID of the user. |
siteId | number | The 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.