VueSip API Reference v1.0.0
VueSip API Reference v1.0.0
VueSip - A headless Vue.js component library for SIP/VoIP applications
VueSip provides a set of powerful, headless Vue 3 composables for building SIP (Session Initiation Protocol) interfaces with Asterisk and other VoIP systems. Built with TypeScript and designed for flexibility, VueSip gives you the business logic while letting you control the UI.
Version
1.0.0
Examples
// Basic usage with Vue plugin
import { createApp } from 'vue'
import { createVueSip } from 'vuesip'
import App from './App.vue'
const app = createApp(App)
app.use(createVueSip({
debug: true,
logLevel: 'info'
}))
app.mount('#app')<script setup>
// Direct composable usage (no plugin required)
import { useSipClient, useCallSession } from 'vuesip'
const { connect, isConnected, isRegistered } = useSipClient({
uri: 'wss://sip.example.com',
sipUri: 'sip:user@example.com',
password: 'secret'
})
const { makeCall, currentCall } = useCallSession()
await connect()
await makeCall('sip:friend@example.com')
</script><template>
<!-- Using providers for global state -->
<SipClientProvider :config="sipConfig">
<MediaProvider :auto-enumerate="true">
<YourApp />
</MediaProvider>
</SipClientProvider>
</template>Remarks
Documentation
- User Guide: See the Getting Started Guide for step-by-step instructions
- API Reference: Detailed API documentation is available in the API Reference section
- TypeDoc Generated Docs: Complete reference documentation is auto-generated at API Generated Docs
- Architecture: Developers should review the Architecture Documentation
- Examples: Working examples are available in the Examples section
For developers maintaining this library, see the /docs/developer/typedoc-setup.md | TypeDoc Setup Guide for information about generating and maintaining API documentation.
Modules
| Module | Description |
|---|---|
| <internal> | - |
Enumerations
AmiErrorCode
Defined in: src/core/AmiClient.ts:44
AMI Error codes for categorizing errors
Enumeration Members
| Enumeration Member | Value | Defined in |
|---|---|---|
CONNECTION_FAILED | "CONNECTION_FAILED" | src/core/AmiClient.ts:45 |
CONNECTION_TIMEOUT | "CONNECTION_TIMEOUT" | src/core/AmiClient.ts:46 |
DISCONNECTED | "DISCONNECTED" | src/core/AmiClient.ts:47 |
ACTION_TIMEOUT | "ACTION_TIMEOUT" | src/core/AmiClient.ts:48 |
ACTION_FAILED | "ACTION_FAILED" | src/core/AmiClient.ts:49 |
INVALID_RESPONSE | "INVALID_RESPONSE" | src/core/AmiClient.ts:50 |
NOT_CONNECTED | "NOT_CONNECTED" | src/core/AmiClient.ts:51 |
WEBSOCKET_ERROR | "WEBSOCKET_ERROR" | src/core/AmiClient.ts:52 |
CallState
Defined in: src/types/call.types.ts:11
Call state enumeration
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Idle | "idle" | No active call | src/types/call.types.ts:13 |
Calling | "calling" | Outgoing call initiated | src/types/call.types.ts:15 |
Ringing | "ringing" | Incoming call ringing | src/types/call.types.ts:17 |
Answering | "answering" | Call is being answered | src/types/call.types.ts:19 |
EarlyMedia | "early_media" | Call is in early media state | src/types/call.types.ts:21 |
Active | "active" | Call is active | src/types/call.types.ts:23 |
Held | "held" | Call is on hold (local) | src/types/call.types.ts:25 |
RemoteHeld | "remote_held" | Call is on hold (remote) | src/types/call.types.ts:27 |
Terminating | "terminating" | Call is terminating | src/types/call.types.ts:29 |
Terminated | "terminated" | Call has ended | src/types/call.types.ts:31 |
Failed | "failed" | Call failed | src/types/call.types.ts:33 |
CallDirection
Defined in: src/types/call.types.ts:39
Call direction
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Outgoing | "outgoing" | Outgoing call | src/types/call.types.ts:41 |
Incoming | "incoming" | Incoming call | src/types/call.types.ts:43 |
TerminationCause
Defined in: src/types/call.types.ts:49
Call termination cause
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Canceled | "canceled" | Call was canceled | src/types/call.types.ts:51 |
Rejected | "rejected" | Call was rejected | src/types/call.types.ts:53 |
NoAnswer | "no_answer" | Call was not answered | src/types/call.types.ts:55 |
Unavailable | "unavailable" | Call was unavailable | src/types/call.types.ts:57 |
Busy | "busy" | Call was busy | src/types/call.types.ts:59 |
Bye | "bye" | Normal call clearing | src/types/call.types.ts:61 |
RequestTimeout | "request_timeout" | Request timeout | src/types/call.types.ts:63 |
WebRtcError | "webrtc_error" | WebRTC error | src/types/call.types.ts:65 |
InternalError | "internal_error" | Internal error | src/types/call.types.ts:67 |
NetworkError | "network_error" | Network error | src/types/call.types.ts:69 |
Other | "other" | Other reason | src/types/call.types.ts:71 |
HoldState
Defined in: src/types/call.types.ts:349
Hold state enumeration
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Active | "active" | Call is active (not on hold) | src/types/call.types.ts:351 |
Holding | "holding" | Local hold in progress | src/types/call.types.ts:353 |
Held | "held" | Call is on hold (local) | src/types/call.types.ts:355 |
Resuming | "resuming" | Resume in progress | src/types/call.types.ts:357 |
RemoteHeld | "remote_held" | Remote party has placed call on hold | src/types/call.types.ts:359 |
ConferenceState
Defined in: src/types/conference.types.ts:9
Conference state enumeration
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Idle | "idle" | Conference not started | src/types/conference.types.ts:11 |
Creating | "creating" | Conference is being created | src/types/conference.types.ts:13 |
Active | "active" | Conference is active | src/types/conference.types.ts:15 |
OnHold | "on_hold" | Conference is on hold | src/types/conference.types.ts:17 |
Ending | "ending" | Conference is ending | src/types/conference.types.ts:19 |
Ended | "ended" | Conference has ended | src/types/conference.types.ts:21 |
Failed | "failed" | Conference failed | src/types/conference.types.ts:23 |
ParticipantState
Defined in: src/types/conference.types.ts:29
Participant state
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Connecting | "connecting" | Participant is connecting | src/types/conference.types.ts:31 |
Connected | "connected" | Participant is connected | src/types/conference.types.ts:33 |
OnHold | "on_hold" | Participant is on hold | src/types/conference.types.ts:35 |
Muted | "muted" | Participant is muted | src/types/conference.types.ts:37 |
Disconnected | "disconnected" | Participant is disconnected | src/types/conference.types.ts:39 |
HistoryExportFormat
Defined in: src/types/history.types.ts:83
History export format
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
JSON | "json" | JSON format | src/types/history.types.ts:85 |
CSV | "csv" | CSV format | src/types/history.types.ts:87 |
Excel | "xlsx" | Excel format (if supported) | src/types/history.types.ts:89 |
MediaDeviceKind
Defined in: src/types/media.types.ts:11
Media device kind
Enumeration Members
| Enumeration Member | Value | Defined in |
|---|---|---|
AudioInput | "audioinput" | src/types/media.types.ts:12 |
AudioOutput | "audiooutput" | src/types/media.types.ts:13 |
VideoInput | "videoinput" | src/types/media.types.ts:14 |
PermissionStatus
Defined in: src/types/media.types.ts:41
Permission status for media devices
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Granted | "granted" | Permission granted | src/types/media.types.ts:43 |
Denied | "denied" | Permission denied | src/types/media.types.ts:45 |
Prompt | "prompt" | Permission prompt | src/types/media.types.ts:47 |
NotRequested | "not_requested" | Permission not requested | src/types/media.types.ts:49 |
RecordingState
Defined in: src/types/media.types.ts:169
Recording state
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Inactive | "inactive" | Not recording | src/types/media.types.ts:171 |
Recording | "recording" | Recording in progress | src/types/media.types.ts:173 |
Paused | "paused" | Recording paused | src/types/media.types.ts:175 |
Stopped | "stopped" | Recording stopped | src/types/media.types.ts:177 |
Error | "error" | Recording error | src/types/media.types.ts:179 |
MessageStatus
Defined in: src/types/messaging.types.ts:9
Message status enumeration
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Pending | "pending" | Message is pending | src/types/messaging.types.ts:11 |
Sending | "sending" | Message is being sent | src/types/messaging.types.ts:13 |
Sent | "sent" | Message was sent successfully | src/types/messaging.types.ts:15 |
Delivered | "delivered" | Message was delivered | src/types/messaging.types.ts:17 |
Read | "read" | Message was read | src/types/messaging.types.ts:19 |
Failed | "failed" | Message failed to send | src/types/messaging.types.ts:21 |
MessageDirection
Defined in: src/types/messaging.types.ts:27
Message direction
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Incoming | "incoming" | Incoming message | src/types/messaging.types.ts:29 |
Outgoing | "outgoing" | Outgoing message | src/types/messaging.types.ts:31 |
MessageContentType
Defined in: src/types/messaging.types.ts:37
Message content type
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Text | "text/plain" | Plain text | src/types/messaging.types.ts:39 |
HTML | "text/html" | HTML content | src/types/messaging.types.ts:41 |
JSON | "application/json" | JSON data | src/types/messaging.types.ts:43 |
Custom | "custom" | Custom content type | src/types/messaging.types.ts:45 |
HookPriority
Defined in: src/types/plugin.types.ts:24
Hook priority levels
Determines the order in which hook handlers are executed. Higher priority handlers run first.
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Highest | 1000 | Runs first | src/types/plugin.types.ts:26 |
High | 500 | Runs before normal | src/types/plugin.types.ts:28 |
Normal | 0 | Default priority | src/types/plugin.types.ts:30 |
Low | -500 | Runs after normal | src/types/plugin.types.ts:32 |
Lowest | -1000 | Runs last | src/types/plugin.types.ts:34 |
PluginState
Defined in: src/types/plugin.types.ts:258
Plugin registration state
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Registered | "registered" | Plugin is registered but not installed | src/types/plugin.types.ts:260 |
Installing | "installing" | Plugin is being installed | src/types/plugin.types.ts:262 |
Installed | "installed" | Plugin is installed and active | src/types/plugin.types.ts:264 |
Uninstalling | "uninstalling" | Plugin is being uninstalled | src/types/plugin.types.ts:266 |
Failed | "failed" | Plugin installation failed | src/types/plugin.types.ts:268 |
DialogState
Defined in: src/types/presence.types.ts:9
Dialog state enumeration for BLF (Busy Lamp Field)
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Idle | "idle" | Extension is idle/available | src/types/presence.types.ts:11 |
Ringing | "ringing" | Extension is ringing | src/types/presence.types.ts:13 |
Trying | "trying" | Extension is trying to connect | src/types/presence.types.ts:15 |
InCall | "in-call" | Extension is in a call | src/types/presence.types.ts:17 |
OnHold | "on-hold" | Extension is on hold | src/types/presence.types.ts:19 |
Confirmed | "confirmed" | Extension is confirmed in a dialog | src/types/presence.types.ts:21 |
Unavailable | "unavailable" | Extension is unavailable | src/types/presence.types.ts:23 |
Unknown | "unknown" | Unknown state | src/types/presence.types.ts:25 |
PresenceState
Defined in: src/types/presence.types.ts:193
Presence state enumeration
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Available | "available" | User is online and available | src/types/presence.types.ts:195 |
Away | "away" | User is away | src/types/presence.types.ts:197 |
Busy | "busy" | User is busy / do not disturb | src/types/presence.types.ts:199 |
Offline | "offline" | User is offline | src/types/presence.types.ts:201 |
Custom | "custom" | Custom status | src/types/presence.types.ts:203 |
RegistrationState
Defined in: src/types/sip.types.ts:36
Registration state for the SIP client
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Unregistered | "unregistered" | Not registered | src/types/sip.types.ts:38 |
Registering | "registering" | Registration in progress | src/types/sip.types.ts:40 |
Registered | "registered" | Successfully registered | src/types/sip.types.ts:42 |
RegistrationFailed | "registration_failed" | Registration failed | src/types/sip.types.ts:44 |
Unregistering | "unregistering" | Unregistration in progress | src/types/sip.types.ts:46 |
ConnectionState
Defined in: src/types/sip.types.ts:52
Connection state for the WebSocket transport
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Disconnected | "disconnected" | Disconnected from server | src/types/sip.types.ts:54 |
Connecting | "connecting" | Connecting to server | src/types/sip.types.ts:56 |
Connected | "connected" | Connected to server | src/types/sip.types.ts:58 |
ConnectionFailed | "connection_failed" | Connection failed | src/types/sip.types.ts:60 |
Error | "error" | Connection error | src/types/sip.types.ts:62 |
Reconnecting | "reconnecting" | Reconnecting to server | src/types/sip.types.ts:64 |
SipMethod
Defined in: src/types/sip.types.ts:70
SIP methods as defined in RFC 3261
Enumeration Members
| Enumeration Member | Value | Defined in |
|---|---|---|
INVITE | "INVITE" | src/types/sip.types.ts:71 |
ACK | "ACK" | src/types/sip.types.ts:72 |
BYE | "BYE" | src/types/sip.types.ts:73 |
CANCEL | "CANCEL" | src/types/sip.types.ts:74 |
REGISTER | "REGISTER" | src/types/sip.types.ts:75 |
OPTIONS | "OPTIONS" | src/types/sip.types.ts:76 |
INFO | "INFO" | src/types/sip.types.ts:77 |
UPDATE | "UPDATE" | src/types/sip.types.ts:78 |
PRACK | "PRACK" | src/types/sip.types.ts:79 |
SUBSCRIBE | "SUBSCRIBE" | src/types/sip.types.ts:80 |
NOTIFY | "NOTIFY" | src/types/sip.types.ts:81 |
PUBLISH | "PUBLISH" | src/types/sip.types.ts:82 |
MESSAGE | "MESSAGE" | src/types/sip.types.ts:83 |
REFER | "REFER" | src/types/sip.types.ts:84 |
SipResponseCode
Defined in: src/types/sip.types.ts:90
SIP response codes
Enumeration Members
TransferState
Defined in: src/types/transfer.types.ts:9
Transfer state enumeration
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Idle | "idle" | No active transfer | src/types/transfer.types.ts:11 |
Initiated | "initiated" | Transfer initiated | src/types/transfer.types.ts:13 |
InProgress | "in_progress" | Transfer in progress | src/types/transfer.types.ts:15 |
Accepted | "accepted" | Transfer accepted | src/types/transfer.types.ts:17 |
Completed | "completed" | Transfer completed | src/types/transfer.types.ts:19 |
Failed | "failed" | Transfer failed | src/types/transfer.types.ts:21 |
Canceled | "canceled" | Transfer canceled | src/types/transfer.types.ts:23 |
TransferType
Defined in: src/types/transfer.types.ts:29
Transfer type
Enumeration Members
| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
Blind | "blind" | Blind transfer (direct transfer without consultation) | src/types/transfer.types.ts:31 |
Attended | "attended" | Attended transfer (consultation before transfer) | src/types/transfer.types.ts:33 |
ErrorSeverity
Defined in: src/utils/errorContext.ts:13
Error severity levels
Enumeration Members
| Enumeration Member | Value | Defined in |
|---|---|---|
LOW | "low" | src/utils/errorContext.ts:14 |
MEDIUM | "medium" | src/utils/errorContext.ts:15 |
HIGH | "high" | src/utils/errorContext.ts:16 |
CRITICAL | "critical" | src/utils/errorContext.ts:17 |
Classes
AmiError
Defined in: src/core/AmiClient.ts:58
Custom AMI Error class with error code
Extends
Error
Constructors
Constructor
new AmiError(
message,
code,
details?): AmiError;Defined in: src/core/AmiClient.ts:62
Parameters
| Parameter | Type |
|---|---|
message | string |
code | AmiErrorCode |
details? | Record<string, unknown> |
Returns
Overrides
Error.constructorProperties
| Property | Type | Defined in |
|---|---|---|
code | AmiErrorCode | src/core/AmiClient.ts:59 |
details? | Record<string, unknown> | src/core/AmiClient.ts:60 |
AmiClient
Defined in: src/core/AmiClient.ts:100
AMI WebSocket Client
Connects to Asterisk Manager Interface via amiws WebSocket proxy. Enables querying presence states, extension status, and receiving real-time events.
Example
const ami = new AmiClient({ url: 'ws://pbx.example.com:8080' })
await ami.connect()
// Query presence state
const state = await ami.getPresenceState('1000')
console.log(state) // { state: 'available', message: 'In office' }
// Listen for presence changes
ami.on('presenceChange', (event) => {
console.log(`${event.data.Presentity} is now ${event.data.State}`)
})Constructors
Constructor
new AmiClient(config): AmiClient;Defined in: src/core/AmiClient.ts:117
Parameters
| Parameter | Type |
|---|---|
config | AmiConfig |
Returns
Accessors
isConnected
Get Signature
get isConnected(): boolean;Defined in: src/core/AmiClient.ts:285
Check if connected
Returns
boolean
Methods
connect()
connect(): Promise<void>;Defined in: src/core/AmiClient.ts:134
Connect to amiws WebSocket proxy
Returns
Promise<void>
disconnect()
disconnect(): void;Defined in: src/core/AmiClient.ts:244
Disconnect from amiws
Returns
void
getState()
getState(): AmiConnectionState;Defined in: src/core/AmiClient.ts:278
Get current connection state
Returns
sendAction()
sendAction<T>(action, timeout): Promise<AmiMessage<T>>;Defined in: src/core/AmiClient.ts:296
Send an AMI action and wait for response
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends AmiResponseData | AmiResponseData |
Parameters
| Parameter | Type | Default value |
|---|---|---|
action | AmiAction | undefined |
timeout | number | 10000 |
Returns
Promise<AmiMessage<T>>
getPresenceState()
getPresenceState(extension, provider): Promise<{
state: string;
subtype?: string;
message?: string;
}>;Defined in: src/core/AmiClient.ts:346
Get presence state for an extension
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
extension | string | undefined | Extension number (e.g., '1000') |
provider | string | 'CustomPresence' | Presence provider (default: 'CustomPresence') |
Returns
Promise<{ state: string; subtype?: string; message?: string; }>
Presence state info
setPresenceState()
setPresenceState(
extension,
state,
options?): Promise<void>;Defined in: src/core/AmiClient.ts:373
Set presence state for an extension (requires appropriate AMI permissions)
Parameters
| Parameter | Type | Description |
|---|---|---|
extension | string | Extension number |
state | string | New presence state |
options? | { subtype?: string; message?: string; } | Additional options (subtype, message) |
options.subtype? | string | - |
options.message? | string | - |
Returns
Promise<void>
getExtensionStatus()
getExtensionStatus(extension, context): Promise<{
status: number;
statusText: string;
}>;Defined in: src/core/AmiClient.ts:397
Get extension status (device state)
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
extension | string | undefined | Extension number |
context | string | 'ext-local' | Dialplan context (default: 'ext-local') |
Returns
Promise<{ status: number; statusText: string; }>
subscribePresence()
subscribePresence(extension): Promise<void>;Defined in: src/core/AmiClient.ts:423
Subscribe to presence state changes for an extension Note: Requires the extension to have a presence hint configured
Parameters
| Parameter | Type | Description |
|---|---|---|
extension | string | Extension number |
Returns
Promise<void>
rawCommand()
rawCommand(command): Promise<AmiMessage<AmiResponseData>>;Defined in: src/core/AmiClient.ts:435
Send a raw AMI command (for advanced usage)
Parameters
| Parameter | Type |
|---|---|
command | string |
Returns
Promise<AmiMessage<AmiResponseData>>
getQueueStatus()
getQueueStatus(queue?, timeout?): Promise<QueueInfo[]>;Defined in: src/core/AmiClient.ts:466
Get queue status with members and entries Returns multiple events aggregated into QueueInfo objects
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
queue? | string | undefined | Optional queue name to filter (undefined = all queues) |
timeout? | number | 30000 | Timeout in ms (default: 30000) |
Returns
Promise<QueueInfo[]>
getQueueSummary()
getQueueSummary(queue?, timeout?): Promise<QueueSummary[]>;Defined in: src/core/AmiClient.ts:545
Get queue summary (quick overview)
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
queue? | string | undefined | Optional queue name |
timeout? | number | 10000 | - |
Returns
Promise<QueueSummary[]>
queueAdd()
queueAdd(
queue,
iface,
options?): Promise<void>;Defined in: src/core/AmiClient.ts:593
Add a member to a queue
Parameters
| Parameter | Type |
|---|---|
queue | string |
iface | string |
options? | { memberName?: string; penalty?: number; paused?: boolean; stateInterface?: string; } |
options.memberName? | string |
options.penalty? | number |
options.paused? | boolean |
options.stateInterface? | string |
Returns
Promise<void>
queueRemove()
queueRemove(queue, iface): Promise<void>;Defined in: src/core/AmiClient.ts:621
Remove a member from a queue
Parameters
| Parameter | Type |
|---|---|
queue | string |
iface | string |
Returns
Promise<void>
queuePause()
queuePause(
queue,
iface,
paused,
reason?): Promise<void>;Defined in: src/core/AmiClient.ts:636
Pause/unpause a queue member
Parameters
| Parameter | Type |
|---|---|
queue | string |
iface | string |
paused | boolean |
reason? | string |
Returns
Promise<void>
queuePenalty()
queuePenalty(
queue,
iface,
penalty): Promise<void>;Defined in: src/core/AmiClient.ts:653
Set penalty for queue member
Parameters
| Parameter | Type |
|---|---|
queue | string |
iface | string |
penalty | number |
Returns
Promise<void>
getChannels()
getChannels(timeout): Promise<ChannelInfo[]>;Defined in: src/core/AmiClient.ts:673
Get all active channels
Parameters
| Parameter | Type | Default value |
|---|---|---|
timeout | number | 30000 |
Returns
Promise<ChannelInfo[]>
originate()
originate(options): Promise<OriginateResult>;Defined in: src/core/AmiClient.ts:711
Originate a call
Parameters
| Parameter | Type | Description |
|---|---|---|
options | OriginateOptions | Originate options |
Returns
Promise<OriginateResult>
hangupChannel()
hangupChannel(channel, cause?): Promise<void>;Defined in: src/core/AmiClient.ts:763
Hangup a channel
Parameters
| Parameter | Type |
|---|---|
channel | string |
cause? | number |
Returns
Promise<void>
redirectChannel()
redirectChannel(
channel,
context,
exten,
priority): Promise<void>;Defined in: src/core/AmiClient.ts:778
Redirect a channel (transfer)
Parameters
| Parameter | Type | Default value |
|---|---|---|
channel | string | undefined |
context | string | undefined |
exten | string | undefined |
priority | number | 1 |
Returns
Promise<void>
getSipPeers()
getSipPeers(timeout): Promise<PeerInfo[]>;Defined in: src/core/AmiClient.ts:804
Get SIP peers
Parameters
| Parameter | Type | Default value |
|---|---|---|
timeout | number | 30000 |
Returns
Promise<PeerInfo[]>
getPjsipEndpoints()
getPjsipEndpoints(timeout): Promise<PeerInfo[]>;Defined in: src/core/AmiClient.ts:840
Get PJSIP endpoints
Parameters
| Parameter | Type | Default value |
|---|---|---|
timeout | number | 30000 |
Returns
Promise<PeerInfo[]>
getAllPeers()
getAllPeers(): Promise<PeerInfo[]>;Defined in: src/core/AmiClient.ts:891
Get all peers (both SIP and PJSIP)
Returns
Promise<PeerInfo[]>
dbGet()
dbGet(family, key): Promise<string | null>;Defined in: src/core/AmiClient.ts:914
Get a value from AstDB
Parameters
| Parameter | Type |
|---|---|
family | string |
key | string |
Returns
Promise<string | null>
dbPut()
dbPut(
family,
key,
value): Promise<void>;Defined in: src/core/AmiClient.ts:934
Put a value into AstDB
Parameters
| Parameter | Type |
|---|---|
family | string |
key | string |
value | string |
Returns
Promise<void>
dbDel()
dbDel(family, key): Promise<void>;Defined in: src/core/AmiClient.ts:950
Delete a value from AstDB
Parameters
| Parameter | Type |
|---|---|
family | string |
key | string |
Returns
Promise<void>
dbDelTree()
dbDelTree(family, key?): Promise<void>;Defined in: src/core/AmiClient.ts:965
Delete a tree from AstDB
Parameters
| Parameter | Type |
|---|---|
family | string |
key? | string |
Returns
Promise<void>
dbGetKeys()
dbGetKeys(_family, _prefix): Promise<string[]>;Defined in: src/core/AmiClient.ts:986
Get all keys under a family (requires custom parsing) Note: This is done by sending DBGet and checking for specific keys For listing, consider using dbGetTree if available on your Asterisk version
Parameters
| Parameter | Type | Default value |
|---|---|---|
_family | string | undefined |
_prefix | string | '' |
Returns
Promise<string[]>
on()
on<K>(event, listener): void;Defined in: src/core/AmiClient.ts:1001
Register event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof AmiClientEvents |
Parameters
| Parameter | Type |
|---|---|
event | K |
listener | AmiClientEvents[K] |
Returns
void
off()
off<K>(event, listener): void;Defined in: src/core/AmiClient.ts:1014
Remove event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof AmiClientEvents |
Parameters
| Parameter | Type |
|---|---|
event | K |
listener | AmiClientEvents[K] |
Returns
void
CallSession
Defined in: src/core/CallSession.ts:97
CallSession manages an individual call session
Features:
- Call lifecycle management (outgoing/incoming/termination)
- State transition tracking
- Call timing tracking
- Media stream management
- Call controls (hold, mute, DTMF)
- Statistics collection
- Event-driven architecture
Example
const session = new CallSession(options)
await session.answer()
await session.hangup()Extends
Constructors
Constructor
new CallSession(options): CallSession;Defined in: src/core/CallSession.ts:137
Parameters
| Parameter | Type |
|---|---|
options | CallSessionOptions |
Returns
Overrides
Properties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
listeners | protected | Map<string, Set<EventHandler<unknown>>> | EventEmitter.listeners | src/utils/EventEmitter.ts:16 |
Accessors
id
Get Signature
get id(): string;Defined in: src/core/CallSession.ts:167
Returns
string
state
Get Signature
get state(): CallState;Defined in: src/core/CallSession.ts:171
Returns
direction
Get Signature
get direction(): CallDirection;Defined in: src/core/CallSession.ts:175
Returns
eventBus
Get Signature
get eventBus(): EventBus;Defined in: src/core/CallSession.ts:183
Get the event bus for subscribing to call events. Useful for reactivity systems that need to track state changes.
Returns
localUri
Get Signature
get localUri(): string;Defined in: src/core/CallSession.ts:187
Returns
string
remoteUri
Get Signature
get remoteUri(): string;Defined in: src/core/CallSession.ts:191
Returns
string
remoteDisplayName
Get Signature
get remoteDisplayName(): string | undefined;Defined in: src/core/CallSession.ts:195
Returns
string | undefined
localStream
Get Signature
get localStream(): MediaStream | undefined;Defined in: src/core/CallSession.ts:199
Returns
MediaStream | undefined
remoteStream
Get Signature
get remoteStream(): MediaStream | undefined;Defined in: src/core/CallSession.ts:203
Returns
MediaStream | undefined
isOnHold
Get Signature
get isOnHold(): boolean;Defined in: src/core/CallSession.ts:207
Returns
boolean
isMuted
Get Signature
get isMuted(): boolean;Defined in: src/core/CallSession.ts:211
Returns
boolean
hasRemoteVideo
Get Signature
get hasRemoteVideo(): boolean;Defined in: src/core/CallSession.ts:215
Returns
boolean
hasLocalVideo
Get Signature
get hasLocalVideo(): boolean;Defined in: src/core/CallSession.ts:219
Returns
boolean
timing
Get Signature
get timing(): Readonly<CallTimingInfo>;Defined in: src/core/CallSession.ts:223
Returns
Readonly<CallTimingInfo>
terminationCause
Get Signature
get terminationCause(): TerminationCause | undefined;Defined in: src/core/CallSession.ts:227
Returns
TerminationCause | undefined
data
Get Signature
get data(): Record<string, any>;Defined in: src/core/CallSession.ts:231
Returns
Record<string, any>
connection
Get Signature
get connection(): RTCPeerConnection | undefined;Defined in: src/core/CallSession.ts:239
Get the underlying RTCPeerConnection Used for accessing RTP senders/receivers for features like DTMF and mute
Returns
RTCPeerConnection | undefined
Methods
toInterface()
toInterface(): CallSession;Defined in: src/core/CallSession.ts:246
Get the current call session as an interface
Returns
answer()
answer(options?): Promise<void>;Defined in: src/core/CallSession.ts:278
Answer an incoming call
Implements incoming call flow:
- Validate call state
- Get local media stream
- Create answer SDP
- Send 200 OK with SDP
- Wait for ACK
- Establish media flow
- Transition to active state
Parameters
| Parameter | Type |
|---|---|
options? | AnswerOptions |
Returns
Promise<void>
reject()
reject(statusCode): Promise<void>;Defined in: src/core/CallSession.ts:337
Reject an incoming call
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
statusCode | number | 603 | SIP status code (default: 603 Decline) - 486: Busy Here - 603: Decline - 480: Temporarily Unavailable |
Returns
Promise<void>
hangup()
hangup(): Promise<void>;Defined in: src/core/CallSession.ts:395
Terminate the call
Implements call termination flow:
- Validate call state
- Send BYE request (or CANCEL for early states)
- Stop media streams
- Close peer connection
- Update call state
- Emit termination event
- Clean up resources
Returns
Promise<void>
terminate()
terminate(): Promise<void>;Defined in: src/core/CallSession.ts:427
Terminate the call (alias for hangup)
Returns
Promise<void>
hold()
hold(): Promise<void>;Defined in: src/core/CallSession.ts:434
Put call on hold
Returns
Promise<void>
unhold()
unhold(): Promise<void>;Defined in: src/core/CallSession.ts:479
Resume call from hold
Returns
Promise<void>
mute()
mute(): void;Defined in: src/core/CallSession.ts:520
Mute local audio
Returns
void
unmute()
unmute(): void;Defined in: src/core/CallSession.ts:543
Unmute local audio
Returns
void
disableVideo()
disableVideo(): void;Defined in: src/core/CallSession.ts:566
Disable local video
Returns
void
enableVideo()
enableVideo(): void;Defined in: src/core/CallSession.ts:583
Enable local video
Returns
void
sendDTMF()
sendDTMF(tone, options?): void;Defined in: src/core/CallSession.ts:604
Send DTMF tone or tone sequence Tones are queued and sent sequentially with proper timing
Parameters
| Parameter | Type | Description |
|---|---|---|
tone | string | Single tone (0-9, *, #, A-D) or sequence of tones (e.g., "123#") |
options? | DTMFOptions | DTMF options for duration, gap, and transport |
Returns
void
clearDTMFQueue()
clearDTMFQueue(): void;Defined in: src/core/CallSession.ts:679
Clear DTMF queue
Returns
void
transfer()
transfer(targetUri, extraHeaders?): Promise<void>;Defined in: src/core/CallSession.ts:691
Perform blind transfer (REFER without consultation) Transfers the call to a target URI using SIP REFER method
Parameters
| Parameter | Type | Description |
|---|---|---|
targetUri | string | Target SIP URI to transfer to |
extraHeaders? | string[] | Optional SIP headers |
Returns
Promise<void>
attendedTransfer()
attendedTransfer(targetUri, replaceCallId): Promise<void>;Defined in: src/core/CallSession.ts:729
Perform attended transfer (REFER with Replaces header) Transfers the call after consultation with target
Parameters
| Parameter | Type | Description |
|---|---|---|
targetUri | string | Target SIP URI |
replaceCallId | string | Call ID of the consultation call to replace |
Returns
Promise<void>
getStats()
getStats(): Promise<CallStatistics>;Defined in: src/core/CallSession.ts:770
Get call statistics
Returns
Promise<CallStatistics>
destroy()
destroy(): void;Defined in: src/core/CallSession.ts:1209
Destroy the call session
Returns
void
on()
on<K>(event, handler): () => void;Defined in: src/utils/EventEmitter.ts:25
Subscribe to an event
Type Parameters
| Type Parameter |
|---|
K extends keyof CallSessionEvents |
Parameters
| Parameter | Type | Description |
|---|---|---|
event | K | Event name |
handler | EventHandler<CallSessionEvents[K]> | Event handler function |
Returns
Unsubscribe function
(): void;Returns
void
Inherited from
once()
once<K>(event, handler): () => void;Defined in: src/utils/EventEmitter.ts:55
Subscribe to an event once (auto-unsubscribe after first emission)
Type Parameters
| Type Parameter |
|---|
K extends keyof CallSessionEvents |
Parameters
| Parameter | Type | Description |
|---|---|---|
event | K | Event name |
handler | EventHandler<CallSessionEvents[K]> | Event handler function |
Returns
Unsubscribe function
(): void;Returns
void
Inherited from
off()
off<K>(event, handler?): void;Defined in: src/utils/EventEmitter.ts:71
Unsubscribe from an event
Type Parameters
| Type Parameter |
|---|
K extends keyof CallSessionEvents |
Parameters
| Parameter | Type | Description |
|---|---|---|
event | K | Event name |
handler? | EventHandler<CallSessionEvents[K]> | Event handler function to remove (optional - removes all if not specified) |
Returns
void
Inherited from
emit()
emit<K>(event, data): void;Defined in: src/utils/EventEmitter.ts:93
Emit an event
Type Parameters
| Type Parameter |
|---|
K extends keyof CallSessionEvents |
Parameters
| Parameter | Type | Description |
|---|---|---|
event | K | Event name |
data | CallSessionEvents[K] | Event data |
Returns
void
Inherited from
removeAllListeners()
removeAllListeners(): void;Defined in: src/utils/EventEmitter.ts:112
Remove all event listeners
Returns
void
Inherited from
EventEmitter.removeAllListeners
listenerCount()
listenerCount<K>(event): number;Defined in: src/utils/EventEmitter.ts:122
Get the number of listeners for an event
Type Parameters
| Type Parameter |
|---|
K extends keyof CallSessionEvents |
Parameters
| Parameter | Type | Description |
|---|---|---|
event | K | Event name |
Returns
number
Number of listeners
Inherited from
eventNames()
eventNames(): string[];Defined in: src/utils/EventEmitter.ts:133
Get all event names that have listeners
Returns
string[]
Array of event names
Inherited from
EventBus
Defined in: src/core/EventBus.ts:29
Type-safe Event Bus for managing application events
Constructors
Constructor
new EventBus(): EventBus;Returns
Methods
on()
on<K>(
event,
handler,
options): string;Defined in: src/core/EventBus.ts:40
Add an event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | WildcardPattern | K |
handler | EventHandler<EventMap[K]> |
options | EventListenerOptions |
Returns
string
once()
once<K>(event, handler): string;Defined in: src/core/EventBus.ts:107
Add a one-time event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | WildcardPattern | K |
handler | EventHandler<EventMap[K]> |
Returns
string
off()
off<K>(event, handlerOrId): boolean;Defined in: src/core/EventBus.ts:117
Remove an event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | WildcardPattern | K |
handlerOrId | | string | EventHandler<EventMap[K]> |
Returns
boolean
removeById()
removeById(id): boolean;Defined in: src/core/EventBus.ts:152
Remove an event listener by ID (across all events)
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
emit()
emit<K>(event, data): Promise<void>;Defined in: src/core/EventBus.ts:170
Emit an event
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
data | EventMap[K] |
Returns
Promise<void>
emitSync()
emitSync<K>(event, data): void;Defined in: src/core/EventBus.ts:240
Emit an event synchronously (fire and forget)
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
data | EventMap[K] |
Returns
void
removeAllListeners()
removeAllListeners(event?): void;Defined in: src/core/EventBus.ts:250
Remove all listeners for an event or all events
Parameters
| Parameter | Type |
|---|---|
event? | string | number |
Returns
void
waitFor()
waitFor<K>(event, timeout?): Promise<EventMap[K]>;Defined in: src/core/EventBus.ts:264
Wait for an event to be emitted
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
timeout? | number |
Returns
Promise<EventMap[K]>
listenerCount()
listenerCount(event): number;Defined in: src/core/EventBus.ts:325
Get the number of listeners for an event
Parameters
| Parameter | Type |
|---|---|
event | string | number |
Returns
number
eventNames()
eventNames(): string[];Defined in: src/core/EventBus.ts:334
Get all event names that have listeners
Returns
string[]
hasListeners()
hasListeners(event): boolean;Defined in: src/core/EventBus.ts:341
Check if there are any listeners for an event
Parameters
| Parameter | Type |
|---|---|
event | string | number |
Returns
boolean
setBufferingEnabled()
setBufferingEnabled(enabled): void;Defined in: src/core/EventBus.ts:348
Enable or disable event buffering
Parameters
| Parameter | Type |
|---|---|
enabled | boolean |
Returns
void
destroy()
destroy(): void;Defined in: src/core/EventBus.ts:361
Clear all event listeners and reset state
Returns
void
MediaManager
Defined in: src/core/MediaManager.ts:128
MediaManager manages WebRTC media streams and devices
Features:
- RTCPeerConnection lifecycle management
- ICE candidate gathering and handling
- SDP offer/answer negotiation
- Local and remote media stream management
- Media device enumeration and selection
- Device permission handling
- DTMF tone generation
- WebRTC statistics collection
- Automatic quality adjustment
- Event-driven architecture
Example
const mediaManager = new MediaManager({ eventBus })
await mediaManager.enumerateDevices()
const stream = await mediaManager.getUserMedia({ audio: true, video: false })Constructors
Constructor
new MediaManager(options): MediaManager;Defined in: src/core/MediaManager.ts:174
Parameters
| Parameter | Type |
|---|---|
options | MediaManagerOptions |
Returns
Methods
createPeerConnection()
createPeerConnection(): RTCPeerConnection;Defined in: src/core/MediaManager.ts:194
Create RTCPeerConnection
Returns
RTCPeerConnection
getPeerConnection()
getPeerConnection(): RTCPeerConnection;Defined in: src/core/MediaManager.ts:216
Get existing peer connection or create new one
Returns
RTCPeerConnection
closePeerConnection()
closePeerConnection(): void;Defined in: src/core/MediaManager.ts:226
Close peer connection
Returns
void
createOffer()
createOffer(options?): Promise<RTCSessionDescriptionInit>;Defined in: src/core/MediaManager.ts:415
Create SDP offer
Parameters
| Parameter | Type |
|---|---|
options? | RTCOfferOptions |
Returns
Promise<RTCSessionDescriptionInit>
createAnswer()
createAnswer(options?): Promise<RTCSessionDescriptionInit>;Defined in: src/core/MediaManager.ts:436
Create SDP answer
Parameters
| Parameter | Type |
|---|---|
options? | RTCAnswerOptions |
Returns
Promise<RTCSessionDescriptionInit>
setLocalDescription()
setLocalDescription(description): Promise<void>;Defined in: src/core/MediaManager.ts:457
Set local description
Parameters
| Parameter | Type |
|---|---|
description | RTCSessionDescriptionInit |
Returns
Promise<void>
setRemoteDescription()
setRemoteDescription(description): Promise<void>;Defined in: src/core/MediaManager.ts:479
Set remote description
Parameters
| Parameter | Type |
|---|---|
description | RTCSessionDescriptionInit |
Returns
Promise<void>
addIceCandidate()
addIceCandidate(candidate): Promise<void>;Defined in: src/core/MediaManager.ts:498
Add ICE candidate
Parameters
| Parameter | Type |
|---|---|
candidate | RTCIceCandidateInit |
Returns
Promise<void>
waitForIceGathering()
waitForIceGathering(): Promise<void>;Defined in: src/core/MediaManager.ts:537
Wait for ICE gathering to complete
Returns
Promise<void>
getUserMedia()
getUserMedia(constraints?): Promise<MediaStream>;Defined in: src/core/MediaManager.ts:565
Get user media (local stream)
Parameters
| Parameter | Type |
|---|---|
constraints? | ExtendedMediaStreamConstraints |
Returns
Promise<MediaStream>
addLocalStream()
addLocalStream(stream): RTCRtpSender[];Defined in: src/core/MediaManager.ts:653
Add local stream to peer connection
Parameters
| Parameter | Type |
|---|---|
stream | MediaStream |
Returns
RTCRtpSender[]
removeLocalStream()
removeLocalStream(): void;Defined in: src/core/MediaManager.ts:688
Remove local stream from peer connection
Returns
void
stopLocalStream()
stopLocalStream(): void;Defined in: src/core/MediaManager.ts:710
Stop local stream
Returns
void
getLocalStream()
getLocalStream(): MediaStream | undefined;Defined in: src/core/MediaManager.ts:732
Get local stream
Returns
MediaStream | undefined
getRemoteStream()
getRemoteStream(): MediaStream | undefined;Defined in: src/core/MediaManager.ts:739
Get remote stream
Returns
MediaStream | undefined
sendDTMF()
sendDTMF(
tone,
duration?,
gap?): void;Defined in: src/core/MediaManager.ts:750
Send DTMF tone
Parameters
| Parameter | Type |
|---|---|
tone | string |
duration? | number |
gap? | number |
Returns
void
isDTMFAvailable()
isDTMFAvailable(): boolean;Defined in: src/core/MediaManager.ts:769
Check if DTMF is available
Returns
boolean
enumerateDevices()
enumerateDevices(forceRefresh): Promise<MediaDevice[]>;Defined in: src/core/MediaManager.ts:781
Enumerate media devices
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
forceRefresh | boolean | false | Force refresh from native API, bypassing cache |
Returns
Promise<MediaDevice[]>
getDevicesByKind()
getDevicesByKind(kind): MediaDevice[];Defined in: src/core/MediaManager.ts:829
Get devices by kind
Parameters
| Parameter | Type |
|---|---|
kind | MediaDeviceKind |
Returns
getAudioInputDevices()
getAudioInputDevices(): MediaDevice[];Defined in: src/core/MediaManager.ts:836
Get audio input devices
Returns
getAudioOutputDevices()
getAudioOutputDevices(): MediaDevice[];Defined in: src/core/MediaManager.ts:843
Get audio output devices
Returns
getVideoInputDevices()
getVideoInputDevices(): MediaDevice[];Defined in: src/core/MediaManager.ts:850
Get video input devices
Returns
selectAudioInput()
selectAudioInput(deviceId): void;Defined in: src/core/MediaManager.ts:857
Select audio input device
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
void
selectAudioOutput()
selectAudioOutput(deviceId): void;Defined in: src/core/MediaManager.ts:865
Select audio output device
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
void
selectVideoInput()
selectVideoInput(deviceId): void;Defined in: src/core/MediaManager.ts:873
Select video input device
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
void
getSelectedAudioInput()
getSelectedAudioInput(): string | undefined;Defined in: src/core/MediaManager.ts:881
Get selected audio input device
Returns
string | undefined
getSelectedAudioOutput()
getSelectedAudioOutput(): string | undefined;Defined in: src/core/MediaManager.ts:888
Get selected audio output device
Returns
string | undefined
getSelectedVideoInput()
getSelectedVideoInput(): string | undefined;Defined in: src/core/MediaManager.ts:895
Get selected video input device
Returns
string | undefined
requestPermissions()
requestPermissions(audio, video): Promise<MediaPermissions>;Defined in: src/core/MediaManager.ts:902
Request media permissions
Parameters
| Parameter | Type | Default value |
|---|---|---|
audio | boolean | true |
video | boolean | false |
Returns
Promise<MediaPermissions>
getPermissions()
getPermissions(): MediaPermissions;Defined in: src/core/MediaManager.ts:951
Get current permissions
Returns
startDeviceChangeMonitoring()
startDeviceChangeMonitoring(): void;Defined in: src/core/MediaManager.ts:958
Start monitoring device changes
Returns
void
stopDeviceChangeMonitoring()
stopDeviceChangeMonitoring(): void;Defined in: src/core/MediaManager.ts:1006
Stop monitoring device changes
Returns
void
testAudioInput()
testAudioInput(deviceId): Promise<DeviceTestResult>;Defined in: src/core/MediaManager.ts:1018
Test audio input device
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
Promise<DeviceTestResult>
testVideoInput()
testVideoInput(deviceId): Promise<DeviceTestResult>;Defined in: src/core/MediaManager.ts:1046
Test video input device
Parameters
| Parameter | Type |
|---|---|
deviceId | string |
Returns
Promise<DeviceTestResult>
getStatistics()
getStatistics(): Promise<MediaStatistics>;Defined in: src/core/MediaManager.ts:1113
Get WebRTC statistics
Returns
Promise<MediaStatistics>
destroy()
destroy(): void;Defined in: src/core/MediaManager.ts:1399
Cleanup and release resources
Returns
void
setDevices()
setDevices(devices): void;Defined in: src/core/MediaManager.ts:1423
Set available devices (manually update device list)
Parameters
| Parameter | Type | Description |
|---|---|---|
devices | MediaDeviceInfo[] | Devices to set |
Returns
void
testDevice()
testDevice(deviceId): Promise<{
success: boolean;
audioLevel?: number;
}>;Defined in: src/core/MediaManager.ts:1456
Test a specific device (audio or video)
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId | string | Device ID to test |
Returns
Promise<{ success: boolean; audioLevel?: number; }>
SipClient
Defined in: src/core/SipClient.ts:138
SipClient manages the JsSIP User Agent and handles SIP communication
Features:
- JsSIP UA initialization and lifecycle management
- SIP registration management
- Digest authentication (MD5)
- WebSocket transport integration
- Custom User-Agent header
- SIP trace logging
- Event-driven architecture
Example
const sipClient = new SipClient(config, eventBus)
await sipClient.start()
await sipClient.register()Constructors
Constructor
new SipClient(config, eventBus): SipClient;Defined in: src/core/SipClient.ts:165
Parameters
| Parameter | Type |
|---|---|
config | SipClientConfig |
eventBus | EventBus |
Returns
Accessors
eventBus
Get Signature
get eventBus(): EventBus;Defined in: src/core/SipClient.ts:147
Get the event bus instance for subscribing to SIP events
Returns
connectionState
Get Signature
get connectionState(): ConnectionState;Defined in: src/core/SipClient.ts:186
Get current connection state
Returns
registrationState
Get Signature
get registrationState(): RegistrationState;Defined in: src/core/SipClient.ts:193
Get current registration state
Returns
isConnected
Get Signature
get isConnected(): boolean;Defined in: src/core/SipClient.ts:200
Check if connected to SIP server
Returns
boolean
isRegistered
Get Signature
get isRegistered(): boolean;Defined in: src/core/SipClient.ts:218
Check if registered with SIP server
Returns
boolean
userAgent
Get Signature
get userAgent(): UA | null;Defined in: src/core/SipClient.ts:232
Get the JsSIP UA instance
Returns
UA | null
Methods
getState()
getState(): Readonly<SipClientState>;Defined in: src/core/SipClient.ts:239
Get current client state
Returns
Readonly<SipClientState>
getConfig()
getConfig(): Readonly<SipClientConfig>;Defined in: src/core/SipClient.ts:247
Get current configuration
Returns
Readonly<SipClientConfig>
The SIP client configuration
validateConfig()
validateConfig(): ValidationResult;Defined in: src/core/SipClient.ts:254
Validate configuration
Returns
start()
start(): Promise<void>;Defined in: src/core/SipClient.ts:261
Start the SIP client (initialize UA and connect)
Returns
Promise<void>
stop()
stop(): Promise<void>;Defined in: src/core/SipClient.ts:425
Stop the SIP client (unregister and disconnect)
Returns
Promise<void>
register()
register(): Promise<void>;Defined in: src/core/SipClient.ts:495
Register with SIP server
Returns
Promise<void>
unregister()
unregister(): Promise<void>;Defined in: src/core/SipClient.ts:614
Unregister from SIP server
Returns
Promise<void>
sendMessage()
sendMessage(
target,
content,
options?): void;Defined in: src/core/SipClient.ts:1054
Send custom SIP message (MESSAGE method)
Parameters
| Parameter | Type |
|---|---|
target | string |
content | string |
options? | JsSIPSendMessageOptions |
Returns
void
updateConfig()
updateConfig(config): void;Defined in: src/core/SipClient.ts:1070
Update client configuration (requires restart)
Parameters
| Parameter | Type |
|---|---|
config | Partial<SipClientConfig> |
Returns
void
getCredentials()
getCredentials(): AuthenticationCredentials;Defined in: src/core/SipClient.ts:1082
Get authentication credentials
Returns
createConference()
createConference(conferenceId, options?): Promise<void>;Defined in: src/core/SipClient.ts:1102
Create a conference
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
options? | ConferenceOptions |
Returns
Promise<void>
joinConference()
joinConference(conferenceUri, options?): Promise<void>;Defined in: src/core/SipClient.ts:1162
Join a conference
Parameters
| Parameter | Type |
|---|---|
conferenceUri | string |
options? | ConferenceOptions |
Returns
Promise<void>
inviteToConference()
inviteToConference(conferenceId, participantUri): Promise<void>;Defined in: src/core/SipClient.ts:1255
Invite participant to conference
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
participantUri | string |
Returns
Promise<void>
removeFromConference()
removeFromConference(conferenceId, participantId): Promise<void>;Defined in: src/core/SipClient.ts:1346
Remove participant from conference
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
participantId | string |
Returns
Promise<void>
muteParticipant()
muteParticipant(conferenceId, participantId): Promise<void>;Defined in: src/core/SipClient.ts:1387
Mute conference participant
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
participantId | string |
Returns
Promise<void>
unmuteParticipant()
unmuteParticipant(conferenceId, participantId): Promise<void>;Defined in: src/core/SipClient.ts:1425
Unmute conference participant
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
participantId | string |
Returns
Promise<void>
endConference()
endConference(conferenceId): Promise<void>;Defined in: src/core/SipClient.ts:1463
End a conference
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
Returns
Promise<void>
startConferenceRecording()
startConferenceRecording(conferenceId): Promise<void>;Defined in: src/core/SipClient.ts:1519
Start conference recording
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
Returns
Promise<void>
stopConferenceRecording()
stopConferenceRecording(conferenceId): Promise<void>;Defined in: src/core/SipClient.ts:1544
Stop conference recording
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
Returns
Promise<void>
getConferenceAudioLevels()?
optional getConferenceAudioLevels(conferenceId): Map<string, number> | undefined;Defined in: src/core/SipClient.ts:1568
Get conference audio levels
Parameters
| Parameter | Type |
|---|---|
conferenceId | string |
Returns
Map<string, number> | undefined
muteAudio()
muteAudio(): Promise<void>;Defined in: src/core/SipClient.ts:1601
Mute audio on all active calls
Returns
Promise<void>
unmuteAudio()
unmuteAudio(): Promise<void>;Defined in: src/core/SipClient.ts:1645
Unmute audio on all active calls
Returns
Promise<void>
disableVideo()
disableVideo(): Promise<void>;Defined in: src/core/SipClient.ts:1689
Disable video on all active calls
Returns
Promise<void>
enableVideo()
enableVideo(): Promise<void>;Defined in: src/core/SipClient.ts:1733
Enable video on all active calls
Returns
Promise<void>
destroy()
destroy(): void;Defined in: src/core/SipClient.ts:1777
Clean up resources
Returns
void
forceEmitConnected()
forceEmitConnected(transport?): void;Defined in: src/core/SipClient.ts:1820
Manually force connected event emission (test helper)
Parameters
| Parameter | Type |
|---|---|
transport? | string |
Returns
void
forceEmitDisconnected()
forceEmitDisconnected(error?): void;Defined in: src/core/SipClient.ts:1827
Manually force disconnected event emission (test helper)
Parameters
| Parameter | Type |
|---|---|
error? | unknown |
Returns
void
onIncomingMessage()
onIncomingMessage(handler): void;Defined in: src/core/SipClient.ts:1839
Set incoming message handler
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | (from, content, contentType?) => void | Message handler function |
Returns
void
offIncomingMessage()
offIncomingMessage(handler): void;Defined in: src/core/SipClient.ts:1848
Remove incoming message handler
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | (from, content, contentType?) => void | Message handler function to remove |
Returns
void
onComposingIndicator()
onComposingIndicator(handler): void;Defined in: src/core/SipClient.ts:1860
Set composing indicator handler
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | (from, isComposing) => void | Composing indicator handler function |
Returns
void
offComposingIndicator()
offComposingIndicator(handler): void;Defined in: src/core/SipClient.ts:1869
Remove composing indicator handler
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | (from, isComposing) => void | Composing indicator handler function to remove |
Returns
void
publishPresence()
publishPresence(presence): Promise<void>;Defined in: src/core/SipClient.ts:1887
Publish presence information using SIP PUBLISH
Sends a real SIP PUBLISH request to the server. Supports SIP-ETag for efficient presence refreshes. Works with Asterisk/FreePBX and other RFC 3903 compliant servers.
Parameters
| Parameter | Type | Description |
|---|---|---|
presence | PresencePublishOptions | Presence data (state, note, activity) |
Returns
Promise<void>
Throws
Error if not connected or PUBLISH fails
subscribePresence()
subscribePresence(uri, options?): Promise<void>;Defined in: src/core/SipClient.ts:1983
Subscribe to presence updates using SIP SUBSCRIBE
Sends a real SIP SUBSCRIBE request to watch another user's presence. Server will send NOTIFY messages when the target's presence changes. Works with Asterisk/FreePBX extension hints and device states.
Parameters
| Parameter | Type | Description |
|---|---|---|
uri | string | Target SIP URI to watch (e.g., 'sip:6001@pbx.com') |
options? | PresenceSubscriptionOptions | Subscription options (expires, extraHeaders) |
Returns
Promise<void>
Throws
Error if not connected or SUBSCRIBE fails
unsubscribePresence()
unsubscribePresence(uri): Promise<void>;Defined in: src/core/SipClient.ts:2069
Unsubscribe from presence updates
Sends SUBSCRIBE with Expires: 0 to terminate the subscription.
Parameters
| Parameter | Type | Description |
|---|---|---|
uri | string | Target SIP URI to stop watching |
Returns
Promise<void>
Throws
Error if not connected or UNSUBSCRIBE fails
getActiveCall()
getActiveCall(callId): CallSession | undefined;Defined in: src/core/SipClient.ts:2164
Get an active call session by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
callId | string | Call ID to retrieve |
Returns
CallSession | undefined
Call session or undefined if not found
makeCall()
makeCall(target, options?): Promise<string>;Defined in: src/core/SipClient.ts:2174
Make an outgoing call
Parameters
| Parameter | Type | Description |
|---|---|---|
target | string | Target SIP URI |
options? | CallOptions | Call options |
Returns
Promise<string>
Promise resolving to call ID
call()
call(target, options?): Promise<CallSession>;Defined in: src/core/SipClient.ts:2186
Make an outgoing call and return CallSession instance
Parameters
| Parameter | Type | Description |
|---|---|---|
target | string | Target SIP URI |
options? | CallOptions | Call options |
Returns
Promise<CallSession>
Promise resolving to CallSession instance
onMessage()
onMessage(handler): void;Defined in: src/core/SipClient.ts:2998
Alias for onIncomingMessage() - for API compatibility
Parameters
| Parameter | Type |
|---|---|
handler | (from, content, contentType?) => void |
Returns
void
onComposing()
onComposing(handler): void;Defined in: src/core/SipClient.ts:3005
Alias for onComposingIndicator() - for API compatibility
Parameters
| Parameter | Type |
|---|---|
handler | (from, isComposing) => void |
Returns
void
getActiveCalls()
getActiveCalls(): CallSession[];Defined in: src/core/SipClient.ts:3013
Get all active call sessions
Returns
Array of active CallSession instances
getCall()
getCall(callId): CallSession | undefined;Defined in: src/core/SipClient.ts:3022
Get a specific call session by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
callId | string | The call ID to retrieve |
Returns
CallSession | undefined
The CallSession instance or undefined if not found
muteCall()
muteCall(): Promise<void>;Defined in: src/core/SipClient.ts:3029
Alias for muteAudio() - mutes audio for all calls
Returns
Promise<void>
unmuteCall()
unmuteCall(): Promise<void>;Defined in: src/core/SipClient.ts:3036
Alias for unmuteAudio() - unmutes audio for all calls
Returns
Promise<void>
answerCall()
answerCall(callId?): Promise<void>;Defined in: src/core/SipClient.ts:3045
Answer incoming call (convenience method) Note: Requires a call to be ringing. Use CallSession.answer() for more control.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId? | string | Optional call ID, uses first ringing call if not specified |
Returns
Promise<void>
hangupCall()
hangupCall(callId?): Promise<void>;Defined in: src/core/SipClient.ts:3058
Hangup active call (convenience method) Note: Use CallSession.hangup() for more control over specific calls.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId? | string | Optional call ID, hangups first call if not specified |
Returns
Promise<void>
holdCall()
holdCall(callId?): Promise<void>;Defined in: src/core/SipClient.ts:3071
Hold active call (convenience method) Note: Use CallSession.hold() for more control over specific calls.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId? | string | Optional call ID, holds first call if not specified |
Returns
Promise<void>
unholdCall()
unholdCall(callId?): Promise<void>;Defined in: src/core/SipClient.ts:3084
Unhold active call (convenience method) Note: Use CallSession.unhold() for more control over specific calls.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId? | string | Optional call ID, unholds first call if not specified |
Returns
Promise<void>
transferCall()
transferCall(target, callId?): Promise<void>;Defined in: src/core/SipClient.ts:3098
Transfer active call (convenience method) Note: Use CallSession.transfer() for more control over specific calls.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | string | SIP URI to transfer to |
callId? | string | Optional call ID, transfers first call if not specified |
Returns
Promise<void>
sendDTMF()
sendDTMF(tone, callId?): void;Defined in: src/core/SipClient.ts:3112
Send DTMF tones on active call (convenience method) Note: Use CallSession.sendDTMF() for more control over specific calls.
Parameters
| Parameter | Type | Description |
|---|---|---|
tone | string | DTMF tone to send |
callId? | string | Optional call ID, sends to first call if not specified |
Returns
void
TransportManager
Defined in: src/core/TransportManager.ts:70
TransportManager manages WebSocket connections for SIP communication
Features:
- Automatic reconnection with exponential backoff
- Connection keep-alive (CRLF ping or OPTIONS)
- Connection timeout handling
- State transition management
- Event-driven architecture
Constructors
Constructor
new TransportManager(config): TransportManager;Defined in: src/core/TransportManager.ts:86
Parameters
| Parameter | Type |
|---|---|
config | TransportConfig |
Returns
Accessors
state
Get Signature
get state(): ConnectionState;Defined in: src/core/TransportManager.ts:103
Get current connection state
Returns
isConnected
Get Signature
get isConnected(): boolean;Defined in: src/core/TransportManager.ts:110
Check if currently connected
Returns
boolean
Methods
on()
on(event, handler): void;Defined in: src/core/TransportManager.ts:117
Add event listener
Parameters
| Parameter | Type |
|---|---|
event | TransportEvent |
handler | TransportEventHandler |
Returns
void
off()
off(event, handler): void;Defined in: src/core/TransportManager.ts:130
Remove event listener
Parameters
| Parameter | Type |
|---|---|
event | TransportEvent |
handler | TransportEventHandler |
Returns
void
removeAllListeners()
removeAllListeners(event?): void;Defined in: src/core/TransportManager.ts:140
Remove all event listeners for a specific event type
Parameters
| Parameter | Type |
|---|---|
event? | TransportEvent |
Returns
void
connect()
connect(): Promise<void>;Defined in: src/core/TransportManager.ts:199
Connect to WebSocket server
Returns
Promise<void>
disconnect()
disconnect(): void;Defined in: src/core/TransportManager.ts:262
Disconnect from WebSocket server
Returns
void
send()
send(data): void;Defined in: src/core/TransportManager.ts:280
Send data through WebSocket
Parameters
| Parameter | Type |
|---|---|
data | string | Blob | ArrayBuffer | ArrayBufferView |
Returns
void
reconnect()
reconnect(): Promise<void>;Defined in: src/core/TransportManager.ts:396
Manually trigger reconnection
Returns
Promise<void>
resetReconnectionAttempts()
resetReconnectionAttempts(): void;Defined in: src/core/TransportManager.ts:405
Reset reconnection counter
Returns
void
getReconnectionAttempts()
getReconnectionAttempts(): number;Defined in: src/core/TransportManager.ts:412
Get current reconnection attempt count
Returns
number
destroy()
destroy(): void;Defined in: src/core/TransportManager.ts:419
Clean up resources
Returns
void
AnalyticsPlugin
Defined in: src/plugins/AnalyticsPlugin.ts:459
AnalyticsPlugin class
Main plugin class that implements the Plugin interface for VueSip analytics tracking. Manages event tracking, batching, filtering, queue management, and HTTP delivery to analytics endpoints. Integrates with VueSip's event system to automatically track SIP, call, and media events.
Remarks
This class is the core implementation of the analytics functionality. It maintains an event queue for batching, manages a periodic send timer, tracks session and user information, and provides robust error handling with event requeuing on failures.
Event Queue Management
The plugin maintains an in-memory queue of events:
- Events are added to the queue when tracked (after filtering and validation)
- Queue has a maximum size (
maxQueueSize) to prevent unbounded growth - When full, oldest 10% of events are dropped (FIFO) to make room
- Queue is flushed when batch size is reached or send interval expires
- Failed requests requeue events (respecting capacity limits)
- Queue is flushed on plugin uninstallation to avoid data loss
Session Tracking
Each plugin instance generates a unique session ID:
- Generated once during construction using crypto.randomUUID() if available
- Falls back to timestamp + random string for compatibility
- Included in every tracked event for session correlation
- Persists for the lifetime of the plugin instance
- New session ID generated if plugin is reinstantiated
Batching vs Immediate Sending
The plugin supports two sending modes based on batchEvents configuration:
Batch Mode (batchEvents: true):
- Batch timer started during installation
- Events accumulated in queue until trigger condition:
- Queue size reaches
batchSize, OR sendIntervalexpires
- Queue size reaches
- All queued events sent together in single HTTP request
- Concurrent flush operations prevented with
isFlushingflag - Timer stopped during uninstallation or config update
Immediate Mode (batchEvents: false):
- No batch timer started
- Each event sent individually in its own HTTP request
- Higher network overhead but lower latency
- No queue accumulation (events sent immediately)
Tracked Events
The plugin automatically registers listeners for these VueSip events:
- Connection: connected, disconnected, connectionFailed
- Registration: registered, unregistered, registrationFailed
- Call: callStarted, callAnswered, callEnded, callFailed
- Media: mediaAcquired, mediaReleased, mediaError
- Plugin: plugin:installed (tracks its own installation)
All events are subject to filtering via trackEvents and ignoreEvents configuration.
See
- createAnalyticsPlugin for the factory function to create instances
- DEFAULT_CONFIG for available configuration options
Implements
Constructors
Constructor
new AnalyticsPlugin(): AnalyticsPlugin;Defined in: src/plugins/AnalyticsPlugin.ts:499
Returns
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
metadata | object | undefined | Plugin metadata | src/plugins/AnalyticsPlugin.ts:461 |
metadata.name | string | 'analytics' | - | src/plugins/AnalyticsPlugin.ts:462 |
metadata.version | string | '1.0.0' | - | src/plugins/AnalyticsPlugin.ts:463 |
metadata.description | string | 'Analytics and event tracking plugin' | - | src/plugins/AnalyticsPlugin.ts:464 |
metadata.author | string | 'VueSip' | - | src/plugins/AnalyticsPlugin.ts:465 |
metadata.license | string | 'MIT' | - | src/plugins/AnalyticsPlugin.ts:466 |
defaultConfig | Required<AnalyticsPluginConfig> | DEFAULT_CONFIG | Default configuration | src/plugins/AnalyticsPlugin.ts:470 |
Methods
install()
install(context, config?): Promise<void>;Defined in: src/plugins/AnalyticsPlugin.ts:680
Install the analytics plugin into VueSip
Initializes the analytics plugin by merging configuration, registering event listeners for automatic tracking, and starting the batch send timer if batching is enabled. This method must be called before any events can be tracked and sent to the analytics endpoint.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | PluginContext | The plugin context provided by VueSip's plugin manager, containing the event bus and other runtime information needed for plugin integration |
config? | AnalyticsPluginConfig | Optional configuration object to override default settings. All properties are optional and will be merged with DEFAULT_CONFIG. Common options include: - enabled: Whether analytics is enabled (default: true) - endpoint: Analytics endpoint URL (default: '') - batchEvents: Enable event batching (default: true) - batchSize: Events per batch (default: 10) - sendInterval: Milliseconds between batch sends (default: 30000) - trackEvents: Whitelist of event patterns to track (default: [] - all events) - ignoreEvents: Blacklist of event patterns to ignore (default: []) - transformEvent: Event transformation function - includeUserInfo: Include user ID in events (default: false) - maxQueueSize: Maximum events in queue (default: 1000) - requestTimeout: HTTP request timeout (default: 30000ms) - maxPayloadSize: Maximum event size in bytes (default: 100000) - validateEventData: Validate event data (default: true) |
Returns
Promise<void>
A promise that resolves when installation is complete, including event listener registration and batch timer initialization
Throws
If the plugin is already installed (prevents double installation)
Remarks
Installation Process
- Checks if plugin is already installed to prevent duplicate installation
- Merges provided config with DEFAULT_CONFIG
- Validates that endpoint is configured (logs warning if missing)
- Registers event listeners for SIP, call, and media events
- Starts batch timer if
batchEventsis true - Marks plugin as installed with
isInstalledflag - Tracks a 'plugin:installed' event to record the installation
Event Listener Registration
The following event listeners are registered on the event bus:
- Connection Events: connected, disconnected, connectionFailed
- Registration Events: registered, unregistered, registrationFailed
- Call Events: callStarted, callAnswered, callEnded, callFailed
- Media Events: mediaAcquired, mediaReleased, mediaError
All listeners are tracked in cleanupFunctions array for proper cleanup during uninstallation.
Batch Timer Management
If batchEvents is true:
- Timer is started with interval of
sendIntervalmilliseconds - Timer calls
flushEvents()on each tick to send queued events - Timer is stored in
batchTimerfor cleanup during uninstallation - Multiple calls to
startBatchTimer()are prevented (idempotent)
Configuration Validation
The plugin warns if enabled but no endpoint is configured:
- Events will be tracked but not sent (logged instead)
- Useful for testing and development environments
- Production deployments should always configure an endpoint
Error Handling
If installation fails:
- Batch timer is stopped (if started)
- All registered event listeners are removed
cleanupFunctionsarray is cleared- Error is logged with context
- Error is re-thrown to caller
Double Installation Prevention
The plugin uses isInstalled flag to prevent duplicate installation:
- Returns early with warning if already installed
- Prevents duplicate event listeners and timers
- Flag is cleared during uninstallation to allow reinstallation
Examples
const plugin = createAnalyticsPlugin()
await plugin.install(context, {
endpoint: 'https://analytics.example.com/events'
})
// Plugin ready with default batching and all events trackedconst plugin = createAnalyticsPlugin()
await plugin.install(context, {
enabled: true,
endpoint: 'https://analytics.example.com/events',
batchEvents: true,
batchSize: 50, // Larger batches
sendInterval: 60000, // Send every minute
maxQueueSize: 2000 // Larger queue for high volume
})const plugin = createAnalyticsPlugin()
await plugin.install(context, {
enabled: true,
endpoint: 'https://analytics.example.com/events',
trackEvents: ['call:*', 'sip:connected'], // Only track calls and SIP connection
ignoreEvents: ['call:failed'] // Except call failures
})const plugin = createAnalyticsPlugin()
await plugin.install(context, {
enabled: true,
endpoint: 'https://analytics.example.com/events',
includeUserInfo: true,
transformEvent: (event) => {
// Sanitize phone numbers
if (event.data?.phoneNumber) {
event.data.phoneNumber = event.data.phoneNumber.replace(/\d{4}$/, '****')
}
// Add application context
event.data = {
...event.data,
appVersion: '1.0.0',
environment: 'production'
}
return event
}
})
// Set user ID after installation
plugin.setUserId('user-123')const plugin = createAnalyticsPlugin()
try {
await plugin.install(context, {
endpoint: 'https://analytics.example.com/events'
})
console.log('Analytics plugin installed successfully')
} catch (error) {
console.error('Failed to install analytics plugin:', error)
// Handle error (e.g., disable analytics, notify monitoring)
}Implementation of
uninstall()
uninstall(_context): Promise<void>;Defined in: src/plugins/AnalyticsPlugin.ts:818
Uninstall the analytics plugin from VueSip
Performs cleanup of the analytics plugin by flushing remaining events, stopping the batch timer, removing all event listeners, and resetting the installed flag. This ensures proper cleanup and allows the plugin to be reinstalled if needed.
Parameters
| Parameter | Type | Description |
|---|---|---|
_context | PluginContext | The plugin context (unused but required by Plugin interface) |
Returns
Promise<void>
A promise that resolves when uninstallation and cleanup are complete, including flushing of any remaining queued events
Remarks
Uninstallation Process
- Flushes any remaining events in the queue to avoid data loss
- Stops the batch timer (if running) and clears the timer reference
- Removes all registered event listeners from the event bus
- Clears the
cleanupFunctionsarray - Resets the
isInstalledflag to allow reinstallation
Event Queue Flushing
Before cleanup, the plugin attempts to send any queued events:
- Calls
flushEvents()to send all pending events - This is a best-effort operation - failures are logged but don't prevent cleanup
- Prevents data loss of events that were queued but not yet sent
- Important for ensuring analytics data completeness
Batch Timer Cleanup
If batch mode is enabled:
- Timer is stopped with
clearInterval() - Timer reference is set to null
- Prevents timer from continuing to run after uninstallation
- Avoids memory leaks and unnecessary operations
Event Listener Cleanup
All registered event listeners are removed:
- Iterates through
cleanupFunctionsarray - Calls each cleanup function to remove its listener
- Clears the array after all listeners are removed
- Prevents orphaned listeners from firing after uninstallation
Reinstallation Support
The plugin can be reinstalled after uninstallation:
isInstalledflag is reset to false- New installation will register fresh listeners and timers
- Session ID remains the same (tied to instance, not installation)
- User ID is preserved (not cleared during uninstallation)
Error Handling
The uninstallation process is designed to always complete:
- Event flush errors are handled by
flushEvents()internally - Cleanup operations are simple and unlikely to fail
- Even if flush fails, cleanup proceeds normally
- Ensures plugin can be removed even in error scenarios
Examples
// Uninstall the plugin during shutdown
await analyticsPlugin.uninstall(context)
console.log('Analytics plugin uninstalled')
// Plugin can be reinstalled if needed// Uninstall existing plugin
await analyticsPlugin.uninstall(context)
// Reinstall with new configuration
await analyticsPlugin.install(context, {
endpoint: 'https://new-analytics.example.com/events',
batchSize: 20
})
// Plugin operational again with new settings// During application shutdown
try {
await analyticsPlugin.uninstall(context)
console.log('Analytics events flushed and plugin cleaned up')
} catch (error) {
console.error('Error during analytics cleanup:', error)
// Continue shutdown anyway - cleanup attempted
}Implementation of
updateConfig()
updateConfig(_context, config): Promise<void>;Defined in: src/plugins/AnalyticsPlugin.ts:978
Update the analytics plugin configuration at runtime
Merges the provided configuration with the current configuration and dynamically adjusts plugin behavior including batch timer management and batching mode. This allows the plugin to adapt its behavior without requiring reinstallation.
Parameters
| Parameter | Type | Description |
|---|---|---|
_context | PluginContext | The plugin context (unused but required by Plugin interface) |
config | AnalyticsPluginConfig | Partial or complete configuration object to merge with existing config. Properties not specified retain their current values. Can include any of the configuration options from DEFAULT_CONFIG. The configuration is shallow merged. |
Returns
Promise<void>
A promise that resolves when the configuration update completes, including any necessary timer restarts or event queue flushing
Remarks
Update Process
- Saves old configuration for comparison
- Merges new config with existing config (shallow merge)
- Checks for batch timer interval changes
- Restarts batch timer if interval changed and batching enabled
- Handles batching mode toggle (enabled ↔ disabled)
- Logs configuration update
Configuration Merging
Configuration is merged using object spread:
this.config = { ...this.config, ...config }- Provided properties override existing values
- Missing properties retain current values
- Nested objects are not deep merged (shallow merge only)
Batch Timer Management
The plugin intelligently manages the batch timer based on configuration changes:
Send Interval Change (batchEvents remains true):
- Stops existing timer
- Starts new timer with updated
sendInterval - Existing queue is preserved
Batching Disabled (batchEvents: false):
- Stops batch timer
- Flushes current queue to send pending events
- Future events sent immediately (no queuing)
Batching Enabled (batchEvents: true, was false):
- Starts batch timer with
sendInterval - Future events will be queued and batched
Event Queue Behavior
The event queue is preserved across configuration updates:
- Events in queue remain queued
- Only sending behavior changes
- When disabling batching, queue is flushed before switching modes
- When enabling batching, new events start accumulating
Runtime Configuration Updates
Common configuration updates include:
- Changing batch size or interval for performance tuning
- Enabling/disabling batching based on network conditions
- Updating event filters (trackEvents, ignoreEvents)
- Changing endpoint URL
- Toggling user info inclusion
- Adjusting queue size limits
No Event Emission
Unlike PluginManager.updateConfig(), this method does not emit events:
- Plugin-level updates are internal
- PluginManager emits 'plugin:configUpdated' when called through it
- Direct plugin updates are silent
Examples
// Reduce batching for lower latency
await analyticsPlugin.updateConfig(context, {
batchSize: 5,
sendInterval: 10000 // Send every 10 seconds
})
// Timer restarts with new interval// Switch to immediate sending
await analyticsPlugin.updateConfig(context, {
batchEvents: false
})
// Queue flushed, future events sent immediately
// Switch back to batching
await analyticsPlugin.updateConfig(context, {
batchEvents: true,
batchSize: 10,
sendInterval: 30000
})
// Batch timer started, events will be queued// Change which events are tracked
await analyticsPlugin.updateConfig(context, {
trackEvents: ['call:*'], // Only track call events
ignoreEvents: ['call:failed'] // Except failures
})
// New filters apply to future events immediately// Switch to new analytics backend with larger queue
await analyticsPlugin.updateConfig(context, {
endpoint: 'https://new-analytics.example.com/events',
maxQueueSize: 2000,
requestTimeout: 10000
})
// Future requests use new endpoint and settings// Enable user tracking after user logs in
await analyticsPlugin.updateConfig(context, {
includeUserInfo: true
})
analyticsPlugin.setUserId('user-123')
// Future events include user ID
// Disable user tracking after logout
await analyticsPlugin.updateConfig(context, {
includeUserInfo: false
})
// Future events don't include user ID (even if set)Implementation of
setUserId()
setUserId(userId): void;Defined in: src/plugins/AnalyticsPlugin.ts:2240
Set the user ID for analytics tracking
Associates a user identifier with all future analytics events. The user ID is only included in events when includeUserInfo configuration is enabled. This allows tracking user behavior across sessions and correlating events with specific users.
Parameters
| Parameter | Type | Description |
|---|---|---|
userId | string | The user identifier to associate with analytics events. Can be any string that uniquely identifies the user (user ID, email, username, UUID, etc.). The format and content are application-specific. Should not contain sensitive information unless properly encrypted or hashed. |
Returns
void
Remarks
User ID Behavior
- Stored in the plugin instance's
userIdproperty - Persists until explicitly changed or plugin is destroyed
- Only included in events when
includeUserInfo: truein configuration - Added to the
userIdfield of each tracked event - Not cleared during uninstallation (survives across install/uninstall cycles)
Privacy Considerations
When setting user IDs:
- Consider privacy regulations (GDPR, CCPA, etc.)
- Avoid including PII (personally identifiable information) directly
- Consider using hashed or anonymized identifiers
- Ensure user consent for tracking before setting
- Provide way for users to opt out (disable
includeUserInfo)
Configuration Interaction
The user ID works in conjunction with includeUserInfo config:
includeUserInfo: false: User ID set but not included in eventsincludeUserInfo: true: User ID included in all future events- Toggle
includeUserInfoat runtime to control tracking - Useful for respecting user privacy preferences
Session vs User Tracking
The plugin tracks both sessions and users:
- Session ID: Automatically generated, always included, tracks single session
- User ID: Manually set, conditionally included, tracks user across sessions
- Correlate events using both IDs for complete user journey analysis
Lifecycle
User ID lifecycle considerations:
- Set after user authentication/login
- Persists across plugin reinstallation (tied to instance)
- Clear by setting to empty string or undefined
- Not affected by configuration updates
- Survives browser refreshes if plugin instance persists
Examples
// User logs in
const user = await authenticate(credentials)
// Set user ID for analytics
analyticsPlugin.setUserId(user.id)
// Future events (if includeUserInfo: true) will include userId: user.id// Hash user email for privacy-conscious tracking
const hashedEmail = await hashString(user.email)
analyticsPlugin.setUserId(hashedEmail)
// Events include hashed ID, not raw email// User logs out
analyticsPlugin.setUserId('')
// Or disable user tracking entirely
await pluginManager.updateConfig('analytics', {
includeUserInfo: false
})// Check user consent before tracking
if (userConsents ToTracking) {
// Enable user tracking
await pluginManager.updateConfig('analytics', {
includeUserInfo: true
})
analyticsPlugin.setUserId(user.id)
} else {
// Track sessions only, no user ID
await pluginManager.updateConfig('analytics', {
includeUserInfo: false
})
}// Track user journey across multiple sessions
analyticsPlugin.setUserId(user.id)
// Session 1: user.id + sessionId1 → events
// ... user closes browser ...
// Session 2: user.id + sessionId2 → events
// Correlate events:
// - By userId: See all actions across sessions
// - By sessionId: See actions within single session
// - By both: Complete user journey with session boundariesHookManager
Defined in: src/plugins/HookManager.ts:414
HookManager class
Main manager class that implements centralized hook lifecycle management for VueSip. Coordinates hook registration from multiple plugins, executes hooks in priority order, manages conditional execution, handles once-only hooks, and provides hook cleanup.
Remarks
This class serves as the central registry and orchestrator for all hooks in the VueSip ecosystem. It maintains hook state, manages priority-based execution ordering, and ensures proper lifecycle transitions from registration through execution to cleanup.
Internal State Management
The HookManager maintains several internal data structures:
- hooks: Map<HookName, HookRegistration[]> - Maps hook names to sorted arrays of registrations
- idCounter: number - Monotonically increasing counter for generating unique hook IDs
- context: PluginContext | null - Shared context passed to all hook handlers during execution
Priority-Based Storage
Hook registrations are stored in arrays sorted by priority:
- Arrays are sorted immediately upon registration (highest priority first)
- Sorting uses numeric comparison: higher values execute first
- Within same priority, registration order is preserved
- Sorted storage ensures O(n) execution time without sorting overhead
Hook Registration Workflow
When a hook is registered via register():
- Generate unique hook ID (hook-{counter})
- Create HookRegistration object with handler, options, plugin name, and ID
- Apply default values to options (priority: Normal, once: false, condition: () => true)
- Retrieve or create hook array for the hook name
- Add registration to array
- Sort array by priority (highest first)
- Store sorted array back in the map
- Log registration with details
- Return unique hook ID
Context Management
The plugin context is set via setContext() and provides:
- Access to VueSip services (sipClient, mediaManager, config, activeCalls)
- Event bus for plugin communication
- Logger for debug output
- Hooks interface for recursive hook registration
- Application version string
Execution Context
During hook execution, each handler receives:
- context: The PluginContext set via setContext()
- data: Optional data passed to execute()
- Handlers can access all VueSip services through context
- Handlers can be async (execution awaits completion)
Memory Management
The HookManager manages memory efficiently:
- Empty hook arrays are deleted from the map
- Once-only handlers are removed after execution
- Cleanup removes all handlers for a plugin
- Clear removes all hooks from the system
See
- register for hook registration workflow
- execute for hook execution workflow
- unregisterByPlugin for plugin cleanup workflow
Constructors
Constructor
new HookManager(): HookManager;Returns
Methods
setContext()
setContext(context): void;Defined in: src/plugins/HookManager.ts:500
Set the plugin context and make it available to all hook handlers
Updates the PluginContext reference that will be passed to all hook handlers during execution. This context provides hooks with access to VueSip services, event bus, logger, and other application state. Should be called during initialization and whenever the context needs to be updated with new service references.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | PluginContext | The PluginContext object to make available to all hook handlers. Contains references to VueSip services (sipClient, mediaManager, config, activeCalls), event bus for plugin communication, logger for debugging, hooks interface for hook registration, and application version string. |
Returns
void
Remarks
When to Call
This method should be called:
- During HookManager initialization (after construction)
- When VueSip services are initialized or updated (sipClient, mediaManager, etc.)
- Via PluginManager.createContext() whenever service references change
- Before executing any hooks (execution requires context to be set)
Impact on Hook Execution
When this method is called:
- The context reference is updated immediately
- All subsequent hook executions receive the new context
- Already-registered hooks automatically see the updated context
- No need to re-register hooks when context changes
Context Structure
The context typically includes:
eventBus: EventBus instance for emitting and listening to eventssipClient: SipClient instance (null if not yet initialized)mediaManager: MediaManager instance (null if not yet initialized)config: SipClientConfig object (null if not yet loaded)activeCalls: Map of active CallSession instanceshooks: Hook registration and execution interfacelogger: Logger instance for debug outputversion: Application version string
Service Availability
Services in the context may be null if not yet initialized:
- Hook handlers should check for null before accessing services
- Services are gradually populated as the application initializes
- Context is shared by reference (all hooks see the same instance)
Examples
const hookManager = new HookManager()
// Create initial context with available services
const context: PluginContext = {
eventBus,
sipClient: null, // Not yet initialized
mediaManager: null, // Not yet initialized
config: null,
activeCalls: new Map(),
hooks: hooksInterface,
logger,
version: '1.0.0'
}
hookManager.setContext(context)
// Context is now available to all hook handlers// Later, when SipClient is initialized
const updatedContext = {
...context,
sipClient: newSipClient
}
hookManager.setContext(updatedContext)
// All hooks now have access to sipClientregister()
register<TData, TReturn>(
name,
handler,
options,
pluginName): string;Defined in: src/plugins/HookManager.ts:683
Register a hook handler with priority-based execution ordering
Registers a new hook handler for the specified hook name with configurable priority, conditional execution, and once-only behavior. Handlers are automatically sorted by priority (highest first) and executed in that order when the hook is triggered.
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | unknown |
TReturn | unknown |
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
name | string | undefined | The name of the hook to register the handler for. This corresponds to lifecycle events in VueSip (e.g., 'beforeCall', 'callStarted', 'callEnded'). |
handler | HookHandler<TData, TReturn> | undefined | The handler function to execute when the hook is triggered. Receives the plugin context and optional data. Can be async. Signature: (context: PluginContext, data?: TData) => TReturn |
options | HookOptions | {} | Optional configuration for the hook handler: - priority: Execution priority (default: HookPriority.Normal = 0). Higher values run first. - once: If true, handler is removed after first execution (default: false) - condition: Function that determines if handler should execute (default: () => true) |
pluginName | string | 'core' | Name of the plugin registering this hook (default: 'core'). Used for tracking and cleanup via unregisterByPlugin(). |
Returns
string
A unique hook ID string (format: 'hook-{number}') that can be used to unregister the specific handler via unregister(hookId).
Remarks
Registration Workflow
When this method is called, the following steps occur:
- ID Generation: Generate unique hook ID using incrementing counter
- Registration Creation: Create HookRegistration object with handler, options, plugin name, and ID
- Default Options: Apply default values to missing options (priority: Normal, once: false, condition: () => true)
- Array Retrieval: Get existing hook array for this hook name, or create new empty array
- Array Addition: Add new registration to the array
- Priority Sorting: Sort array by priority (highest numeric value first)
- Map Update: Store sorted array back in the hooks map
- Logging: Log registration details (hook name, ID, plugin name, priority)
- Return: Return the unique hook ID to caller
Hook Priorities
Priority determines execution order (highest to lowest):
- Highest (1000): Runs first - critical pre-processing, validation, blocking operations
- High (500): Runs before normal - important setup, early intervention
- Normal (0): Default priority - standard plugin operations
- Low (-500): Runs after normal - post-processing, cleanup
- Lowest (-1000): Runs last - final cleanup, logging, auditing
Priority Sorting Algorithm
Handlers are sorted using: (a, b) => b.options.priority - a.options.priority
- Descending numeric sort (highest priority first)
- Within same priority, registration order is preserved (stable sort)
- Sorting occurs immediately on registration, not during execution
- Ensures consistent execution order across all invocations
Execution Order Guarantees
When hooks are executed:
- Higher priority handlers always execute before lower priority handlers
- Within same priority level, handlers execute in registration order (first registered, first executed)
- Order is deterministic and predictable
- New registrations are inserted in correct priority position
Condition Evaluation Timing
If a condition function is provided:
- Evaluated immediately before handler execution (not at registration time)
- Receives current context and data at execution time
- If condition returns false, handler is skipped
- If condition throws error, handler is skipped and error is logged
- Allows dynamic, context-dependent hook execution
Once Handler Cleanup
If options.once is true:
- Handler executes only once (on first trigger)
- After execution completes, handler is automatically removed from registry
- Removal occurs even if handler throws error
- Useful for initialization or one-time setup hooks
- ID becomes invalid after removal (unregister will return false)
Handler Signature
The handler function signature:
async (context: PluginContext, data?: TData): Promise<TReturn> => {
// Access VueSip services via context
const { sipClient, mediaManager, config, activeCalls, eventBus } = context
// Process the hook data
console.log('Hook triggered with data:', data)
// Return false to stop propagation, or any other value
return someResult
}Type Parameters
TData: The type of data passed to the handler (from execute())TReturn: The type of value returned by the handler
Examples
const hookId = hookManager.register(
'callStarted',
async (context, data) => {
console.log('Call started:', data.callId)
// Handler logic here
},
{ priority: HookPriority.Normal },
'my-plugin'
)
// Returns: 'hook-0' (can be used to unregister later)// This handler runs before Normal priority handlers
hookManager.register(
'beforeCall',
async (context, data) => {
// Validate call parameters
if (!isValidUri(data.targetUri)) {
return false // Block the call
}
return true
},
{ priority: HookPriority.High }, // Runs early for validation
'validation-plugin'
)// Only runs for video calls
hookManager.register(
'callStarted',
async (context, data) => {
console.log('Video call started')
// Video-specific handling
},
{
priority: HookPriority.Normal,
condition: (context, data) => data.hasVideo === true
},
'video-plugin'
)// Runs only on first call, then auto-removes
hookManager.register(
'callStarted',
async (context, data) => {
console.log('First call - initializing resources')
await initializeResources()
},
{
priority: HookPriority.High,
once: true // Automatically removed after first execution
},
'init-plugin'
)// Register handlers in random order with different priorities
hookManager.register('test', async () => {
console.log('C: Normal priority')
}, { priority: HookPriority.Normal }, 'plugin-c')
hookManager.register('test', async () => {
console.log('A: Highest priority')
}, { priority: HookPriority.Highest }, 'plugin-a')
hookManager.register('test', async () => {
console.log('B: High priority')
}, { priority: HookPriority.High }, 'plugin-b')
await hookManager.execute('test')
// Output:
// A: Highest priority
// B: High priority
// C: Normal priorityunregister()
unregister(hookId): boolean;Defined in: src/plugins/HookManager.ts:829
Unregister a specific hook handler by its unique ID
Removes a single hook handler from the registry using its unique ID returned from register(). Useful for cleaning up individual hooks without affecting other handlers or requiring knowledge of the hook name or plugin.
Parameters
| Parameter | Type | Description |
|---|---|---|
hookId | string | The unique hook ID returned from register() (format: 'hook-{number}'). Must be a valid ID from a currently registered hook. |
Returns
boolean
True if the hook was found and successfully removed, false if the hook ID was not found in the registry (already removed or never existed).
Remarks
Unregistration Workflow
When this method is called:
- Iteration: Loop through all hook names in the hooks map
- Search: For each hook name, search its array for matching hook ID
- Removal: If found, remove the hook from the array using splice()
- Cleanup: If array becomes empty after removal, delete the hook name from map
- Logging: Log the unregistration event with hook ID
- Return: Return true immediately if found, false if not found after searching all hooks
Memory Cleanup
This method performs automatic memory cleanup:
- Removes the hook from its array (frees handler function reference)
- If array becomes empty, removes the hook name entry from the map
- Prevents memory leaks from orphaned hooks
- Helps maintain efficient map size
Use Cases
Unregister by ID is useful when:
- You have the hook ID from registration
- You want to remove a specific hook instance
- You don't know which hook name the handler is registered under
- You're implementing conditional hook registration (register/unregister based on state)
- You're cleaning up individual hooks without affecting others
Performance Characteristics
- Time complexity: O(n * m) where n is number of hook names, m is average handlers per name
- Searches all hooks until match is found
- Early return on first match (doesn't search remaining hooks)
- For frequent unregistration, consider using unregisterByPlugin() for batch removal
Return Value Semantics
The return value indicates success:
true: Hook was found and removed successfullyfalse: Hook ID not found (may have been already removed or never existed)- No error is thrown for invalid IDs (returns false instead)
- Idempotent: calling multiple times with same ID returns false after first call
Comparison with Other Cleanup Methods
- unregister(id): Remove specific hook by ID (this method)
- unregisterByPlugin(name): Remove all hooks from a plugin (batch operation)
- clear(): Remove all hooks from all plugins (nuclear option)
Examples
// Register a hook and save its ID
const hookId = hookManager.register(
'callStarted',
async (context, data) => {
console.log('Handler called')
},
{},
'my-plugin'
)
// Later, remove the specific hook
const removed = hookManager.unregister(hookId)
console.log('Hook removed:', removed) // true
// Trying to remove again returns false
const removedAgain = hookManager.unregister(hookId)
console.log('Hook removed again:', removedAgain) // false// Register temporary hook
const tempHookId = hookManager.register(
'callStarted',
async (context, data) => {
if (someCondition) {
// Do something
// Then clean up this hook
hookManager.unregister(tempHookId)
}
},
{},
'temp-plugin'
)const hookIds: string[] = []
// Register multiple hooks and track IDs
hookIds.push(hookManager.register('beforeCall', handler1, {}, 'plugin'))
hookIds.push(hookManager.register('callStarted', handler2, {}, 'plugin'))
hookIds.push(hookManager.register('callEnded', handler3, {}, 'plugin'))
// Later, clean up all tracked hooks
hookIds.forEach(id => {
const removed = hookManager.unregister(id)
console.log(`Hook ${id} removed: ${removed}`)
})unregisterByPlugin()
unregisterByPlugin(pluginName): number;Defined in: src/plugins/HookManager.ts:980
Unregister all hooks registered by a specific plugin
Removes all hook handlers that were registered with the specified plugin name. This is a batch operation that efficiently cleans up all hooks for a plugin without requiring individual hook IDs. Typically called when a plugin is uninstalled via PluginManager.unregister().
Parameters
| Parameter | Type | Description |
|---|---|---|
pluginName | string | The name of the plugin whose hooks should be removed. This is the plugin name that was passed to register() when hooks were registered. |
Returns
number
The total number of hooks that were removed across all hook names. Returns 0 if no hooks were found for the specified plugin.
Remarks
Unregistration Workflow
When this method is called:
- Initialize Counter: Set removed count to 0
- Iterate Hooks: Loop through all hook names in the hooks map
- Filter Arrays: For each hook name, filter out hooks matching the plugin name
- Count Removed: Calculate how many hooks were removed (original length - filtered length)
- Update Map: If filtered array is empty, delete hook name from map; otherwise update with filtered array
- Accumulate: Add removed count to total
- Logging: If any hooks were removed, log the total count with plugin name
- Return: Return total number of hooks removed
Batch Removal Efficiency
This method is optimized for batch removal:
- Single pass through all hooks for the plugin
- Uses Array.filter() for efficient removal
- Automatically cleans up empty hook arrays
- More efficient than calling unregister() multiple times
- Single log message for entire batch operation
Memory Cleanup
This method performs comprehensive memory cleanup:
- Removes all hook registrations for the plugin
- Deletes hook name entries that become empty
- Frees all handler function references
- Prevents memory leaks from orphaned plugin hooks
- Ensures complete cleanup when plugins are uninstalled
When to Use
This method is typically used:
- Automatically by PluginManager when unregistering a plugin
- During plugin uninstallation to ensure complete cleanup
- When resetting a plugin's hooks without reinstalling
- During shutdown to clean up plugin hooks by name
- In tests to clean up plugin hooks between test cases
Return Value Semantics
The return value indicates the scope of cleanup:
> 0: Hooks were found and removed (number indicates how many)0: No hooks found for this plugin (may not have registered any, or already cleaned up)- Never negative (count is always >= 0)
- Can be used to verify cleanup occurred
Integration with PluginManager
This method is called automatically by PluginManager:
- Called in PluginManager.unregister() during plugin cleanup
- Ensures all plugin hooks are removed when plugin is uninstered
- Occurs in the finally block to guarantee cleanup even if uninstall() fails
- Plugin entry is deleted after hooks are cleaned up
- Prevents orphaned hooks from executing after plugin removal
Comparison with Other Cleanup Methods
- unregister(id): Remove specific hook by ID (single hook)
- unregisterByPlugin(name): Remove all hooks from a plugin (this method - batch)
- clear(): Remove all hooks from all plugins (nuclear option)
Examples
// Plugin registers multiple hooks
hookManager.register('beforeCall', handler1, {}, 'my-plugin')
hookManager.register('callStarted', handler2, {}, 'my-plugin')
hookManager.register('callEnded', handler3, {}, 'my-plugin')
console.log('Total hooks:', hookManager.getStats().totalHandlers) // 3
// Remove all hooks for the plugin
const removed = hookManager.unregisterByPlugin('my-plugin')
console.log('Removed hooks:', removed) // 3
console.log('Total hooks:', hookManager.getStats().totalHandlers) // 0async function uninstallPlugin(pluginName: string) {
// Get plugin entry
const entry = pluginManager.get(pluginName)
if (!entry) return
try {
// Call plugin's uninstall method
await entry.plugin.uninstall?.(context)
} finally {
// Always clean up hooks, even if uninstall fails
const removed = hookManager.unregisterByPlugin(pluginName)
console.log(`Cleaned up ${removed} hooks for ${pluginName}`)
}
}// Check if plugin has any hooks before cleanup
const statsBefore = hookManager.getStats()
const beforeCount = statsBefore.handlersByPlugin['analytics-plugin'] || 0
console.log('Hooks before cleanup:', beforeCount)
// Clean up plugin hooks
const removed = hookManager.unregisterByPlugin('analytics-plugin')
// Verify cleanup
const statsAfter = hookManager.getStats()
const afterCount = statsAfter.handlersByPlugin['analytics-plugin'] || 0
console.log('Hooks after cleanup:', afterCount) // 0
console.log('Cleanup successful:', removed === beforeCount)// Remove hooks from specific plugins while keeping others
const pluginsToCleanup = ['temp-plugin', 'debug-plugin', 'test-plugin']
let totalRemoved = 0
for (const pluginName of pluginsToCleanup) {
const removed = hookManager.unregisterByPlugin(pluginName)
totalRemoved += removed
console.log(`Removed ${removed} hooks from ${pluginName}`)
}
console.log(`Total hooks removed: ${totalRemoved}`)execute()
execute<TData, TReturn>(name, data?): Promise<TReturn[]>;Defined in: src/plugins/HookManager.ts:1273
Execute all registered handlers for a hook in priority order
Executes all hook handlers registered for the specified hook name, following strict priority ordering (highest to lowest), evaluating conditions, handling once-only hooks, respecting propagation stopping, and collecting results. This is the primary method for triggering hooks and coordinating plugin responses to lifecycle events.
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | unknown |
TReturn | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the hook to execute. This corresponds to lifecycle events in VueSip (e.g., 'beforeCall', 'callStarted', 'callEnded', 'messageReceived'). |
data? | TData | Optional data to pass to all hook handlers. The data structure should match the expected input type for the specific hook. All handlers receive the same data object (shared by reference, handlers can mutate it). |
Returns
Promise<TReturn[]>
A promise that resolves to an array of results returned by all executed handlers. The array maintains priority order (highest priority results first). Handlers that were skipped (condition failed) or threw errors don't contribute to the results array. Returns empty array if no handlers are registered or context is not set.
Remarks
Execution Workflow
When this method is called, handlers execute through the following workflow:
- Lookup: Retrieve all handlers registered for the hook name from the hooks map
- Empty Check: If no handlers found, return empty array immediately
- Context Check: If context is not set, log warning and return empty array
- Logging: Log execution start with hook name and handler count
- Initialize: Create empty results array and toRemove array for once handlers
- Iteration: Loop through handlers in priority order (highest to lowest)
For each handler:
- Condition Evaluation:
- If condition function exists, call it with (context, data)
- If condition returns false, skip handler and continue to next
- If condition throws error, log error, skip handler, continue to next
- Handler Execution:
- Call handler with (context, data)
- Await async handlers (execution waits for completion)
- If handler throws error, log error and continue to next handler
- Result Collection: Store handler result in results array
- Once Marking: If handler has once=true, add hook ID to toRemove array
- Propagation Check: If result === false (strict equality), break loop (stop execution)
- Cleanup: Remove all hook IDs in toRemove array via unregister()
- Return: Return results array to caller
Hook Priority and Execution Order
Handlers execute in strict priority order:
- Highest (1000) → High (500) → Normal (0) → Low (-500) → Lowest (-1000)
- Higher numeric priority values execute first
- Within same priority, registration order is preserved (first registered, first executed)
- Priority is set during registration and cannot be changed
- Arrays are pre-sorted by priority, ensuring O(n) execution time
Condition Evaluation Details
Conditions provide dynamic, context-dependent execution:
- Timing: Evaluated immediately before each handler execution (not at registration)
- Signature: (context: PluginContext, data?: TData) => boolean
- True Return: Handler executes normally
- False Return: Handler is skipped, execution continues with next handler
- Error Thrown: Handler is skipped, error is logged, execution continues
- Use Cases: Direction filtering (incoming/outgoing), state checks, feature flags
Once Handler Cleanup Mechanism
Once-only handlers are automatically cleaned up:
- Marking: During execution, once handlers' IDs are added to toRemove array
- Timing: Removal occurs after all handlers execute (not immediately after individual handler)
- Method: Uses unregister(hookId) for each marked ID
- Guarantee: Removal occurs even if handler throws error
- Batch: Multiple once handlers are removed together after execution completes
- Purpose: Initialization hooks, one-time setup, feature detection
Propagation Stopping (return false)
Handlers can halt execution by returning false:
- Detection: Uses strict equality (result === false), not falsy check
- Effect: Immediately stops iteration, no subsequent handlers execute
- Results: Already-executed handlers' results are included in returned array
- Logging: Logs which handler stopped propagation with its hook ID
- Use Cases: Validation hooks blocking operations, access control, cancellation
- Note: Higher priority handlers have already executed (can't be stopped retroactively)
Error Handling Strategies
Execution is resilient to errors at multiple levels:
Condition Errors:
- Caught in inner try-catch within condition evaluation
- Logged with error message: "Hook condition error: {hookId}"
- Handler is skipped (continues to next handler)
- Does not stop execution of other handlers
Handler Errors:
- Caught in outer try-catch around handler execution
- Logged with error message: "Hook handler error: {hookId}"
- Handler result is not added to results array
- Does not stop execution of other handlers
Context Not Set:
- Checked before execution begins
- Logs warning: "Hook execution before context set: {hookName}"
- Returns empty array immediately
- No handlers are executed
No Handlers Registered:
- Returns empty array immediately
- No warning or error (normal case)
- Minimal performance overhead
Performance Characteristics
Execution performance:
- Time Complexity: O(n) where n is number of registered handlers for the hook
- No Sorting Overhead: Arrays are pre-sorted at registration time
- Early Termination: Stops if handler returns false (can reduce iterations)
- Async Handling: Sequential execution with await (handlers run one at a time)
- Memory: Results array grows with number of successful handler executions
Type Parameters
TData: The type of data passed to all hook handlersTReturn: The type of value returned by hook handlers
Examples
// Execute a hook with data
const results = await hookManager.execute('callStarted', {
callId: 'call-123',
direction: 'incoming',
remoteParty: 'alice@example.com'
})
console.log(`${results.length} handlers executed`)
console.log('Results:', results)// Handlers execute in priority order regardless of registration order
hookManager.register('test', async () => {
console.log('3rd: Normal priority')
return 'normal'
}, { priority: HookPriority.Normal }, 'plugin-c')
hookManager.register('test', async () => {
console.log('1st: Highest priority')
return 'highest'
}, { priority: HookPriority.Highest }, 'plugin-a')
hookManager.register('test', async () => {
console.log('2nd: High priority')
return 'high'
}, { priority: HookPriority.High }, 'plugin-b')
const results = await hookManager.execute('test')
console.log(results) // ['highest', 'high', 'normal']
// Output demonstrates priority ordering// First handler blocks execution
hookManager.register('beforeCall', async (ctx, data) => {
if (data.targetUri.includes('blocked.com')) {
console.log('Call blocked by validation')
return false // Stop execution
}
return true
}, { priority: HookPriority.Highest }, 'validator')
// This won't run if previous handler returned false
hookManager.register('beforeCall', async (ctx, data) => {
console.log('Logging allowed call')
}, { priority: HookPriority.Normal }, 'logger')
const results = await hookManager.execute('beforeCall', {
targetUri: 'user@blocked.com'
})
console.log(results) // [false] - only first handler ran
// "Logging allowed call" is NOT printed// Handler that only runs for video calls
hookManager.register('callStarted', async (ctx, data) => {
console.log('Video call handling')
return 'video'
}, {
priority: HookPriority.Normal,
condition: (ctx, data) => data.hasVideo === true
}, 'video-plugin')
// Execute with video call - handler runs
let results = await hookManager.execute('callStarted', {
callId: 'call-1',
hasVideo: true
})
console.log(results) // ['video']
// Execute without video - handler is skipped
results = await hookManager.execute('callStarted', {
callId: 'call-2',
hasVideo: false
})
console.log(results) // [] (handler skipped)// Handler runs only once then auto-removes
hookManager.register('callStarted', async (ctx, data) => {
console.log('First call initialization')
await initializeResources()
return 'initialized'
}, {
priority: HookPriority.High,
once: true
}, 'init-plugin')
console.log('Before:', hookManager.count('callStarted')) // 1
// First execution - handler runs and is removed
let results = await hookManager.execute('callStarted', { callId: 'call-1' })
console.log('First results:', results) // ['initialized']
console.log('After:', hookManager.count('callStarted')) // 0
// Second execution - handler doesn't exist anymore
results = await hookManager.execute('callStarted', { callId: 'call-2' })
console.log('Second results:', results) // []// Handler that throws error
hookManager.register('callStarted', async () => {
throw new Error('Handler 1 failed')
// Error is caught and logged, execution continues
}, { priority: HookPriority.High }, 'faulty-plugin')
// This handler still runs
hookManager.register('callStarted', async () => {
console.log('Handler 2 executing')
return 'success'
}, { priority: HookPriority.Normal }, 'healthy-plugin')
const results = await hookManager.execute('callStarted', { callId: 'call-1' })
console.log('Results:', results) // ['success']
// Handler 2 ran successfully despite Handler 1 throwing error
// Error is logged but doesn't prevent other handlers from running// Multiple handlers return different data
hookManager.register('dataValidation', async (ctx, data) => {
return { validator: 'schema', valid: true }
}, { priority: HookPriority.High }, 'schema-validator')
hookManager.register('dataValidation', async (ctx, data) => {
return { validator: 'business-rules', valid: true }
}, { priority: HookPriority.Normal }, 'business-validator')
const results = await hookManager.execute('dataValidation', { value: 123 })
// Process all validation results
const allValid = results.every(r => r.valid)
console.log('All validations passed:', allValid)
// Check specific validator
const schemaResult = results.find(r => r.validator === 'schema')
console.log('Schema validation:', schemaResult)getAll()
getAll(): Map<string, HookRegistration<any, any>[]>;Defined in: src/plugins/HookManager.ts:1376
Get all registered hooks with their handlers
Returns a copy of the internal hooks map containing all registered hook names and their associated handler registrations. The returned map is a shallow copy, so modifications to the map itself don't affect the internal registry.
Returns
Map<string, HookRegistration<any, any>[]>
A new Map containing all hook registrations, indexed by hook name. Each entry contains an array of HookRegistration objects sorted by priority (highest first). The map is empty if no hooks are registered.
Remarks
Copy Semantics
This method returns a shallow copy of the internal hooks map:
- The Map itself is a new instance (modifications don't affect the registry)
- The HookRegistration arrays are the same references (not deep cloned)
- Safe to iterate or modify the returned map without affecting the registry
- Modifications to arrays or registrations would affect the registry
Use Cases
Getting all hooks is useful for:
- Inspecting registered hooks for debugging
- Generating hook statistics or reports
- Implementing hook visualization or admin UI
- Testing hook registration
- Auditing plugin hook usage
Example
const allHooks = hookManager.getAll()
for (const [hookName, registrations] of allHooks) {
console.log(`Hook: ${hookName}`)
console.log(` Handlers: ${registrations.length}`)
registrations.forEach(reg => {
console.log(` - ${reg.pluginName} (priority: ${reg.options.priority})`)
})
}get()
get(name): HookRegistration<any, any>[];Defined in: src/plugins/HookManager.ts:1430
Get all handler registrations for a specific hook name
Retrieves the array of hook handlers registered for the specified hook name, sorted by priority (highest first). Returns an empty array if no handlers are registered for the hook.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the hook to retrieve handlers for (e.g., 'beforeCall', 'callStarted', 'callEnded'). |
Returns
HookRegistration<any, any>[]
An array of HookRegistration objects for the specified hook, sorted by priority (highest first). Returns empty array if no handlers are registered. The array contains the actual registration objects (not a copy).
Remarks
Array Structure
The returned array contains HookRegistration objects with:
name: The hook name (same as the parameter)handler: The handler functionoptions: Hook options (priority, once, condition)pluginName: Name of the plugin that registered the hookid: Unique hook ID
Priority Ordering
The array is sorted by priority:
- Highest priority handlers appear first in the array
- Within same priority, registration order is preserved
- Array is already sorted (no need to sort on retrieval)
Use Cases
Getting hooks for a specific name is useful for:
- Inspecting which plugins registered handlers for a hook
- Checking handler priorities before execution
- Debugging hook execution order
- Verifying hook registration in tests
- Generating hook-specific reports
Example
const handlers = hookManager.get('callStarted')
console.log(`${handlers.length} handlers registered for 'callStarted'`)
handlers.forEach((registration, index) => {
console.log(`${index + 1}. ${registration.pluginName}`)
console.log(` Priority: ${registration.options.priority}`)
console.log(` Once: ${registration.options.once}`)
console.log(` ID: ${registration.id}`)
})has()
has(name): boolean;Defined in: src/plugins/HookManager.ts:1480
Check if a hook has any registered handlers
Tests whether any handlers are registered for the specified hook name. Returns true if at least one handler exists, false if no handlers are registered.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the hook to check (e.g., 'beforeCall', 'callStarted'). |
Returns
boolean
True if one or more handlers are registered for the hook, false if no handlers are registered or the hook doesn't exist in the registry.
Remarks
Use Cases
Checking for hook handlers is useful for:
- Conditional hook execution (skip if no handlers)
- Optimization (avoid execution overhead if no handlers)
- Feature detection (check if plugins provide functionality)
- Debugging (verify hooks are registered)
- Testing (assert hooks are registered correctly)
Performance
This is a fast O(1) operation:
- Map lookup is O(1)
- Array length check is O(1)
- No iteration through handlers
Examples
if (hookManager.has('beforeCall')) {
// Only execute if handlers are registered
const results = await hookManager.execute('beforeCall', callData)
// Process results...
} else {
console.log('No beforeCall handlers registered, skipping')
}const hasRecordingHooks = hookManager.has('recordingStarted')
if (hasRecordingHooks) {
console.log('Recording plugin is installed')
enableRecordingUI()
}count()
count(name): number;Defined in: src/plugins/HookManager.ts:1529
Get the number of handlers registered for a hook
Returns the count of handlers registered for the specified hook name. This is the number of handlers that would execute if the hook is triggered (subject to conditions and propagation stopping).
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the hook to count handlers for (e.g., 'beforeCall'). |
Returns
number
The number of handlers registered for the hook. Returns 0 if no handlers are registered or the hook doesn't exist in the registry.
Remarks
Use Cases
Counting hook handlers is useful for:
- Monitoring hook registration
- Generating statistics
- Testing (verify expected number of handlers)
- Debugging (check handler count)
- Performance analysis (identify hooks with many handlers)
Performance
This is a fast O(1) operation:
- Map lookup is O(1)
- Array length property is O(1)
- No iteration required
Examples
console.log('beforeCall handlers:', hookManager.count('beforeCall'))
console.log('callStarted handlers:', hookManager.count('callStarted'))
console.log('callEnded handlers:', hookManager.count('callEnded'))// Register hooks
hookManager.register('testHook', handler1, {}, 'plugin-1')
hookManager.register('testHook', handler2, {}, 'plugin-2')
// Verify count
expect(hookManager.count('testHook')).toBe(2)clear()
clear(): void;Defined in: src/plugins/HookManager.ts:1594
Clear all registered hooks from all plugins
Removes all hook handlers from the registry, effectively resetting the HookManager to its initial empty state. This is a nuclear option that removes all hooks regardless of which plugin registered them. Use with caution as it cannot be undone.
Returns
void
Remarks
Cleanup Process
When this method is called:
- All hook name entries are removed from the map
- All handler references are released for garbage collection
- The hooks map becomes empty
- Hook ID counter is NOT reset (IDs continue from last value)
- Context reference is NOT cleared (remains set)
When to Use
This method is typically used:
- During application shutdown
- When resetting the entire plugin system
- In test cleanup between test cases
- When reinitializing the HookManager
- As part of PluginManager.destroy()
Caution
This operation is destructive and irreversible:
- All registered hooks are permanently removed
- Plugins are not notified (no uninstall callbacks)
- Cannot selectively preserve some hooks
- Consider using unregisterByPlugin() for selective cleanup
Comparison with Other Cleanup Methods
- unregister(id): Remove specific hook by ID (surgical)
- unregisterByPlugin(name): Remove all hooks from a plugin (selective)
- clear(): Remove all hooks from all plugins (this method - nuclear)
Examples
// Application shutdown
console.log('Shutting down, clearing all hooks')
hookManager.clear()
console.log('All hooks cleared')afterEach(() => {
// Clean up hooks after each test
hookManager.clear()
// Ensure clean state for next test
})// Reset entire hook system
hookManager.clear()
console.log('Hook count:', hookManager.getStats().totalHooks) // 0
// Ready to register new hooksgetStats()
getStats(): object;Defined in: src/plugins/HookManager.ts:1691
Get comprehensive statistics about registered hooks
Collects and returns detailed statistics about all registered hooks, including total counts, hook names, total handlers, and breakdown of handlers by plugin. Useful for monitoring, debugging, and displaying hook system health.
Returns
object
An object containing comprehensive hook statistics:
totalHooks: Total number of unique hook names that have handlershookNames: Array of all hook names with registered handlerstotalHandlers: Total count of all registered handlers across all hookshandlersByPlugin: Object mapping plugin names to their handler counts
| Name | Type | Defined in |
|---|---|---|
totalHooks | number | src/plugins/HookManager.ts:1692 |
hookNames | string[] | src/plugins/HookManager.ts:1693 |
totalHandlers | number | src/plugins/HookManager.ts:1694 |
handlersByPlugin | Record<string, number> | src/plugins/HookManager.ts:1695 |
Remarks
Statistics Collection
This method iterates through all hooks and collects:
- Count of unique hook names with handlers
- List of all hook names
- Total count of handlers across all hooks
- Breakdown showing how many handlers each plugin registered
Return Value Structure
{
totalHooks: number, // Unique hook names with handlers
hookNames: string[], // Array of hook names
totalHandlers: number, // Total handler count
handlersByPlugin: { // Handlers per plugin
'plugin-name': number
}
}Use Cases
Statistics are commonly used for:
- Monitoring hook system health
- Debugging hook registration issues
- Generating system reports
- Displaying hook status in admin UI
- Performance analysis
- Testing hook registration
Performance
- Time complexity: O(n * m) where n is hook names, m is average handlers per hook
- Creates new arrays and objects (not cached)
- Safe to call frequently (not resource-intensive for typical loads)
Examples
const stats = hookManager.getStats()
console.log('Hook System Statistics:')
console.log(` Unique hooks: ${stats.totalHooks}`)
console.log(` Total handlers: ${stats.totalHandlers}`)
console.log(` Hook names: ${stats.hookNames.join(', ')}`)
console.log(' Handlers by plugin:')
for (const [plugin, count] of Object.entries(stats.handlersByPlugin)) {
console.log(` ${plugin}: ${count}`)
}function checkHookHealth() {
const stats = hookManager.getStats()
if (stats.totalHandlers === 0) {
console.warn('No hooks registered!')
} else if (stats.totalHandlers > 100) {
console.warn(`High hook count: ${stats.totalHandlers}`)
} else {
console.log(`Hook system healthy: ${stats.totalHandlers} handlers`)
}
}const stats = hookManager.getStats()
const report = {
timestamp: new Date().toISOString(),
hooks: stats.totalHooks,
handlers: stats.totalHandlers,
averageHandlersPerHook: stats.totalHandlers / stats.totalHooks,
plugins: Object.keys(stats.handlersByPlugin).length,
details: stats.handlersByPlugin
}
console.log('Hook System Report:', JSON.stringify(report, null, 2))PluginManager
Defined in: src/plugins/PluginManager.ts:337
PluginManager class
Main manager class that implements centralized plugin lifecycle management for VueSip. Coordinates plugin registration, installation, configuration updates, dependency resolution, version compatibility checking, and integration with the hook system.
Remarks
This class serves as the central registry and orchestrator for all plugins in the VueSip ecosystem. It maintains plugin state, manages the plugin context that provides access to VueSip services, and ensures proper lifecycle transitions from registration through installation to cleanup.
State Management
The PluginManager maintains several internal maps and references:
- plugins: Map of plugin entries indexed by plugin name, containing plugin instance, configuration, state, hook IDs, and error information
- hookManager: HookManager instance for coordinating hook registration and execution
- eventBus: EventBus instance for plugin communication and lifecycle events
- sipClient: Optional SipClient instance (set after SIP initialization)
- mediaManager: Optional MediaManager instance (set during media setup)
- config: Optional SipClientConfig (set during configuration)
- activeCalls: Map of active call sessions (updated as calls are created/destroyed)
Hook System Integration
The PluginManager creates and maintains a bidirectional integration with the HookManager:
- Provides plugins with hook registration interface through their context
- Tracks hook IDs per plugin for automatic cleanup on unregistration
- Updates hook context when VueSip services are set or modified
- Executes hooks on behalf of the application and other plugins
Thread Safety
While JavaScript is single-threaded, async operations can create race conditions:
- Plugin installation and uninstallation are asynchronous
- Multiple plugins can be registered/unregistered concurrently
- The manager does not implement locking mechanisms
- Callers should avoid concurrent operations on the same plugin
See
- register for plugin registration workflow
- unregister for plugin cleanup workflow
- updateConfig for runtime configuration updates
Implements
Constructors
Constructor
new PluginManager(eventBus, version): PluginManager;Defined in: src/plugins/PluginManager.ts:405
Create a new PluginManager instance
Initializes the plugin manager with the provided event bus and application version. Creates the internal hook manager and sets up the initial plugin context.
Parameters
| Parameter | Type | Description |
|---|---|---|
eventBus | EventBus | The event bus instance used for plugin communication and lifecycle events. Plugins receive this in their context and can use it to emit and listen to events. |
version | string | The application version string in semver format (e.g., '1.0.0', '2.5.3'). Used for plugin version compatibility checking via minVersion and maxVersion constraints. |
Returns
Remarks
Initialization Process
The constructor performs the following initialization steps:
- Stores the event bus reference for plugin communication
- Stores the application version for compatibility checking
- Creates a new HookManager instance for hook coordination
- Initializes the hook context with the current state (initially minimal)
Initial State
After construction, the plugin manager has:
- Empty plugin registry (no plugins registered)
- Fresh hook manager (no hooks registered)
- Minimal plugin context (only eventBus, logger, version, and hooks interface)
- No SIP-related services (sipClient, mediaManager, config, activeCalls are null/empty)
Service Availability
VueSip services are set later via setter methods as they become available:
- Use
setSipClient()after SIP initialization - Use
setMediaManager()after media setup - Use
setConfig()after configuration - Use
setActiveCalls()to provide call tracking
Example
import { PluginManager } from './plugins/PluginManager'
import { EventBus } from './core/EventBus'
const eventBus = new EventBus()
const pluginManager = new PluginManager(eventBus, '1.0.0')
// Ready to register pluginsMethods
setSipClient()
setSipClient(sipClient): void;Defined in: src/plugins/PluginManager.ts:464
Set the SIP client instance and update plugin context
Updates the SipClient reference in the plugin context, making it available to all installed plugins through their hook handlers and context access. This method should be called after SIP initialization to provide plugins with access to SIP functionality.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | SipClient | null | The SipClient instance to make available to plugins, or null to remove SIP client access. Pass null during shutdown or when SIP becomes unavailable. |
Returns
void
Remarks
When to Call
This setter should be called:
- After SipClient is successfully initialized during application startup
- Before registering plugins that require SIP functionality
- When SipClient configuration changes (create new instance and set it)
- With null during shutdown to clear the reference
Impact on Plugins
When this method is called:
- The hook manager's context is updated with the new SipClient instance
- All subsequent hook executions receive the updated context
- Plugins can access the SipClient through
context.sipClientin hook handlers - Already-registered hooks automatically see the updated context
Context Update Mechanism
The method calls createContext() to rebuild the plugin context with all current services, ensuring the context remains consistent across all context properties.
Examples
// Initialize SIP client
const sipClient = new SipClient(config)
await sipClient.connect()
// Make it available to plugins
pluginManager.setSipClient(sipClient)
// Plugins can now access sipClient in their hooks// Before destroying SIP client
pluginManager.setSipClient(null)
await sipClient.disconnect()setMediaManager()
setMediaManager(mediaManager): void;Defined in: src/plugins/PluginManager.ts:502
Set the media manager instance and update plugin context
Updates the MediaManager reference in the plugin context, making it available to all installed plugins through their hook handlers and context access. This method should be called after media initialization to provide plugins with access to media functionality.
Parameters
| Parameter | Type | Description |
|---|---|---|
mediaManager | MediaManager | null | The MediaManager instance to make available to plugins, or null to remove media manager access. Pass null during shutdown or when media becomes unavailable. |
Returns
void
Remarks
When to Call
This setter should be called:
- After MediaManager is successfully initialized during application startup
- Before registering plugins that require media functionality (e.g., recording)
- When MediaManager configuration changes (create new instance and set it)
- With null during shutdown to clear the reference
Impact on Plugins
When this method is called:
- The hook manager's context is updated with the new MediaManager instance
- All subsequent hook executions receive the updated context
- Plugins can access the MediaManager through
context.mediaManagerin hook handlers - Enables plugins to access media streams, control devices, and manage media state
Example
const mediaManager = new MediaManager(config)
await mediaManager.initialize()
pluginManager.setMediaManager(mediaManager)
// Plugins can now access media functionalitysetConfig()
setConfig(config): void;Defined in: src/plugins/PluginManager.ts:545
Set the SIP configuration and update plugin context
Updates the SipClientConfig reference in the plugin context, making the current configuration available to all installed plugins. This method should be called when configuration is loaded or updated.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | SipClientConfig | null | The SipClientConfig object containing current SIP settings, or null to remove configuration access. Pass null during shutdown or before configuration is loaded. |
Returns
void
Remarks
When to Call
This setter should be called:
- After loading application configuration during startup
- When configuration is updated at runtime
- Before registering plugins that need to access configuration
- With null during shutdown or configuration reset
Impact on Plugins
When this method is called:
- The hook manager's context is updated with the new configuration
- All subsequent hook executions receive the updated context
- Plugins can access the configuration through
context.configin hook handlers - Enables plugins to adapt their behavior based on configuration settings
Configuration Updates
When configuration changes at runtime:
- Call
setConfig()with the new configuration - Optionally notify affected plugins via events or hook execution
- Plugins see the updated configuration in subsequent hook executions
Example
const config = await loadConfig()
pluginManager.setConfig(config)
// Plugins can now access configurationsetActiveCalls()
setActiveCalls(activeCalls): void;Defined in: src/plugins/PluginManager.ts:597
Set the active calls map and update plugin context
Updates the active calls map reference in the plugin context, making the current call sessions available to all installed plugins. This method should be called to provide plugins with access to active call state.
Parameters
| Parameter | Type | Description |
|---|---|---|
activeCalls | Map<string, CallSession> | Map of active CallSession instances indexed by call ID. This map is typically maintained by the SipClient and updated as calls are created and destroyed. |
Returns
void
Remarks
When to Call
This setter should be called:
- After SipClient initialization to share the active calls map
- Once during setup (the map reference is shared, not copied)
- When replacing the calls map with a new instance (rare)
Impact on Plugins
When this method is called:
- The hook manager's context is updated with the active calls map
- All subsequent hook executions receive the updated context
- Plugins can access active calls through
context.activeCallsin hook handlers - Enables plugins to monitor and interact with ongoing calls
Map Sharing
The active calls map is shared by reference:
- Changes to the map (add/remove calls) are automatically visible to plugins
- No need to call
setActiveCalls()when individual calls are added/removed - Only call this method when replacing the entire map instance
Call Lifecycle Access
Plugins can use the active calls map to:
- Enumerate all active calls
- Access call session details (call ID, state, remote party, etc.)
- Monitor call state changes
- Implement call-related features (recording, analytics, etc.)
Example
const sipClient = new SipClient(config)
await sipClient.connect()
// Share the active calls map with plugins
pluginManager.setActiveCalls(sipClient.getActiveCalls())
// Plugins can now monitor active callsregister()
register<TConfig>(plugin, config?): Promise<void>;Defined in: src/plugins/PluginManager.ts:864
Register and install a plugin in the VueSip system
Validates the plugin, checks compatibility and dependencies, merges configuration, creates a plugin entry, and optionally installs the plugin if enabled. This is the primary method for adding plugins to the VueSip ecosystem.
Type Parameters
| Type Parameter | Default type |
|---|---|
TConfig extends PluginConfig | PluginConfig |
Parameters
| Parameter | Type | Description |
|---|---|---|
plugin | Plugin<TConfig> | The plugin instance to register. Must implement the Plugin interface with metadata, defaultConfig, and install() method. The plugin's metadata.name must be unique across all registered plugins. |
config? | TConfig | Optional configuration to override the plugin's default configuration. This is merged with plugin.defaultConfig, with provided values taking precedence. The enabled property defaults to true if not specified. |
Returns
Promise<void>
A promise that resolves when registration and optional installation complete. If the plugin is enabled (default), the promise resolves after successful installation. If disabled, the promise resolves after registration without installation.
Throws
If a plugin with the same name is already registered
Throws
If the plugin's version requirements are not met by the current VueSip version
Throws
If any of the plugin's dependencies are missing or not installed
Throws
If the plugin's install() method throws an error (when enabled)
Remarks
Registration Workflow
The registration process follows these steps in order:
- Duplicate Check: Verifies no plugin with the same name is already registered
- Version Check: Validates plugin's minVersion and maxVersion against app version
- Dependency Check: Ensures all dependencies are registered and installed
- Config Merge: Combines plugin defaults with provided configuration
- Entry Creation: Creates PluginEntry with initial state of 'Registered'
- Registration: Adds entry to the plugin registry
- Installation: If enabled, calls installPlugin() to complete setup
Plugin Lifecycle State Transitions
State transitions during registration:
- Initial: (not in registry)
- After step 5: Registered (in registry, not yet operational)
- During installation: Installing (if enabled)
- After installation: Installed (operational) or Failed (installation error)
Configuration Merging
Configuration is merged as follows:
finalConfig = {
...plugin.defaultConfig, // Plugin defaults
...config, // Provided overrides
enabled: config?.enabled ?? true // Enabled by default
}Event Emissions
This method may trigger the following events:
plugin:installed: Emitted after successful installation (if enabled)plugin:error: Emitted if installation fails (if enabled)
Error Handling
- Registration errors (duplicate, version, dependencies) are thrown immediately
- Installation errors are caught, plugin state is set to Failed, and error is rethrown
- Even if installation fails, the plugin remains in the registry with Failed state
- Failed plugins can be unregistered and re-registered after fixing issues
Dependency Resolution
Dependencies are specified in plugin.metadata.dependencies as an array of plugin names:
- Dependencies must be registered before the dependent plugin
- Dependencies must be in Installed state (not just Registered)
- Circular dependencies are not detected (avoid them in plugin design)
- Missing or uninstalled dependencies cause registration to fail
Examples
import { createRecordingPlugin } from './plugins/RecordingPlugin'
const recordingPlugin = createRecordingPlugin()
await pluginManager.register(recordingPlugin)
// Plugin installed with default config, auto-enabledawait pluginManager.register(recordingPlugin, {
enabled: true,
autoStart: true,
recordingOptions: {
audio: true,
video: false,
mimeType: 'audio/webm'
}
})// Register but don't install yet
await pluginManager.register(myPlugin, { enabled: false })
// Plugin is registered but not operational
const entry = pluginManager.get('my-plugin')
console.log(entry?.state) // 'Registered'
// Install later via updateConfig
await pluginManager.updateConfig('my-plugin', { enabled: true })try {
await pluginManager.register(myPlugin)
console.log('Plugin registered successfully')
} catch (error) {
if (error.message.includes('already registered')) {
console.error('Plugin name conflict')
} else if (error.message.includes('requires VueSip version')) {
console.error('Version incompatibility')
} else if (error.message.includes('requires plugin')) {
console.error('Missing dependency')
} else {
console.error('Installation failed:', error)
}
}// Register base plugin first
const authPlugin = createAuthPlugin()
await pluginManager.register(authPlugin)
// Register dependent plugin
const analyticsPlugin = createAnalyticsPlugin()
// analyticsPlugin.metadata.dependencies = ['auth']
await pluginManager.register(analyticsPlugin)
// Success - dependency is satisfiedImplementation of
unregister()
unregister(pluginName): Promise<void>;Defined in: src/plugins/PluginManager.ts:1156
Unregister and uninstall a plugin from the VueSip system
Performs complete cleanup of a plugin by calling its uninstall() method (if defined), removing all registered hooks, deleting the plugin entry, and emitting events. This is the primary method for removing plugins from the VueSip ecosystem.
Parameters
| Parameter | Type | Description |
|---|---|---|
pluginName | string | The name of the plugin to unregister. Must be a registered plugin that exists in the plugin registry. |
Returns
Promise<void>
A promise that resolves when unregistration and cleanup are complete. The promise always resolves (cleanup always completes) but may throw after cleanup if the uninstall() method failed.
Throws
If the plugin is not found in the registry
Throws
If the plugin's uninstall() method throws an error (thrown after cleanup)
Remarks
Unregistration Workflow
The cleanup process follows these steps in order:
- Lookup: Retrieves plugin entry from the registry
- State Transition: Sets state to Uninstalling
- Plugin Uninstall: Calls plugin.uninstall(context) if method exists
- Hook Cleanup: Removes all hooks registered by the plugin (always, even if uninstall fails)
- Registry Removal: Deletes plugin entry from the registry (always)
- Event Emission: Emits 'plugin:unregistered' event (always)
- Error Propagation: Rethrows uninstall error if one occurred (after cleanup)
Plugin Lifecycle State Transitions
State changes during unregistration:
- Before: Any state (Registered, Installed, Failed, etc.)
- During: Uninstalling (transient state)
- After: (removed from registry, no longer tracked)
Guaranteed Cleanup
This method uses a try-catch-finally pattern to ensure cleanup always completes:
- Hooks are always removed, even if uninstall() fails
- Plugin is always removed from registry, even if uninstall() fails
- Event is always emitted, even if uninstall() fails
- This prevents orphaned hooks and registry entries
Error Handling Strategy
If the plugin's uninstall() method throws:
- Error is caught and logged
- Cleanup continues in the finally block
- All hooks are removed via hookManager.unregisterByPlugin()
- Plugin entry is deleted from the registry
- 'plugin:unregistered' event is emitted
- Error is rethrown after all cleanup completes
Hook Cleanup Mechanism
Hooks are cleaned up automatically:
- hookManager.unregisterByPlugin(pluginName) removes all hooks for the plugin
- Hook IDs tracked in entry.hookIds are all unregistered
- Prevents orphaned hooks from executing after plugin removal
- Ensures clean separation between plugin lifecycle and hook lifecycle
Optional Uninstall Method
The plugin's uninstall() method is optional:
- Only called if the plugin implements it
- Allows plugins to perform custom cleanup (close connections, clear caches, etc.)
- Receives the same context structure as install()
- Can be async or sync
Event Emissions
This method emits events on the event bus:
plugin:unregistered: Always emitted with- No error event is emitted (uninstall errors are thrown)
Idempotency
This method is NOT idempotent:
- Throws "Plugin not found" if called on an unregistered plugin
- Does not silently ignore missing plugins
- Callers should check with has() before calling if unsure
Examples
// Unregister a plugin
await pluginManager.unregister('recording')
console.log(pluginManager.has('recording')) // falsetry {
await pluginManager.unregister('my-plugin')
console.log('Plugin unregistered successfully')
} catch (error) {
if (error.message.includes('not found')) {
console.error('Plugin was not registered')
} else {
console.error('Plugin cleanup failed:', error)
// Note: Plugin was still removed despite the error
}
}if (pluginManager.has('analytics')) {
await pluginManager.unregister('analytics')
console.log('Analytics plugin removed')
}// Get all plugin names
const pluginNames = Array.from(pluginManager.getAll().keys())
// Unregister each one
for (const name of pluginNames) {
try {
await pluginManager.unregister(name)
} catch (error) {
console.error(`Failed to unregister ${name}:`, error)
}
}Implementation of
get()
get(pluginName):
| PluginEntry<PluginConfig>
| undefined;Defined in: src/plugins/PluginManager.ts:1280
Get a registered plugin entry by name
Retrieves the PluginEntry for a specific plugin, which contains the plugin instance, configuration, state, hook IDs, installation timestamp, and error information (if failed). Returns undefined if the plugin is not registered.
Parameters
| Parameter | Type | Description |
|---|---|---|
pluginName | string | The name of the plugin to retrieve. This is the value from plugin.metadata.name. |
Returns
| PluginEntry<PluginConfig> | undefined
The PluginEntry for the specified plugin if it exists, or undefined if the plugin is not registered. The entry contains:
plugin: The plugin instanceconfig: Current plugin configurationstate: Current lifecycle state (Registered, Installing, Installed, etc.)hookIds: Array of hook IDs registered by this plugininstalledAt: Date when plugin was installed (if in Installed state)error: Error that caused installation failure (if in Failed state)
Remarks
Use Cases
Common reasons to retrieve a plugin entry:
- Check plugin state to see if it's operational
- Access plugin configuration for debugging
- Inspect error information if installation failed
- Verify installation timestamp
- Access the plugin instance to call plugin-specific methods
State Inspection
The returned entry's state property indicates plugin status:
PluginState.Registered: Plugin registered but not yet installedPluginState.Installing: Installation in progressPluginState.Installed: Plugin fully operationalPluginState.Uninstalling: Cleanup in progressPluginState.Failed: Installation failed, see entry.error
Return Value Handling
Always check for undefined before accessing entry properties:
const entry = pluginManager.get('my-plugin')
if (entry) {
// Plugin is registered
console.log(entry.state)
} else {
// Plugin not found
console.log('Plugin not registered')
}Examples
const entry = pluginManager.get('recording')
if (entry?.state === PluginState.Installed) {
console.log('Recording plugin is operational')
} else if (entry?.state === PluginState.Failed) {
console.error('Recording plugin failed:', entry.error)
} else {
console.log('Recording plugin not ready')
}const entry = pluginManager.get('recording')
if (entry) {
console.log('Auto-start:', entry.config.autoStart)
console.log('Max recordings:', entry.config.maxRecordings)
}const entry = pluginManager.get('recording')
if (entry?.state === PluginState.Installed) {
// Cast to specific plugin type to access custom methods
const recordingPlugin = entry.plugin as RecordingPlugin
const recordings = recordingPlugin.getAllRecordings()
}Implementation of
has()
has(pluginName): boolean;Defined in: src/plugins/PluginManager.ts:1337
Check if a plugin is registered
Tests whether a plugin with the specified name exists in the plugin registry. This does not indicate the plugin's state (it may be registered but not installed).
Parameters
| Parameter | Type | Description |
|---|---|---|
pluginName | string | The name of the plugin to check. This is the value from plugin.metadata.name. |
Returns
boolean
True if a plugin with the specified name is registered (in any state), false if no plugin with that name exists in the registry.
Remarks
State Independence
This method only checks for registration, not operational state:
- Returns true for plugins in any state (Registered, Installing, Installed, Failed, etc.)
- Does not indicate whether the plugin is operational
- Use get() and check the state property if you need to verify operational status
Common Patterns
This method is often used for:
- Checking if a plugin name is already taken before registration
- Conditional plugin registration (register only if not already present)
- Conditional plugin unregistration (unregister only if present)
- Feature detection (check if optional plugin is available)
Examples
if (!pluginManager.has('recording')) {
await pluginManager.register(recordingPlugin)
} else {
console.log('Recording plugin already registered')
}if (pluginManager.has('analytics')) {
await pluginManager.unregister('analytics')
}if (pluginManager.has('recording')) {
console.log('Recording feature available')
enableRecordingUI()
} else {
console.log('Recording feature not available')
disableRecordingUI()
}Implementation of
getAll()
getAll(): Map<string, PluginEntry<PluginConfig>>;Defined in: src/plugins/PluginManager.ts:1407
Get all registered plugins
Returns a copy of the plugin registry containing all registered plugins and their entries. The returned map is a shallow copy, so modifications to the map itself do not affect the internal registry.
Returns
Map<string, PluginEntry<PluginConfig>>
A new Map containing all plugin entries, indexed by plugin name. Each entry contains the plugin instance, configuration, state, hook IDs, and other metadata. The map is empty if no plugins are registered.
Remarks
Copy Semantics
This method returns a shallow copy of the internal plugins map:
- The Map itself is a new instance (modifications don't affect the registry)
- The PluginEntry objects are the same references (not deep cloned)
- Safe to iterate or modify the returned map without affecting the registry
- Modifications to entries themselves would affect the registry
Iteration Patterns
The returned map can be iterated in several ways:
for (const [name, entry] of map)- Iterate over entriesmap.keys()- Get all plugin namesmap.values()- Get all plugin entriesmap.entries()- Get name-entry pairs
Use Cases
Common reasons to get all plugins:
- Display plugin status in UI or admin panel
- Generate plugin statistics or reports
- Iterate over plugins to perform batch operations
- Export plugin configuration
- Debug plugin state during development
Examples
const plugins = pluginManager.getAll()
console.log(`Total plugins: ${plugins.size}`)
for (const [name, entry] of plugins) {
console.log(`${name}: ${entry.state}`)
}const allPlugins = pluginManager.getAll()
const installedPlugins = Array.from(allPlugins.values())
.filter(entry => entry.state === PluginState.Installed)
console.log(`Operational plugins: ${installedPlugins.length}`)const plugins = pluginManager.getAll()
const report = Array.from(plugins.entries()).map(([name, entry]) => ({
name,
version: entry.plugin.metadata.version,
state: entry.state,
installedAt: entry.installedAt?.toISOString(),
error: entry.error?.message
}))
console.table(report)Implementation of
updateConfig()
updateConfig<TConfig>(pluginName, config): Promise<void>;Defined in: src/plugins/PluginManager.ts:1513
Update a plugin's configuration at runtime
Merges the provided configuration with the plugin's existing configuration and optionally calls the plugin's updateConfig() method if implemented. This allows plugins to adapt their behavior dynamically based on configuration changes.
Type Parameters
| Type Parameter | Default type |
|---|---|
TConfig extends PluginConfig | PluginConfig |
Parameters
| Parameter | Type | Description |
|---|---|---|
pluginName | string | The name of the plugin to configure. Must be a registered plugin that exists in the plugin registry. |
config | TConfig | Partial or complete configuration object to merge with existing config. Properties not specified retain their current values. The configuration is shallow merged. |
Returns
Promise<void>
A promise that resolves when the configuration update completes. If the plugin implements updateConfig(), the promise resolves after that method completes.
Throws
If the plugin is not found in the registry
Throws
If the plugin's updateConfig() method throws an error
Remarks
Update Workflow
The configuration update process follows these steps:
- Lookup: Retrieves plugin entry from the registry
- Config Merge: Shallow merges new config with existing config
- Plugin Notification: Calls plugin.updateConfig(context, config) if method exists
- Logging: Logs the configuration update
- Event Emission: Emits 'plugin:configUpdated' event
Configuration Merging
Configuration is merged using object spread:
entry.config = { ...entry.config, ...config }- Provided properties override existing values
- Missing properties retain current values
- Nested objects are not deep merged (shallow merge only)
Plugin Notification
If the plugin implements the optional updateConfig() method:
- The method is called with the plugin context and merged configuration
- The plugin can react to configuration changes (restart services, update state, etc.)
- The method can be async or sync
- Any errors thrown are propagated to the caller
Event Emissions
This method emits events on the event bus:
plugin:configUpdated: Always emitted with- Other plugins can listen for this event to react to configuration changes
State Independence
This method works regardless of plugin state:
- Can update configuration of Registered, Installed, or Failed plugins
- For Registered plugins, config is updated but plugin is not installed
- For Installed plugins, plugin.updateConfig() is called if implemented
- For Failed plugins, config is updated but plugin remains Failed
Common Use Cases
Configuration updates are commonly used for:
- Enabling or disabling plugin features at runtime
- Adjusting plugin parameters without restart
- Toggling auto-start behavior
- Updating thresholds or limits
- Changing plugin behavior based on user preferences
Examples
// Toggle auto-recording feature
await pluginManager.updateConfig('recording', {
autoStart: true
})
// Only the autoStart property is updated, other config unchangedawait pluginManager.updateConfig('recording', {
autoStart: false,
maxRecordings: 100,
storeInIndexedDB: true
})try {
await pluginManager.updateConfig('my-plugin', { enabled: true })
} catch (error) {
if (error.message.includes('not found')) {
console.error('Plugin not registered')
} else {
console.error('Plugin rejected configuration:', error)
}
}eventBus.on('plugin:configUpdated', ({ pluginName, config }) => {
console.log(`Plugin ${pluginName} config updated:`, config)
// React to configuration changes
})Implementation of
executeHook()
executeHook<TData, TReturn>(name, data?): Promise<TReturn[]>;Defined in: src/plugins/PluginManager.ts:1623
Execute all registered handlers for a specific hook
Delegates to the HookManager to execute all handlers registered for the specified hook name. Handlers are executed in the order they were registered, and their results are collected and returned as an array.
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | unknown |
TReturn | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the hook to execute. This corresponds to the hook names defined in the HookName type (e.g., 'beforeCall', 'callStarted', 'callEnded', etc.). |
data? | TData | Optional data to pass to all hook handlers. The data structure should match the expected input type for the specific hook. Each handler receives the same data object. |
Returns
Promise<TReturn[]>
A promise that resolves to an array of results returned by all hook handlers. The array maintains the same order as handler registration. If no handlers are registered for the hook, returns an empty array. Handlers that don't return a value contribute undefined to the results array.
Remarks
Hook Execution Flow
When this method is called:
- HookManager looks up all handlers registered for the hook name
- Handlers are executed sequentially in registration order
- Each handler receives the provided data and the plugin context
- Results from all handlers are collected into an array
- The results array is returned to the caller
Handler Context
Each hook handler is executed with:
- The data parameter passed to this method
- The current plugin context (with all VueSip services)
- Access to the logger, event bus, and other context properties
Error Handling
Hook execution behavior depends on HookManager configuration:
- Errors in handlers may be caught or propagated (see HookManager docs)
- Failed handlers may stop execution or allow continuation
- Check HookManager documentation for specific error handling behavior
Use Cases
This method is typically used by:
- VueSip core to notify plugins of lifecycle events
- Application code to trigger custom hooks
- Plugins to execute hooks for cross-plugin communication
Type Parameters
TData: The type of data passed to hook handlersTReturn: The type of value returned by hook handlers
Examples
// Notify all plugins that a call started
const results = await pluginManager.executeHook('callStarted', {
callId: 'call-123',
remoteParty: 'alice@example.com',
direction: 'incoming'
})
console.log(`${results.length} handlers executed`)// Execute a hook that doesn't require data
await pluginManager.executeHook('applicationReady')// Execute a hook and process results
const results = await pluginManager.executeHook('beforeCall', {
targetUri: 'bob@example.com'
})
// Check if any handler rejected the call
const rejected = results.some(result => result?.reject === true)
if (rejected) {
console.log('Call rejected by plugin')
return
}getHookManager()
getHookManager(): HookManager;Defined in: src/plugins/PluginManager.ts:1675
Get the HookManager instance
Returns the internal HookManager instance used by this PluginManager. This provides direct access to advanced hook management functionality not exposed through the PluginManager interface.
Returns
The HookManager instance used by this PluginManager for coordinating hook registration, execution, and lifecycle management.
Remarks
Use Cases
Direct access to HookManager is useful for:
- Advanced hook management operations
- Accessing hook statistics and debugging information
- Direct hook manipulation (use with caution)
- Integration with other systems that work with HookManager
Caution
Direct manipulation of the HookManager bypasses PluginManager's tracking:
- Hooks registered directly won't be tracked in plugin entries
- Hooks won't be automatically cleaned up on plugin unregistration
- Prefer using the plugin context's hooks interface for normal use cases
Typical Usage
Most applications don't need direct HookManager access:
- Plugins register hooks through their context
- Application code executes hooks via executeHook()
- Only advanced scenarios require direct HookManager access
Examples
const hookManager = pluginManager.getHookManager()
const stats = hookManager.getStats()
console.log('Total hooks:', stats.totalHooks)
console.log('Hooks by name:', stats.hooksByName)const hookManager = pluginManager.getHookManager()
// Perform advanced operations (use with caution)
// Most use cases should use plugin context insteaddestroy()
destroy(): Promise<void>;Defined in: src/plugins/PluginManager.ts:2029
Destroy the plugin manager and clean up all resources
Performs complete cleanup by unregistering all plugins, clearing all hooks, and freeing all resources. This method should be called during application shutdown to ensure proper cleanup and prevent resource leaks.
Returns
Promise<void>
A promise that resolves when all plugins have been unregistered and all resources have been cleaned up. The promise always resolves, even if some plugins fail to unregister.
Remarks
Destruction Process
The cleanup process follows these steps:
- Collect Plugin Names: Gets array of all registered plugin names
- Unregister Plugins: Iterates through plugins and unregisters each one
- Error Handling: Logs errors but continues with remaining plugins
- Clear Hooks: Calls hookManager.clear() to remove all hooks
- Logging: Logs completion of destruction
Plugin Unregistration
For each registered plugin:
- Calls unregister() which triggers plugin's uninstall() method
- Removes all hooks registered by the plugin
- Deletes the plugin entry from the registry
- Continues even if individual plugins fail to unregister
Error Handling Strategy
This method is designed to always complete:
- Errors during plugin unregistration are caught and logged
- Failed unregistrations don't prevent cleanup of other plugins
- Hook cleanup proceeds even if all plugins fail
- Promise always resolves (never rejects)
- Ensures cleanup can complete during emergency shutdown
Hook Cleanup
After unregistering all plugins:
- Calls hookManager.clear() to remove any remaining hooks
- Removes hooks that weren't properly cleaned up by plugins
- Ensures complete hook cleanup even if plugins left orphaned hooks
- Resets hook manager to initial state
State After Destruction
After this method completes:
- All plugins are unregistered (plugins Map is empty)
- All hooks are removed (HookManager is cleared)
- PluginManager instance can still be used (not truly destroyed)
- New plugins can be registered (PluginManager is reusable)
- VueSip service references remain (sipClient, mediaManager, etc.)
Reusability
The PluginManager can be reused after destruction:
- The instance remains valid
- New plugins can be registered
- Hook system is reset and ready for new hooks
- Consider creating a new instance instead if full reset is needed
Typical Usage
This method is typically called:
- During application shutdown
- When reinitializing the plugin system
- In test cleanup to ensure clean state
- Before destroying the entire VueSip instance
Examples
// During application shutdown
await pluginManager.destroy()
console.log('All plugins cleaned up')
// Safe to destroy other VueSip components// Shutdown with timeout fallback
const destroyPromise = pluginManager.destroy()
const timeoutPromise = new Promise(resolve =>
setTimeout(() => {
console.warn('Plugin cleanup timed out')
resolve()
}, 5000)
)
await Promise.race([destroyPromise, timeoutPromise])afterEach(async () => {
// Clean up plugins after each test
await pluginManager.destroy()
})Implementation of
getStats()
getStats(): object;Defined in: src/plugins/PluginManager.ts:2171
Get comprehensive statistics about registered plugins and hooks
Collects and returns detailed statistics about all registered plugins, including counts by state and hook statistics from the HookManager. Useful for monitoring, debugging, and displaying plugin system health.
Returns
object
An object containing comprehensive plugin statistics:
totalPlugins: Total number of registered plugins (all states)installedPlugins: Number of plugins in Installed state (operational)failedPlugins: Number of plugins in Failed state (non-operational)pluginsByState: Breakdown of plugin counts by each PluginStatehookStats: Hook statistics from HookManager (total hooks, hooks by name, etc.)
| Name | Type | Defined in |
|---|---|---|
totalPlugins | number | src/plugins/PluginManager.ts:2172 |
installedPlugins | number | src/plugins/PluginManager.ts:2173 |
failedPlugins | number | src/plugins/PluginManager.ts:2174 |
pluginsByState | Record<PluginState, number> | src/plugins/PluginManager.ts:2175 |
hookStats | object | src/plugins/PluginManager.ts:2176 |
hookStats.totalHooks | number | src/plugins/HookManager.ts:1692 |
hookStats.hookNames | string[] | src/plugins/HookManager.ts:1693 |
hookStats.totalHandlers | number | src/plugins/HookManager.ts:1694 |
hookStats.handlersByPlugin | Record<string, number> | src/plugins/HookManager.ts:1695 |
Remarks
Statistics Collection
This method iterates through all registered plugins and collects:
- Total count of plugins
- Count of installed (operational) plugins
- Count of failed (error) plugins
- Count of plugins in each lifecycle state
- Hook statistics from the HookManager
Plugin State Breakdown
The pluginsByState object contains counts for each PluginState:
Registered: Plugins registered but not installedInstalling: Plugins currently being installed (usually 0)Installed: Plugins fully operationalUninstalling: Plugins currently being uninstalled (usually 0)Failed: Plugins that failed installation
Hook Statistics
The hookStats object is obtained from HookManager.getStats() and typically includes:
- Total number of registered hooks
- Breakdown of hooks by hook name
- Other hook system metrics
- See HookManager documentation for complete details
Performance Considerations
This method iterates through all plugins:
- O(n) complexity where n is the number of registered plugins
- Creates new objects for state counts (not cached)
- Safe to call frequently (not resource-intensive)
- Consider caching results if called very frequently
Use Cases
Statistics are commonly used for:
- Displaying plugin status in admin UI
- Monitoring plugin system health
- Debugging plugin issues
- Generating system reports
- Logging system state during startup/shutdown
- Automated testing and verification
Return Value Structure
{
totalPlugins: number,
installedPlugins: number,
failedPlugins: number,
pluginsByState: {
Registered: number,
Installing: number,
Installed: number,
Uninstalling: number,
Failed: number
},
hookStats: {
totalHooks: number,
hooksByName: { [hookName: string]: number },
// ... other hook stats
}
}Examples
const stats = pluginManager.getStats()
console.log(`Total plugins: ${stats.totalPlugins}`)
console.log(`Operational: ${stats.installedPlugins}`)
console.log(`Failed: ${stats.failedPlugins}`)
console.log('State breakdown:', stats.pluginsByState)
console.log('Total hooks:', stats.hookStats.totalHooks)const stats = pluginManager.getStats()
if (stats.failedPlugins > 0) {
console.warn(`${stats.failedPlugins} plugin(s) failed to install`)
// Investigate failed plugins
const allPlugins = pluginManager.getAll()
for (const [name, entry] of allPlugins) {
if (entry.state === PluginState.Failed) {
console.error(`Plugin ${name} failed:`, entry.error)
}
}
}const stats = pluginManager.getStats()
console.log('Plugin System Status Report')
console.log('===========================')
console.log(`Total Plugins: ${stats.totalPlugins}`)
console.log(`Installed: ${stats.installedPlugins}`)
console.log(`Failed: ${stats.failedPlugins}`)
console.log(`Registered: ${stats.pluginsByState.Registered}`)
console.log(`Total Hooks: ${stats.hookStats.totalHooks}`)// Periodic health monitoring
setInterval(() => {
const stats = pluginManager.getStats()
if (stats.failedPlugins > 0 || stats.installedPlugins === 0) {
console.warn('Plugin system health check failed:', stats)
}
}, 60000) // Every minuteRecordingPlugin
Defined in: src/plugins/RecordingPlugin.ts:263
RecordingPlugin class
Main plugin class that implements the Plugin interface for VueSip. Manages recording lifecycle, storage, and integration with the event system.
Remarks
This class is the core implementation of the recording functionality. It maintains state for active recordings, handles MediaRecorder lifecycle, manages IndexedDB storage, and provides memory management utilities.
See
- createRecordingPlugin for the factory function to create instances
- DEFAULT_CONFIG for available configuration options
Implements
Constructors
Constructor
new RecordingPlugin(): RecordingPlugin;Returns
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
metadata | object | undefined | Plugin metadata | src/plugins/RecordingPlugin.ts:265 |
metadata.name | string | 'recording' | - | src/plugins/RecordingPlugin.ts:266 |
metadata.version | string | '1.0.0' | - | src/plugins/RecordingPlugin.ts:267 |
metadata.description | string | 'Call recording plugin with MediaRecorder support' | - | src/plugins/RecordingPlugin.ts:268 |
metadata.author | string | 'VueSip' | - | src/plugins/RecordingPlugin.ts:269 |
metadata.license | string | 'MIT' | - | src/plugins/RecordingPlugin.ts:270 |
defaultConfig | Required<RecordingPluginConfig> | DEFAULT_CONFIG | Default configuration | src/plugins/RecordingPlugin.ts:274 |
Methods
install()
install(context, config?): Promise<void>;Defined in: src/plugins/RecordingPlugin.ts:388
Install the recording plugin into VueSip
Initializes the recording plugin by verifying MediaRecorder API support, setting up IndexedDB storage (if enabled), and registering event listeners for automatic recording lifecycle management. This method must be called before any recording operations can be performed.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | PluginContext | The plugin context provided by VueSip's plugin manager, containing the event bus and other runtime information needed for plugin integration |
config? | RecordingPluginConfig | Optional configuration object to override default settings. All properties are optional and will be merged with DEFAULT_CONFIG. Common options include: - enabled: Whether recording is enabled (default: true) - autoStart: Automatically start recording when calls begin (default: false) - recordingOptions: MediaRecorder options (audio, video, mimeType, bitrates) - storeInIndexedDB: Persist recordings to IndexedDB (default: true) - maxRecordings: Maximum recordings to keep in storage (default: 50) - onRecordingStart, onRecordingStop, onRecordingError: Lifecycle callbacks |
Returns
Promise<void>
A promise that resolves when installation is complete, including IndexedDB initialization if storage is enabled
Throws
If MediaRecorder API is not supported in the current browser environment
Throws
If IndexedDB initialization fails (when storeInIndexedDB is enabled)
Remarks
Installation Process
- Merges provided config with default configuration
- Validates MediaRecorder API availability in the browser
- Initializes IndexedDB database and object stores (if enabled)
- Registers event listeners for 'callStarted' and 'callEnded' events
Event Listeners
When autoStart is enabled, the plugin listens for:
callStarted: Automatically begins recording the call's media streamcallEnded: Automatically stops and saves the recording
Storage Behavior
If storeInIndexedDB is enabled:
- Creates database with name from
dbNameconfig (default: 'vuesip-recordings') - Creates 'recordings' object store with indexes on 'callId' and 'startTime'
- Enables persistent storage across browser sessions
- Implements automatic quota management with retry logic
Memory Management
The plugin automatically:
- Clears recording blobs from memory after saving to IndexedDB
- Deletes oldest recordings when
maxRecordingslimit is reached (ifautoDeleteOldis true) - Prevents memory leaks by revoking object URLs and clearing blob references
Examples
const plugin = createRecordingPlugin()
await plugin.install(context)
// Plugin ready with default configurationconst plugin = createRecordingPlugin()
await plugin.install(context, {
enabled: true,
autoStart: true,
recordingOptions: {
audio: true,
video: true,
mimeType: 'video/webm;codecs=vp9,opus',
audioBitsPerSecond: 128000,
videoBitsPerSecond: 2500000
},
storeInIndexedDB: true,
maxRecordings: 100,
onRecordingStop: (recording) => {
console.log(`Recording completed: ${recording.id}`)
console.log(`Duration: ${recording.duration}ms`)
console.log(`Size: ${recording.blob?.size} bytes`)
}
})const plugin = createRecordingPlugin()
try {
await plugin.install(context, { storeInIndexedDB: true })
console.log('Recording plugin installed successfully')
} catch (error) {
if (error.message.includes('MediaRecorder')) {
console.error('Browser does not support recording')
} else if (error.message.includes('IndexedDB')) {
console.error('Failed to initialize storage')
}
}Implementation of
uninstall()
uninstall(_context): Promise<void>;Defined in: src/plugins/RecordingPlugin.ts:481
Uninstall the recording plugin from VueSip
Performs complete cleanup of the plugin by stopping all active recordings, clearing memory, closing database connections, and removing event listeners. This method ensures no resources are leaked and the plugin can be safely removed from the application.
Parameters
| Parameter | Type | Description |
|---|---|---|
_context | PluginContext | The plugin context (unused, but required by Plugin interface) |
Returns
Promise<void>
A promise that resolves when uninstallation is complete and all cleanup has finished
Remarks
Cleanup Process
The uninstall operation performs the following steps in sequence:
- Stop Active Recordings: Stops all recordings currently in progress for any active calls
- Clear Memory: Removes all recording blobs from memory to free up heap space
- Clear Recordings Map: Removes all recording metadata from the in-memory map
- Close Database: Closes the IndexedDB connection (recordings remain persisted)
- Remove Event Listeners: Unregisters all event listeners to prevent memory leaks
Side Effects
- All active recordings are stopped and finalized
- Recording blobs are cleared from memory (but IndexedDB data persists)
- All event listeners are removed from the event bus
- IndexedDB connection is closed (database and data remain, but connection is terminated)
- Plugin cannot be used until reinstalled via
install()
Data Persistence
Important: Recordings stored in IndexedDB are NOT deleted during uninstall. Only the in-memory data and active connections are cleared. To delete persisted recordings, use indexedDB.deleteDatabase(dbName) after uninstalling.
Error Handling
If any recording fails to stop during cleanup, the error is logged but does not prevent the uninstall process from completing. This ensures the plugin can always be uninstalled even if individual recordings are in error states.
Examples
await plugin.uninstall(context)
console.log('Recording plugin uninstalled')// Check active recordings before uninstall
const activeCount = plugin.getAllRecordings().length
console.log(`${activeCount} recordings active before uninstall`)
await plugin.uninstall(context)
// Verify cleanup
const memoryUsage = plugin.getMemoryUsage()
console.log(`Memory usage after uninstall: ${memoryUsage} bytes`) // Should be 0// Uninstall plugin
await plugin.uninstall(context)
// Delete database to remove all persisted recordings
// Note: Use the same database name that was used during plugin initialization
await new Promise((resolve, reject) => {
const request = indexedDB.deleteDatabase('vuesip-recordings')
request.onsuccess = resolve
request.onerror = reject
})
console.log('Plugin uninstalled and all recordings deleted')Implementation of
updateConfig()
updateConfig(_context, config): Promise<void>;Defined in: src/plugins/RecordingPlugin.ts:620
Update the plugin configuration at runtime
Merges the provided configuration changes with the existing configuration, allowing dynamic updates to plugin behavior without requiring reinstallation. Configuration changes take effect immediately and apply to all subsequent operations.
Parameters
| Parameter | Type | Description |
|---|---|---|
_context | PluginContext | The plugin context (unused, but required by Plugin interface) |
config | RecordingPluginConfig | Partial configuration object with properties to update. All properties are optional. Only the properties included in this object will be changed; other settings remain unchanged. Can update: - enabled: Enable/disable recording functionality - autoStart: Change automatic recording behavior - recordingOptions: Update default MediaRecorder settings - storeInIndexedDB: Toggle IndexedDB storage (note: doesn't initialize/close DB connection) - maxRecordings: Change storage limit - autoDeleteOld: Toggle automatic cleanup - onRecordingStart, onRecordingStop, onRecordingError: Update lifecycle callbacks |
Returns
Promise<void>
A promise that resolves when the configuration update is complete
Remarks
Immediate Effect
Configuration changes take effect immediately:
- New recordings will use updated
recordingOptions - Event listeners respect updated
autoStartsetting (already registered listeners remain) - Callbacks use updated functions immediately
- Storage operations use updated
maxRecordingslimit
Active Recordings
Configuration updates do not affect recordings that are already in progress:
- Active recordings continue with their original options
- Recording state is not changed by configuration updates
- Stopping and restarting is required to apply new options to a specific call
Event Listeners
Important: Updating autoStart does not automatically register or unregister event listeners. Event listeners are only registered during install(). To change auto-start behavior:
- Call
uninstall()to remove existing listeners - Update configuration
- Call
install()with new configuration
Alternatively, update config before initial installation.
Storage Limitations
- Changing
storeInIndexedDBdoes not initialize or close the database connection - Changing
dbNamehas no effect after installation (database already opened) - To change storage settings, uninstall and reinstall the plugin
Partial Updates
The configuration is merged, not replaced:
// Only updates audioBitsPerSecond, other recordingOptions unchanged
await plugin.updateConfig(context, {
recordingOptions: { audioBitsPerSecond: 192000 }
})Examples
// Increase audio quality for future recordings
await plugin.updateConfig(context, {
recordingOptions: {
audioBitsPerSecond: 192000, // Increase from default 128000
mimeType: 'audio/webm;codecs=opus'
}
})// Increase maximum stored recordings
await plugin.updateConfig(context, {
maxRecordings: 100, // Increase from default 50
autoDeleteOld: true // Ensure old recordings are cleaned up
})// Add custom callback for recording completion
await plugin.updateConfig(context, {
onRecordingStop: (recording) => {
console.log(`Recording ${recording.id} completed`)
// Upload to server
uploadRecording(recording)
},
onRecordingError: (error) => {
console.error('Recording failed:', error)
// Send error to monitoring service
reportError(error)
}
})// Temporarily disable recording
await plugin.updateConfig(context, { enabled: false })
// Re-enable later
await plugin.updateConfig(context, { enabled: true })Implementation of
startRecording()
startRecording(
callId,
stream,
options?): Promise<string>;Defined in: src/plugins/RecordingPlugin.ts:972
Start recording a call's media stream
Initiates recording of the provided MediaStream using the MediaRecorder API. Creates a new recording instance, configures the MediaRecorder with the specified or default options, and begins capturing audio/video data. The recording is associated with the call ID and can be controlled via pause/resume/stop methods.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId | string | Unique identifier for the call being recorded. Must be unique across active recordings. This ID is used to control the recording (pause, resume, stop) and to associate the recording with call metadata. Typically matches the SIP call ID or session identifier. |
stream | MediaStream | MediaStream to record, containing audio and/or video tracks. Must be an active MediaStream with at least one track. Typically obtained from: - navigator.mediaDevices.getUserMedia() for local media - RTCPeerConnection.getLocalStreams() for local RTC streams - Call event data (callStarted event provides the stream) |
options? | RecordingOptions | Optional recording options that override the default configuration for this specific recording. Supports partial overrides; unspecified options use defaults. Available options: - audio (boolean): Include audio tracks (default: true) - video (boolean): Include video tracks (default: false) - mimeType (string): Preferred MIME type, with automatic fallback to supported types - audioBitsPerSecond (number): Audio encoding bitrate in bps (default: 128000) - videoBitsPerSecond (number): Video encoding bitrate in bps (only if video enabled) - timeslice (number): Milliseconds between dataavailable events (optional) |
Returns
Promise<string>
A promise that resolves to a unique recording ID (string). This ID can be used to:
- Retrieve recording data via
getRecording(recordingId) - Download the recording via
downloadRecording(recordingId) - Identify the recording in lifecycle callbacks The recording ID format is 'recording-{uuid}' or 'recording-{timestamp}-{random}'
Throws
If a recording is already active for the specified callId
Throws
If no supported MIME type can be found for the requested recording options
Remarks
Recording Process
- Validation: Checks if call is already being recorded
- Configuration: Merges provided options with default configuration
- MIME Type Selection: Determines best supported MIME type with automatic fallback
- MediaRecorder Creation: Initializes MediaRecorder with stream and options
- Event Handlers: Sets up handlers for data collection and lifecycle events
- Recording Start: Begins capturing media data
MIME Type Fallback
If the requested MIME type is not supported, the plugin automatically tries alternatives:
- Audio: webm, webm;codecs=opus, ogg;codecs=opus, mp4
- Video: webm, webm;codecs=vp8,opus, webm;codecs=vp9,opus, mp4
Data Collection
Recording data is collected in chunks and stored in memory until the recording is stopped:
- Data chunks are accumulated in the
ondataavailableevent - When stopped, chunks are combined into a single Blob
- If
storeInIndexedDBis enabled, the Blob is saved and then cleared from memory
Memory Management
- Blobs are kept in memory only until saved to IndexedDB
- After saving, blobs are automatically cleared to prevent memory leaks
- Use
getMemoryUsage()to monitor in-memory recording size - Use
clearOldRecordingsFromMemory()to manually free memory
Storage Behavior
When storeInIndexedDB is enabled:
- Recording is saved to IndexedDB when stopped
- Blob is cleared from memory after successful save
- If quota is exceeded, oldest recordings are deleted and save is retried
- If
autoDeleteOldis true, oldest recordings are deleted whenmaxRecordingsis exceeded
State Transitions
Recording state progresses through these stages:
- 'starting': MediaRecorder created, not yet started
- 'recording': Actively capturing media data
- 'paused': Temporarily suspended (via
pauseRecording()) - 'stopped': Finalized, blob created
- 'failed': Error occurred during recording
Lifecycle Callbacks
The following callbacks are invoked during recording:
onRecordingStart: Called when recording begins (state: 'recording')onRecordingStop: Called when recording completes (includes blob and duration)onRecordingError: Called if MediaRecorder encounters an error
Examples
const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
const recordingId = await plugin.startRecording('call-123', stream)
console.log(`Recording started with ID: ${recordingId}`)const stream = await navigator.mediaDevices.getUserMedia({
audio: true,
video: true
})
const recordingId = await plugin.startRecording('call-456', stream, {
video: true,
mimeType: 'video/webm;codecs=vp9,opus',
videoBitsPerSecond: 2500000,
audioBitsPerSecond: 128000
})const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
const recordingId = await plugin.startRecording('call-789', stream, {
timeslice: 1000 // Emit data every second
})
// Data will be available in chunks via ondataavailable eventstry {
const recordingId = await plugin.startRecording(callId, stream)
console.log('Recording started successfully')
} catch (error) {
if (error.message.includes('Already recording')) {
console.error('Call is already being recorded')
// Stop existing recording first
await plugin.stopRecording(callId)
} else if (error.message.includes('MIME type')) {
console.error('Browser does not support recording format')
}
}eventBus.on('callStarted', async (data) => {
const { callId, stream } = data
try {
const recordingId = await plugin.startRecording(callId, stream, {
audio: true,
video: false,
audioBitsPerSecond: 192000 // High quality audio
})
console.log(`Auto-recording started: ${recordingId}`)
} catch (error) {
console.error('Failed to start auto-recording:', error)
}
})stopRecording()
stopRecording(callId): Promise<void>;Defined in: src/plugins/RecordingPlugin.ts:1215
Stop recording a call and finalize the recording
Stops the active MediaRecorder for the specified call, triggering the finalization process where all accumulated data chunks are combined into a Blob, duration is calculated, and the recording is optionally saved to IndexedDB. After stopping, the recording cannot be resumed and the MediaRecorder instance is removed from the active recordings map.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId | string | Unique identifier of the call to stop recording. Must match the callId used when starting the recording via startRecording(). This is the same ID used for pause/resume operations. |
Returns
Promise<void>
A promise that resolves when the stop operation has been initiated. Note: The promise resolves immediately after calling recorder.stop(), but actual finalization (blob creation, storage) happens asynchronously via the MediaRecorder's onstop event handler. Use the onRecordingStop callback to be notified when finalization is complete.
Throws
If no active recording exists for the specified callId. This can happen if:
- No recording was started for this call
- The recording was already stopped
- The wrong callId was provided
Remarks
Stop Process
- Validation: Verifies an active MediaRecorder exists for the call
- State Check: Only stops if MediaRecorder is not already 'inactive'
- Stop Signal: Calls
recorder.stop()to trigger finalization - Cleanup: Removes recorder from activeRecordings map
- Async Finalization: MediaRecorder's
onstophandler processes the recording
Asynchronous Finalization
The actual finalization happens asynchronously in the onstop event handler:
- All data chunks are combined into a single Blob
- End time and duration are calculated
- Recording state changes to 'stopped'
- Blob is validated (must have size > 0)
- If
storeInIndexedDBis enabled, recording is saved to database - Blob is cleared from memory after successful save
onRecordingStopcallback is invoked with complete recording data
Storage Behavior
When storeInIndexedDB is enabled:
- Recording is automatically saved to IndexedDB in the
onstophandler - If quota is exceeded, oldest recordings are deleted and save is retried
- After successful save, blob is cleared from memory to prevent leaks
- If save fails,
onRecordingErrorcallback is invoked and state becomes 'failed' - If
autoDeleteOldis true, oldest recordings may be deleted to stay withinmaxRecordingslimit
Memory Management
- Blob remains in memory until saved to IndexedDB
- After save, blob is automatically cleared via
clearRecordingBlob() - Recording metadata remains in
recordingsmap for retrieval - To manually free memory, use
clearOldRecordingsFromMemory()
Empty Recording Validation
If the recording has no data (blob size is 0):
- Recording state is set to 'failed'
- Recording is not saved to IndexedDB
onRecordingErrorcallback is invoked with error- Warning is logged but no exception is thrown
State Transitions
When stop is called:
- MediaRecorder state changes from 'recording' or 'paused' to 'inactive'
- Recording state changes to 'stopped' in the
onstophandler - If error occurs, state becomes 'failed'
Callback Invocation
After finalization completes, onRecordingStop is called with RecordingData containing:
id: Recording IDcallId: Associated call IDstartTime: When recording startedendTime: When recording stoppedduration: Total duration in millisecondsmimeType: MIME type of the recordingstate: 'stopped' or 'failed'blob: Recording blob (if not yet cleared)
Examples
try {
await plugin.stopRecording('call-123')
console.log('Recording stopped')
} catch (error) {
console.error('No active recording for this call')
}// Configure callback before stopping
await plugin.updateConfig(context, {
onRecordingStop: (recording) => {
console.log(`Recording ${recording.id} completed`)
console.log(`Duration: ${recording.duration}ms`)
console.log(`Size: ${recording.blob?.size || 'saved to IndexedDB'} bytes`)
}
})
// Stop will trigger the callback when finalization completes
await plugin.stopRecording(callId)const recordings = plugin.getAllRecordings()
const activeCallIds = new Set(
recordings
.filter(r => r.state === 'recording' || r.state === 'paused')
.map(r => r.callId)
)
for (const callId of activeCallIds) {
try {
await plugin.stopRecording(callId)
} catch (error) {
console.error(`Failed to stop recording for ${callId}:`, error)
}
}// Store the recording ID before stopping
const recording = plugin.getAllRecordings()
.find(r => r.callId === callId && r.state === 'recording')
if (recording) {
await plugin.stopRecording(callId)
// Recording is now finalized and ready to download
// The stopRecording() promise resolves after finalization is complete
plugin.downloadRecording(recording.id)
}pauseRecording()
pauseRecording(callId): void;Defined in: src/plugins/RecordingPlugin.ts:1362
Pause an active recording
Temporarily suspends recording of media data for the specified call. The MediaRecorder enters the 'paused' state and stops capturing data, but the recording session remains active and can be resumed later. The recording duration includes paused time unless you track pause/resume timestamps separately.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId | string | Unique identifier of the call to pause recording. Must match the callId used when starting the recording via startRecording(). The recording must be in the 'recording' state (not already paused, stopped, or failed). |
Returns
void
Throws
If no active recording exists for the specified callId. This can happen if:
- No recording was started for this call
- The recording was already stopped
- The wrong callId was provided
Remarks
Pause Behavior
- Only pauses if MediaRecorder is in 'recording' state
- If already paused, logs a debug message and returns without error
- If in other states (inactive, etc.), logs a warning but does not throw
- Does not affect the recording ID or accumulated data
- Can be resumed with
resumeRecording(callId)
State Validation
The method checks MediaRecorder state before pausing:
- 'recording': Pause is executed successfully
- 'paused': Logs debug message, no action taken (idempotent)
- 'inactive' or other: Logs warning, no action taken
Important: This method only affects the MediaRecorder state (recording/paused/inactive). The RecordingData.state property does NOT change during pause/resume operations. RecordingData.state only tracks the recording lifecycle: starting → recording → stopped/failed. To check if a recording is paused, you must access the MediaRecorder instance directly (which is not exposed by the public API).
Duration Tracking
Important: The recorded duration calculated when stopping includes paused time. If you need to track active recording time only, you must implement separate pause/resume timestamp tracking in your application.
Data Capture
While paused:
- No new data chunks are captured
- Previously captured chunks remain in memory
- The stream continues to flow but is not recorded
- Resuming continues capturing from the current stream position
Use Cases
- Pause recording during sensitive conversation parts
- Temporarily suspend during call hold
- Reduce file size by skipping non-essential audio
- Implement manual recording control in UI
Pause/Resume vs Stop/Start
- Pause/Resume: Same recording session, single output file
- Stop/Start: Creates two separate recordings with different IDs
Examples
try {
plugin.pauseRecording('call-123')
console.log('Recording paused')
} catch (error) {
console.error('Failed to pause:', error)
}const pauseButton = document.getElementById('pause')
const resumeButton = document.getElementById('resume')
pauseButton.addEventListener('click', () => {
try {
plugin.pauseRecording(callId)
pauseButton.disabled = true
resumeButton.disabled = false
} catch (error) {
console.error('Cannot pause recording:', error)
}
})
resumeButton.addEventListener('click', () => {
try {
plugin.resumeRecording(callId)
pauseButton.disabled = false
resumeButton.disabled = true
} catch (error) {
console.error('Cannot resume recording:', error)
}
})eventBus.on('callHold', (data) => {
const { callId } = data
try {
plugin.pauseRecording(callId)
console.log('Recording paused during hold')
} catch (error) {
// Recording might not exist if autoStart is disabled
console.log('No active recording to pause')
}
})
eventBus.on('callUnhold', (data) => {
const { callId } = data
try {
plugin.resumeRecording(callId)
console.log('Recording resumed after hold')
} catch (error) {
console.log('No paused recording to resume')
}
})const recording = plugin.getAllRecordings()
.find(r => r.callId === callId)
if (recording && recording.state === 'recording') {
plugin.pauseRecording(callId)
console.log('Recording paused')
} else if (recording && recording.state === 'paused') {
console.log('Recording is already paused')
} else {
console.log('No active recording to pause')
}resumeRecording()
resumeRecording(callId): void;Defined in: src/plugins/RecordingPlugin.ts:1541
Resume a paused recording
Resumes recording of media data for a previously paused call. The MediaRecorder transitions from 'paused' state back to 'recording' state and continues capturing data from the current stream position. All data is accumulated into the same recording session and will be combined into a single Blob when stopped.
Parameters
| Parameter | Type | Description |
|---|---|---|
callId | string | Unique identifier of the call to resume recording. Must match the callId used when starting the recording via startRecording(). The recording must be in the 'paused' state (not recording, stopped, or failed). |
Returns
void
Throws
If no active recording exists for the specified callId. This can happen if:
- No recording was started for this call
- The recording was already stopped
- The wrong callId was provided
Remarks
Resume Behavior
- Only resumes if MediaRecorder is in 'paused' state
- If already recording, logs a debug message and returns without error
- If in other states (inactive, etc.), logs a warning but does not throw
- Continues using the same recording ID and accumulated data
- Data captured after resume is appended to the same recording
State Validation
The method checks MediaRecorder state before resuming:
- 'paused': Resume is executed successfully
- 'recording': Logs debug message, no action taken (idempotent)
- 'inactive' or other: Logs warning, no action taken
Important: This method only affects the MediaRecorder state (recording/paused/inactive). The RecordingData.state property does NOT change during pause/resume operations. RecordingData.state only tracks the recording lifecycle: starting → recording → stopped/failed. To check if a recording is paused, you must access the MediaRecorder instance directly (which is not exposed by the public API).
Data Continuity
After resuming:
- New data chunks are appended to existing chunks array
- All chunks are combined into a single Blob when stopped
- No gap or marker is inserted in the recording to indicate pause/resume
- The final recording plays continuously without pauses
Duration Calculation
When the recording is stopped:
- Duration includes both recording time and paused time
- Duration is calculated as:
endTime - startTime - To track only active recording time, implement custom timestamp tracking
Use Cases
- Resume recording after call is taken off hold
- Continue recording after pausing for sensitive information
- Implement toggle recording control in UI
- Resume after temporary interruption
Idempotency
Calling resumeRecording() on an already recording session is safe:
- No error is thrown
- Debug message is logged
- Recording continues normally
Examples
try {
plugin.resumeRecording('call-123')
console.log('Recording resumed')
} catch (error) {
console.error('Failed to resume:', error)
}const callId = 'call-123'
// Start recording
await plugin.startRecording(callId, stream)
// Later: pause recording
plugin.pauseRecording(callId)
console.log('Recording paused')
// Even later: resume recording
plugin.resumeRecording(callId)
console.log('Recording resumed')
// Finally: stop and get complete recording
await plugin.stopRecording(callId)const recording = plugin.getAllRecordings()
.find(r => r.callId === callId)
if (recording) {
if (recording.state === 'paused') {
plugin.resumeRecording(callId)
console.log('Recording resumed')
} else if (recording.state === 'recording') {
console.log('Recording is already active')
} else {
console.log('Cannot resume recording in state:', recording.state)
}
} else {
console.log('No recording found for this call')
}function toggleRecording(callId: string) {
const recording = plugin.getAllRecordings()
.find(r => r.callId === callId)
if (!recording) {
console.log('No active recording')
return
}
try {
if (recording.state === 'recording') {
plugin.pauseRecording(callId)
console.log('Paused')
} else if (recording.state === 'paused') {
plugin.resumeRecording(callId)
console.log('Resumed')
}
} catch (error) {
console.error('Failed to toggle recording:', error)
}
}eventBus.on('callUnhold', (data) => {
const { callId } = data
try {
// Check if recording exists and is paused
const recording = plugin.getAllRecordings()
.find(r => r.callId === callId)
if (!recording) {
console.log('No recording to resume - may not have been started')
return
}
if (recording.state === 'paused') {
plugin.resumeRecording(callId)
console.log('Recording resumed after call unhold')
} else {
console.log(`Recording is in ${recording.state} state, not paused`)
}
} catch (error) {
console.error('Failed to resume recording:', error)
}
})getRecording()
getRecording(recordingId): RecordingData | undefined;Defined in: src/plugins/RecordingPlugin.ts:1702
Retrieve recording data by ID
Fetches the recording metadata and blob (if still in memory) for a specific recording. This method returns the in-memory representation of the recording, which may or may not include the blob depending on whether it has been saved to IndexedDB and cleared from memory.
Parameters
| Parameter | Type | Description |
|---|---|---|
recordingId | string | Unique identifier of the recording to retrieve. This is the ID returned by startRecording() or found in the id property of RecordingData objects. Format is typically 'recording-{uuid}' or 'recording-{timestamp}-{random}'. |
Returns
RecordingData | undefined
The RecordingData object if found, containing:
id: Recording unique identifiercallId: Associated call identifierstartTime: When recording started (Date object)endTime: When recording stopped (Date object, undefined if still recording)duration: Total duration in milliseconds (undefined if still recording)mimeType: MIME type of the recordingstate: Current state ('starting', 'recording', 'paused', 'stopped', 'failed')blob: Recording blob (may be undefined if saved to IndexedDB and cleared from memory)
Returns undefined if no recording exists with the specified ID.
Remarks
In-Memory Storage
This method only returns data from the in-memory recordings Map:
- Recordings are added to the map when
startRecording()is called - Metadata remains in memory throughout the plugin's lifecycle
- Blob may be cleared from memory after saving to IndexedDB
- Recordings are removed from memory only when plugin is uninstalled
Blob Availability
The blob property may be undefined in several scenarios:
- Recording is still in progress (blob created only when stopped)
- Recording was saved to IndexedDB and blob was cleared from memory
- Recording failed and no blob was created
To access a blob that was cleared from memory:
- Query IndexedDB directly using the recording ID
- Retrieve the full RecordingData with blob from IndexedDB
State Information
The returned RecordingData includes the current state:
- 'starting': MediaRecorder created but not yet started
- 'recording': Actively capturing data
- 'paused': Temporarily suspended
- 'stopped': Completed successfully
- 'failed': Encountered an error
Use Cases
- Check if a recording exists before attempting operations
- Retrieve recording metadata (duration, start time, etc.)
- Access recording blob for immediate playback
- Verify recording state before pause/resume/stop
- Get recording details for UI display
Performance
- O(1) lookup in Map
- No IndexedDB access required
- Returns immediately with in-memory data
Examples
const recording = plugin.getRecording('recording-123')
if (recording) {
console.log(`Recording state: ${recording.state}`)
console.log(`Duration: ${recording.duration}ms`)
console.log(`Has blob: ${recording.blob !== undefined}`)
} else {
console.log('Recording not found')
}const recordingId = 'recording-456'
const recording = plugin.getRecording(recordingId)
if (!recording) {
console.error('Recording not found')
} else if (recording.state !== 'stopped') {
console.error('Recording is not complete')
} else if (!recording.blob) {
console.error('Recording blob was cleared from memory')
console.log('Retrieve from IndexedDB instead')
} else {
plugin.downloadRecording(recordingId)
}const recording = plugin.getRecording(recordingId)
if (recording) {
const element = document.getElementById('recording-info')
element.innerHTML = `
<div>Call ID: ${recording.callId}</div>
<div>Started: ${recording.startTime.toLocaleString()}</div>
<div>State: ${recording.state}</div>
<div>Duration: ${recording.duration || 'In progress'}ms</div>
<div>Size: ${recording.blob?.size || 'In IndexedDB'} bytes</div>
`
}const recordingId = 'recording-789'
let recording = plugin.getRecording(recordingId)
if (!recording || !recording.blob) {
console.log('Recording not in memory, fetching from IndexedDB...')
// Retrieve from IndexedDB
const db = await openDatabase('vuesip-recordings')
const transaction = db.transaction(['recordings'], 'readonly')
const store = transaction.objectStore('recordings')
const request = store.get(recordingId)
request.onsuccess = () => {
recording = request.result
if (recording) {
console.log('Retrieved from IndexedDB')
console.log(`Blob size: ${recording.blob.size} bytes`)
}
}
}const callId = 'call-123'
// Get all recordings and find by call ID
const recording = plugin.getAllRecordings()
.find(r => r.callId === callId)
if (recording) {
// Now get full data by recording ID
const fullRecording = plugin.getRecording(recording.id)
console.log('Found recording:', fullRecording)
}getAllRecordings()
getAllRecordings(): RecordingData[];Defined in: src/plugins/RecordingPlugin.ts:1856
Retrieve all recordings from memory
Returns an array of all recording metadata and blobs currently stored in memory. This includes recordings in all states (starting, recording, paused, stopped, failed). The returned array is a snapshot of the in-memory recordings map and does not include recordings that exist only in IndexedDB.
Returns
An array of RecordingData objects, one for each recording in memory. Each object contains:
id: Recording unique identifiercallId: Associated call identifierstartTime: When recording started (Date object)endTime: When recording stopped (Date object, undefined if still recording)duration: Total duration in milliseconds (undefined if still recording)mimeType: MIME type of the recordingstate: Current state ('starting', 'recording', 'paused', 'stopped', 'failed')blob: Recording blob (may be undefined if saved to IndexedDB and cleared from memory)
Returns an empty array if no recordings exist in memory.
Remarks
Data Source
This method returns data from the in-memory recordings Map only:
- Does not query IndexedDB (even if
storeInIndexedDBis enabled) - Only includes recordings from the current session
- Recordings are added when
startRecording()is called - Recordings remain in memory until
uninstall()is called - Blobs may be cleared from memory while metadata remains
Array Ordering
- No specific ordering is guaranteed
- Order depends on Map iteration order (typically insertion order)
- For chronological ordering, sort by
startTimeproperty - For state-based filtering, filter the returned array
Memory vs Storage
The returned recordings may differ from IndexedDB contents:
- Memory: Current session recordings with possible blob clearing
- IndexedDB: Persistent storage across sessions, always includes blobs
- Use this method for current session monitoring
- Query IndexedDB directly for persistent recording history
Performance
- O(n) conversion from Map values to Array
- No database queries, returns immediately
- Memory usage proportional to number of recordings
- Large blob arrays can impact performance
Use Cases
- List all recordings in UI
- Find recordings by call ID
- Calculate total memory usage
- Filter recordings by state
- Get active recording count
- Monitor recording session health
Examples
const recordings = plugin.getAllRecordings()
console.log(`Total recordings in memory: ${recordings.length}`)
recordings.forEach(recording => {
console.log(`${recording.id}: ${recording.state}`)
})const activeRecordings = plugin.getAllRecordings()
.filter(r => r.state === 'recording' || r.state === 'paused')
console.log(`Active recordings: ${activeRecordings.length}`)const sortedRecordings = plugin.getAllRecordings()
.sort((a, b) => a.startTime.getTime() - b.startTime.getTime())
console.log('Recordings in chronological order:')
sortedRecordings.forEach(r => {
console.log(`${r.id}: Started ${r.startTime.toISOString()}`)
})const callId = 'call-123'
const callRecordings = plugin.getAllRecordings()
.filter(r => r.callId === callId)
if (callRecordings.length > 0) {
console.log(`Found ${callRecordings.length} recordings for call ${callId}`)
callRecordings.forEach(r => {
console.log(` ${r.id}: ${r.state}, duration: ${r.duration}ms`)
})
}const recordings = plugin.getAllRecordings()
const totalSize = recordings.reduce((sum, r) => {
return sum + (r.blob?.size || 0)
}, 0)
const totalDuration = recordings.reduce((sum, r) => {
return sum + (r.duration || 0)
}, 0)
console.log(`Total size: ${(totalSize / 1024 / 1024).toFixed(2)} MB`)
console.log(`Total duration: ${(totalDuration / 1000).toFixed(2)} seconds`)const recordings = plugin.getAllRecordings()
const tableBody = document.getElementById('recordings-table')
tableBody.innerHTML = recordings.map(r => `
<tr>
<td>${r.callId}</td>
<td>${r.startTime.toLocaleString()}</td>
<td>${r.state}</td>
<td>${r.duration ? (r.duration / 1000).toFixed(1) + 's' : 'N/A'}</td>
<td>${r.blob ? (r.blob.size / 1024).toFixed(1) + ' KB' : 'In DB'}</td>
</tr>
`).join('')const recordings = plugin.getAllRecordings()
const stats = {
total: recordings.length,
recording: recordings.filter(r => r.state === 'recording').length,
paused: recordings.filter(r => r.state === 'paused').length,
stopped: recordings.filter(r => r.state === 'stopped').length,
failed: recordings.filter(r => r.state === 'failed').length,
withBlob: recordings.filter(r => r.blob !== undefined).length
}
console.log('Recording Statistics:', stats)
if (stats.failed > 0) {
console.warn(`${stats.failed} recordings have failed`)
}getMemoryUsage()
getMemoryUsage(): number;Defined in: src/plugins/RecordingPlugin.ts:2085
Calculate total memory usage of recording blobs
Computes the total size in bytes of all recording blobs currently stored in memory. This only includes blobs that haven't been cleared after saving to IndexedDB. Useful for monitoring memory consumption and determining when to clear old recordings from memory.
Returns
number
The total size in bytes of all recording blobs in memory. Returns 0 if:
- No recordings exist
- All recordings have had their blobs cleared
- Recordings are still in progress (blobs not yet created)
The returned value represents actual blob data size, not metadata overhead.
Remarks
Calculation Method
- Iterates through all recordings in the
recordingsMap - Sums the
sizeproperty of each blob that exists - Skips recordings where
blobis undefined - Returns the total in bytes (not KB or MB)
What's Included
Only counts blob data size:
- Recording blob data (audio/video content)
- Only blobs still in memory (not cleared)
- Does not include metadata overhead
- Does not include Map/object structure overhead
- Does not include IndexedDB storage
What's Not Included
- Recording metadata (id, callId, startTime, etc.)
- JavaScript object overhead
- Map data structure overhead
- MediaRecorder instances
- Blobs already cleared from memory
- Recordings stored only in IndexedDB
Memory Management Context
This method is useful for:
- Monitoring memory consumption in real-time
- Triggering cleanup when memory usage is high
- Displaying memory usage in UI
- Determining when to clear old recordings
- Debugging memory leaks
Blob Lifecycle
Blob memory lifecycle:
- Created when recording stops (chunks combined into blob)
- Stays in memory for immediate access
- Saved to IndexedDB (if enabled)
- Cleared from memory via
clearRecordingBlob() - Can be retrieved from IndexedDB when needed
Performance
- O(n) iteration through all recordings
- Fast operation (just summing numbers)
- No IndexedDB access
- No blob data copying
Examples
const memoryUsage = plugin.getMemoryUsage()
console.log(`Memory usage: ${(memoryUsage / 1024 / 1024).toFixed(2)} MB`)const MAX_MEMORY_MB = 100
const memoryUsage = plugin.getMemoryUsage()
const memoryMB = memoryUsage / 1024 / 1024
if (memoryMB > MAX_MEMORY_MB) {
console.warn(`Memory usage (${memoryMB.toFixed(2)} MB) exceeds limit`)
// Clear recordings older than 1 hour
const cleared = plugin.clearOldRecordingsFromMemory(3600000)
console.log(`Cleared ${cleared} recordings from memory`)
const newMemoryUsage = plugin.getMemoryUsage()
console.log(`New memory usage: ${(newMemoryUsage / 1024 / 1024).toFixed(2)} MB`)
}function updateMemoryDisplay() {
const bytes = plugin.getMemoryUsage()
const mb = (bytes / 1024 / 1024).toFixed(2)
const element = document.getElementById('memory-usage')
element.textContent = `Memory: ${mb} MB`
// Change color based on usage
if (bytes > 100 * 1024 * 1024) { // > 100 MB
element.className = 'high-memory'
} else if (bytes > 50 * 1024 * 1024) { // > 50 MB
element.className = 'medium-memory'
} else {
element.className = 'low-memory'
}
}
// Update every 5 seconds
setInterval(updateMemoryDisplay, 5000)const beforeCleanup = plugin.getMemoryUsage()
console.log(`Before cleanup: ${(beforeCleanup / 1024 / 1024).toFixed(2)} MB`)
// Clear recordings older than 30 minutes
const cleared = plugin.clearOldRecordingsFromMemory(30 * 60 * 1000)
const afterCleanup = plugin.getMemoryUsage()
console.log(`After cleanup: ${(afterCleanup / 1024 / 1024).toFixed(2)} MB`)
console.log(`Freed: ${((beforeCleanup - afterCleanup) / 1024 / 1024).toFixed(2)} MB`)
console.log(`Recordings cleared: ${cleared}`)const recordings = plugin.getAllRecordings()
const totalMemory = plugin.getMemoryUsage()
console.log('Memory usage per recording:')
recordings.forEach(r => {
const size = r.blob?.size || 0
const percentage = totalMemory > 0 ? (size / totalMemory * 100).toFixed(1) : 0
console.log(`${r.id}: ${(size / 1024).toFixed(1)} KB (${percentage}%)`)
})setInterval(() => {
const memoryUsage = plugin.getMemoryUsage()
const recordingCount = plugin.getAllRecordings().length
const avgSize = recordingCount > 0 ? memoryUsage / recordingCount : 0
console.log('Memory Stats:', {
totalMB: (memoryUsage / 1024 / 1024).toFixed(2),
recordings: recordingCount,
avgSizeKB: (avgSize / 1024).toFixed(2)
})
}, 30000) // Every 30 secondsclearOldRecordingsFromMemory()
clearOldRecordingsFromMemory(maxAge): number;Defined in: src/plugins/RecordingPlugin.ts:2267
Clear recording blobs from memory based on age
Removes recording blobs from memory for recordings older than the specified age. This helps manage memory usage by freeing up heap space for old recordings while preserving their metadata. The recordings remain accessible in IndexedDB (if storage is enabled) and their metadata stays in memory for reference.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
maxAge | number | 3600000 | Maximum age in milliseconds. Recordings with startTime older than (current time - maxAge) will have their blobs cleared from memory. Defaults to 3600000 (1 hour). Common values: - 300000 (5 minutes) - 1800000 (30 minutes) - 3600000 (1 hour, default) - 7200000 (2 hours) - 86400000 (24 hours) |
Returns
number
The number of recording blobs that were cleared from memory. Returns 0 if:
- No recordings exist
- No recordings are older than maxAge
- All old recordings already had their blobs cleared
Remarks
Clearing Behavior
For each recording older than maxAge:
- Blob is cleared from memory if it exists
- Recording metadata remains in the
recordingsMap - Recording can still be accessed via
getRecording()andgetAllRecordings() - Recording blob can be retrieved from IndexedDB if storage is enabled
What's Preserved
- All recording metadata (id, callId, startTime, endTime, duration, state, mimeType)
- IndexedDB storage (blobs remain persisted)
- Ability to query and filter recordings
- Recording state and status information
What's Cleared
- Only the in-memory blob reference
- Memory occupied by the blob data
- Ability to immediately access blob without IndexedDB query
Age Calculation
Age is calculated from the recording's startTime:
age = Date.now() - recording.startTime.getTime()
if (age > maxAge && recording.blob exists) {
clearRecordingBlob(recordingId)
cleared++
}Use Cases
- Prevent memory leaks in long-running applications
- Free memory when usage exceeds threshold
- Implement periodic memory cleanup
- Clear memory after recordings are uploaded to server
- Manage memory in memory-constrained environments
When to Call
- Periodically via setInterval (e.g., every 15 minutes)
- When memory usage exceeds threshold (check with
getMemoryUsage()) - After uploading recordings to external storage
- Before starting new recordings to free space
- On application idle events
Automatic Clearing
Note: The plugin automatically clears blobs after saving to IndexedDB. This method is for additional manual cleanup of recordings that:
- Were saved but not automatically cleared
- You want to remove from memory earlier than automatic clearing
- Need to be cleared due to memory pressure
IndexedDB Retrieval
After clearing, blobs can be retrieved from IndexedDB:
const db = await openDatabase('vuesip-recordings')
const recording = await getFromDB(db, 'recordings', recordingId)
// recording.blob contains the blob from IndexedDBExamples
const cleared = plugin.clearOldRecordingsFromMemory()
console.log(`Cleared ${cleared} recordings from memory`)const thirtyMinutes = 30 * 60 * 1000
const cleared = plugin.clearOldRecordingsFromMemory(thirtyMinutes)
console.log(`Cleared ${cleared} recordings older than 30 minutes`)// Clear recordings older than 1 hour, every 15 minutes
setInterval(() => {
const oneHour = 60 * 60 * 1000
const cleared = plugin.clearOldRecordingsFromMemory(oneHour)
if (cleared > 0) {
console.log(`Periodic cleanup: Cleared ${cleared} recordings`)
const memoryUsage = plugin.getMemoryUsage()
console.log(`Current memory usage: ${(memoryUsage / 1024 / 1024).toFixed(2)} MB`)
}
}, 15 * 60 * 1000)const MAX_MEMORY_MB = 100
function checkMemoryAndCleanup() {
const memoryUsage = plugin.getMemoryUsage()
const memoryMB = memoryUsage / 1024 / 1024
if (memoryMB > MAX_MEMORY_MB) {
console.warn(`Memory usage (${memoryMB.toFixed(2)} MB) exceeds ${MAX_MEMORY_MB} MB`)
// Try clearing recordings older than 5 minutes
let cleared = plugin.clearOldRecordingsFromMemory(5 * 60 * 1000)
console.log(`Cleared ${cleared} recordings (5+ min old)`)
// If still over limit, clear recordings older than 1 minute
if (plugin.getMemoryUsage() / 1024 / 1024 > MAX_MEMORY_MB) {
cleared = plugin.clearOldRecordingsFromMemory(60 * 1000)
console.log(`Cleared ${cleared} additional recordings (1+ min old)`)
}
}
}async function uploadAndClear() {
const recordings = plugin.getAllRecordings()
.filter(r => r.state === 'stopped' && r.blob)
for (const recording of recordings) {
if (recording.blob) {
// Upload to server
await uploadRecording(recording)
console.log(`Uploaded recording ${recording.id}`)
}
}
// Clear all uploaded recordings from memory (age 0)
const cleared = plugin.clearOldRecordingsFromMemory(0)
console.log(`Cleared ${cleared} uploaded recordings from memory`)
}const beforeMemory = plugin.getMemoryUsage()
const beforeCount = plugin.getAllRecordings()
.filter(r => r.blob !== undefined).length
const cleared = plugin.clearOldRecordingsFromMemory(3600000)
const afterMemory = plugin.getMemoryUsage()
const afterCount = plugin.getAllRecordings()
.filter(r => r.blob !== undefined).length
console.log('Cleanup Report:')
console.log(` Recordings cleared: ${cleared}`)
console.log(` Blobs before: ${beforeCount}`)
console.log(` Blobs after: ${afterCount}`)
console.log(` Memory before: ${(beforeMemory / 1024 / 1024).toFixed(2)} MB`)
console.log(` Memory after: ${(afterMemory / 1024 / 1024).toFixed(2)} MB`)
console.log(` Memory freed: ${((beforeMemory - afterMemory) / 1024 / 1024).toFixed(2)} MB`)downloadRecording()
downloadRecording(recordingId, filename?): void;Defined in: src/plugins/RecordingPlugin.ts:3062
Download a recording to the user's device
Creates a download link and triggers the browser's download mechanism to save the recording blob to the user's local filesystem. This method creates a temporary object URL, programmatically clicks a download link, and then cleans up the URL to prevent memory leaks. The recording must have a blob available in memory to be downloaded.
Parameters
| Parameter | Type | Description |
|---|---|---|
recordingId | string | Unique identifier of the recording to download. This must be a valid recording ID from a completed recording. The recording must: - Exist in the recordings Map - Have a blob available (not cleared from memory) - Be in a stopped state (recommended, but not enforced) |
filename? | string | Optional custom filename for the downloaded file. If not provided, a default filename is generated using the pattern: recording-{callId}-{timestamp}.{extension} where extension is determined from the recording's MIME type (e.g., .webm, .mp4, .ogg). Custom filenames should include the appropriate file extension. |
Returns
void
Throws
If the recording is not found in memory
Throws
If the recording has no blob (was cleared from memory or never created)
Throws
If running in non-browser environment without DOM access
Remarks
Download Process
- Validation: Verifies recording exists and has a blob
- Environment Check: Ensures DOM access (document and body exist)
- URL Creation: Creates temporary object URL for the blob
- Link Creation: Creates temporary anchor element with download attribute
- Download Trigger: Programmatically clicks the link to initiate download
- Cleanup: Removes anchor element and revokes object URL
Browser Behavior
The download behavior depends on the browser:
- Most browsers: Opens "Save As" dialog or saves to default download folder
- Some browsers: May prompt for location
- Mobile browsers: May have different download behaviors
- File location: Determined by browser's download settings
Filename Generation
If no filename is provided, the default format is:
recording-{callId}-{startTime}.webmExample: recording-call-123-1699564800000.webm
The filename extension is always .webm regardless of the actual MIME type of the recording. If you need a different extension, provide a custom filename parameter.
Memory Requirements
- Recording blob must be in memory (not cleared)
- If blob was cleared after IndexedDB save, you must retrieve the recording from IndexedDB and download it manually using standard browser APIs (createObjectURL, etc.)
- Best practice: Call
downloadRecording()before the blob is cleared from memory
Security Considerations
- Creates temporary object URL that is immediately revoked
- Anchor element is created, used, and removed from DOM
- No persistent references to blob URLs
- Safe from memory leaks if cleanup executes properly
Browser Compatibility
Requires:
- DOM access (
documentanddocument.body) URL.createObjectURL()support- HTML5 anchor download attribute support
- Works in all modern browsers
- Not supported in Node.js or non-browser environments
Use Cases
- Allow users to save recordings locally
- Download for backup before clearing from memory
- Export recordings for external processing
- Save recordings before uploading to server (as backup)
- Provide download option in recording management UI
Examples
try {
plugin.downloadRecording('recording-123')
console.log('Download initiated')
} catch (error) {
console.error('Download failed:', error)
}const recordingId = 'recording-456'
const filename = 'important-call-2024-01-15.webm'
try {
plugin.downloadRecording(recordingId, filename)
console.log(`Download started: ${filename}`)
} catch (error) {
console.error('Failed to download:', error)
}const recordingId = 'recording-789'
const recording = plugin.getRecording(recordingId)
if (!recording) {
console.error('Recording not found')
} else if (!recording.blob) {
console.error('Recording blob not in memory')
console.log('Retrieve from IndexedDB first')
} else if (recording.state !== 'stopped') {
console.warn('Recording is not complete yet')
console.log('Download anyway? The file may be incomplete')
} else {
plugin.downloadRecording(recordingId, 'my-recording.webm')
console.log('Download initiated')
}const recordings = plugin.getAllRecordings()
.filter(r => r.state === 'stopped' && r.blob)
recordings.forEach((recording, index) => {
const filename = `recording-${index + 1}-${recording.callId}.webm`
try {
plugin.downloadRecording(recording.id, filename)
console.log(`Downloaded: ${filename}`)
} catch (error) {
console.error(`Failed to download ${recording.id}:`, error)
}
})function setupDownloadButton(recordingId: string) {
const button = document.getElementById('download-btn')
const recording = plugin.getRecording(recordingId)
if (recording && recording.blob) {
button.disabled = false
button.onclick = () => {
try {
const date = recording.startTime.toISOString().split('T')[0]
const filename = `call-${recording.callId}-${date}.webm`
plugin.downloadRecording(recordingId, filename)
console.log('Download initiated')
} catch (error) {
alert('Download failed: ' + error.message)
}
}
} else {
button.disabled = true
button.title = 'Recording not available for download'
}
}async function downloadFromStorage(recordingId: string) {
// Check if blob is in memory
let recording = plugin.getRecording(recordingId)
if (recording && recording.blob) {
// Blob available, download directly
plugin.downloadRecording(recordingId)
return
}
// Blob not in memory, retrieve from IndexedDB and download manually
console.log('Retrieving from IndexedDB...')
const db = await new Promise<IDBDatabase>((resolve, reject) => {
const request = indexedDB.open('vuesip-recordings', 1)
request.onsuccess = () => resolve(request.result)
request.onerror = () => reject(request.error)
})
const transaction = db.transaction(['recordings'], 'readonly')
const store = transaction.objectStore('recordings')
const request = store.get(recordingId)
request.onsuccess = () => {
const storedRecording = request.result
if (storedRecording && storedRecording.blob) {
// Download manually using browser APIs
const url = URL.createObjectURL(storedRecording.blob)
const a = document.createElement('a')
a.href = url
a.download = `recording-${storedRecording.callId}-${storedRecording.startTime}.webm`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
} else {
console.error('Recording not found in IndexedDB')
}
}
request.onerror = () => {
console.error('Failed to retrieve from IndexedDB:', request.error)
}
}IndexedDBAdapter
Defined in: src/storage/IndexedDBAdapter.ts:48
IndexedDB adapter implementation
Uses browser's IndexedDB API for storing structured data. Particularly useful for storing call history and other large datasets.
Example
const adapter = new IndexedDBAdapter({
prefix: 'vuesip',
version: '1'
})
await adapter.initialize()
// Store call history
await adapter.set('call:123', {
id: '123',
remoteUri: 'sip:user@example.com',
duration: 120
})
// Retrieve call
const result = await adapter.get('call:123')Implements
Constructors
Constructor
new IndexedDBAdapter(config): IndexedDBAdapter;Defined in: src/storage/IndexedDBAdapter.ts:61
Create a new IndexedDB adapter
Parameters
| Parameter | Type | Description |
|---|---|---|
config | StorageConfig | Storage configuration |
Returns
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "IndexedDBAdapter" | 'IndexedDBAdapter' | Adapter name (for debugging) | src/storage/IndexedDBAdapter.ts:49 |
Methods
initialize()
initialize(): Promise<void>;Defined in: src/storage/IndexedDBAdapter.ts:89
Initialize the database Creates the database and object store if they don't exist
Returns
Promise<void>
Promise that resolves when initialization is complete
get()
get<T>(key): Promise<StorageResult<T>>;Defined in: src/storage/IndexedDBAdapter.ts:151
Get a value from storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<T>>
Promise resolving to the value or undefined if not found
Implementation of
set()
set<T>(key, value): Promise<StorageResult<void>>;Defined in: src/storage/IndexedDBAdapter.ts:205
Set a value in storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | T | Value to store |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
remove()
remove(key): Promise<StorageResult<void>>;Defined in: src/storage/IndexedDBAdapter.ts:254
Remove a value from storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
clear()
clear(prefix?): Promise<StorageResult<void>>;Defined in: src/storage/IndexedDBAdapter.ts:303
Clear all values from storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
has()
has(key): Promise<boolean>;Defined in: src/storage/IndexedDBAdapter.ts:385
Check if a key exists in storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<boolean>
Promise resolving to true if key exists
Implementation of
keys()
keys(prefix?): Promise<string[]>;Defined in: src/storage/IndexedDBAdapter.ts:421
Get all keys in storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<string[]>
Promise resolving to array of keys
Implementation of
close()
close(): Promise<void>;Defined in: src/storage/IndexedDBAdapter.ts:463
Close the database connection
Returns
Promise<void>
deleteDatabase()
deleteDatabase(): Promise<void>;Defined in: src/storage/IndexedDBAdapter.ts:476
Delete the entire database WARNING: This will delete all data!
Returns
Promise<void>
LocalStorageAdapter
Defined in: src/storage/LocalStorageAdapter.ts:50
LocalStorage adapter implementation
Uses browser's localStorage API with automatic JSON serialization and optional encryption support.
Example
const adapter = new LocalStorageAdapter({
prefix: 'vuesip',
version: '1'
})
// Store data
await adapter.set('user:preferences', { theme: 'dark' })
// Retrieve data
const result = await adapter.get('user:preferences')
if (result.success) {
console.log(result.data)
}Implements
Constructors
Constructor
new LocalStorageAdapter(config, encryptionPassword?): LocalStorageAdapter;Defined in: src/storage/LocalStorageAdapter.ts:60
Create a new LocalStorage adapter
Parameters
| Parameter | Type | Description |
|---|---|---|
config | StorageConfig | Storage configuration |
encryptionPassword? | string | Optional password for encrypting sensitive data |
Returns
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "LocalStorageAdapter" | 'LocalStorageAdapter' | Adapter name (for debugging) | src/storage/LocalStorageAdapter.ts:51 |
Methods
get()
get<T>(key): Promise<StorageResult<T>>;Defined in: src/storage/LocalStorageAdapter.ts:120
Get a value from storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<T>>
Promise resolving to the value or null if not found
Implementation of
set()
set<T>(key, value): Promise<StorageResult<void>>;Defined in: src/storage/LocalStorageAdapter.ts:191
Set a value in storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | T | Value to store |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
remove()
remove(key): Promise<StorageResult<void>>;Defined in: src/storage/LocalStorageAdapter.ts:244
Remove a value from storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
clear()
clear(prefix?): Promise<StorageResult<void>>;Defined in: src/storage/LocalStorageAdapter.ts:271
Clear all values from storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
has()
has(key): Promise<boolean>;Defined in: src/storage/LocalStorageAdapter.ts:310
Check if a key exists in storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<boolean>
Promise resolving to true if key exists
Implementation of
keys()
keys(prefix?): Promise<string[]>;Defined in: src/storage/LocalStorageAdapter.ts:324
Get all keys in storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<string[]>
Promise resolving to array of keys
Implementation of
SessionStorageAdapter
Defined in: src/storage/SessionStorageAdapter.ts:52
SessionStorage adapter implementation
Uses browser's sessionStorage API with automatic JSON serialization and optional encryption support. Data persists only for the browser session.
Example
const adapter = new SessionStorageAdapter({
prefix: 'vuesip',
version: '1'
})
// Store temporary session data
await adapter.set('session:token', { token: 'abc123' })
// Retrieve data
const result = await adapter.get('session:token')
if (result.success) {
console.log(result.data)
}Implements
Constructors
Constructor
new SessionStorageAdapter(config, encryptionPassword?): SessionStorageAdapter;Defined in: src/storage/SessionStorageAdapter.ts:62
Create a new SessionStorage adapter
Parameters
| Parameter | Type | Description |
|---|---|---|
config | StorageConfig | Storage configuration |
encryptionPassword? | string | Optional password for encrypting sensitive data |
Returns
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "SessionStorageAdapter" | 'SessionStorageAdapter' | Adapter name (for debugging) | src/storage/SessionStorageAdapter.ts:53 |
Methods
get()
get<T>(key): Promise<StorageResult<T>>;Defined in: src/storage/SessionStorageAdapter.ts:122
Get a value from storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<T>>
Promise resolving to the value or null if not found
Implementation of
set()
set<T>(key, value): Promise<StorageResult<void>>;Defined in: src/storage/SessionStorageAdapter.ts:193
Set a value in storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | T | Value to store |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
remove()
remove(key): Promise<StorageResult<void>>;Defined in: src/storage/SessionStorageAdapter.ts:246
Remove a value from storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
clear()
clear(prefix?): Promise<StorageResult<void>>;Defined in: src/storage/SessionStorageAdapter.ts:273
Clear all values from storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
Implementation of
has()
has(key): Promise<boolean>;Defined in: src/storage/SessionStorageAdapter.ts:312
Check if a key exists in storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<boolean>
Promise resolving to true if key exists
Implementation of
keys()
keys(prefix?): Promise<string[]>;Defined in: src/storage/SessionStorageAdapter.ts:326
Get all keys in storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<string[]>
Promise resolving to array of keys
Implementation of
PersistenceManager
Defined in: src/storage/persistence.ts:43
Persistence manager for a store
Type Parameters
| Type Parameter |
|---|
T |
Constructors
Constructor
new PersistenceManager<T>(options): PersistenceManager<T>;Defined in: src/storage/persistence.ts:54
Parameters
| Parameter | Type |
|---|---|
options | PersistenceOptions<T> |
Returns
Methods
save()
save(): Promise<void>;Defined in: src/storage/persistence.ts:108
Save current state to storage
Returns
Promise<void>
Promise that resolves when save is complete
load()
load(): Promise<void>;Defined in: src/storage/persistence.ts:130
Load state from storage
Returns
Promise<void>
Promise that resolves when load is complete
clear()
clear(): Promise<void>;Defined in: src/storage/persistence.ts:155
Clear state from storage
Returns
Promise<void>
Promise that resolves when clear is complete
destroy()
destroy(): void;Defined in: src/storage/persistence.ts:173
Stop automatic saving and cleanup
Returns
void
KeywordDetector
Defined in: src/transcription/features/keyword-detector.ts:31
Detects keywords and phrases in transcript entries
Example
const detector = new KeywordDetector()
detector.addRule({ phrase: 'cancel subscription', action: 'retention' })
detector.onMatch((match) => showAgentAssistCard(match.rule.action))
// On each transcript entry:
detector.detect(entry)Constructors
Constructor
new KeywordDetector(): KeywordDetector;Returns
Methods
addRule()
addRule(rule): string;Defined in: src/transcription/features/keyword-detector.ts:40
Add a keyword detection rule
Parameters
| Parameter | Type | Description |
|---|---|---|
rule | Omit<KeywordRule, "id"> | Rule configuration (without id) |
Returns
string
Generated rule ID
removeRule()
removeRule(id): void;Defined in: src/transcription/features/keyword-detector.ts:52
Remove a rule by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Rule ID to remove |
Returns
void
getRules()
getRules(): KeywordRule[];Defined in: src/transcription/features/keyword-detector.ts:63
Get all registered rules
Returns
clearRules()
clearRules(): void;Defined in: src/transcription/features/keyword-detector.ts:70
Clear all rules
Returns
void
detect()
detect(entry): KeywordMatch[];Defined in: src/transcription/features/keyword-detector.ts:80
Detect keywords in a transcript entry
Parameters
| Parameter | Type | Description |
|---|---|---|
entry | TranscriptEntry | Transcript entry to scan |
Returns
Array of matches found
onMatch()
onMatch(callback): () => void;Defined in: src/transcription/features/keyword-detector.ts:159
Register callback for keyword matches
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (match) => void | Function called when keyword is detected |
Returns
Unsubscribe function
(): void;Returns
void
dispose()
dispose(): void;Defined in: src/transcription/features/keyword-detector.ts:172
Dispose and clean up
Returns
void
PIIRedactor
Defined in: src/transcription/features/pii-redactor.ts:49
Redacts personally identifiable information from transcript text
Remarks
Supports credit cards, SSN, phone numbers, email addresses, and custom patterns. Critical for PCI-DSS, HIPAA, and GDPR compliance.
Example
const redactor = new PIIRedactor({
enabled: true,
patterns: ['credit-card', 'ssn'],
onRedacted: (type, original) => auditLog(type)
})
const result = redactor.redact('My card is 4111 1111 1111 1111')
// result.redacted = 'My card is [REDACTED]'Constructors
Constructor
new PIIRedactor(config): PIIRedactor;Defined in: src/transcription/features/pii-redactor.ts:53
Parameters
| Parameter | Type |
|---|---|
config | Partial<RedactionConfig> |
Returns
Methods
configure()
configure(config): void;Defined in: src/transcription/features/pii-redactor.ts:95
Update redaction configuration
Parameters
| Parameter | Type |
|---|---|
config | Partial<RedactionConfig> |
Returns
void
isEnabled()
isEnabled(): boolean;Defined in: src/transcription/features/pii-redactor.ts:103
Check if redaction is enabled
Returns
boolean
redact()
redact(text): RedactionResult;Defined in: src/transcription/features/pii-redactor.ts:112
Redact PII from text
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | Text to redact |
Returns
Redaction result with original, redacted text, and detections
redactEntry()
redactEntry(entry): TranscriptEntry;Defined in: src/transcription/features/pii-redactor.ts:189
Redact PII from a transcript entry and call callback
Parameters
| Parameter | Type | Description |
|---|---|---|
entry | TranscriptEntry | Transcript entry to redact |
Returns
Modified entry with redacted text
dispose()
dispose(): void;Defined in: src/transcription/features/pii-redactor.ts:208
Dispose and clean up
Returns
void
TranscriptExporter
Defined in: src/transcription/features/transcript-exporter.ts:68
Exports transcript entries to various formats
Example
const exporter = new TranscriptExporter()
// Export as SRT subtitles
const srt = exporter.export(entries, 'srt')
// Export as plain text with speakers
const txt = exporter.export(entries, 'txt', { includeSpeakers: true })Constructors
Constructor
new TranscriptExporter(): TranscriptExporter;Returns
Methods
export()
export(
entries,
format,
options): string;Defined in: src/transcription/features/transcript-exporter.ts:76
Export transcript entries to specified format
Parameters
| Parameter | Type | Description |
|---|---|---|
entries | TranscriptEntry[] | Transcript entries to export |
format | ExportFormat | Export format |
options | ExportOptions | Export options |
Returns
string
Formatted string
ProviderRegistry
Defined in: src/transcription/providers/registry.ts:26
Registry for managing transcription providers
Example
const registry = new ProviderRegistry()
registry.register('web-speech', () => new WebSpeechProvider())
const provider = await registry.get('web-speech', { language: 'en-US' })Constructors
Constructor
new ProviderRegistry(): ProviderRegistry;Returns
Methods
register()
register(name, factory): void;Defined in: src/transcription/providers/registry.ts:36
Register a provider factory
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Unique provider name |
factory | ProviderFactory | Factory function that creates provider instances |
Returns
void
Throws
Error if provider name already registered
has()
has(name): boolean;Defined in: src/transcription/providers/registry.ts:48
Check if a provider is registered
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Provider name to check |
Returns
boolean
get()
get(name, options): Promise<TranscriptionProvider>;Defined in: src/transcription/providers/registry.ts:59
Get or create a provider instance
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Provider name |
options | ProviderOptions | Provider initialization options |
Returns
Promise<TranscriptionProvider>
Initialized provider instance
Throws
Error if provider not found
getAvailable()
getAvailable(): string[];Defined in: src/transcription/providers/registry.ts:84
Get list of registered provider names
Returns
string[]
dispose()
dispose(): void;Defined in: src/transcription/providers/registry.ts:91
Dispose all cached provider instances
Returns
void
remove()
remove(name): void;Defined in: src/transcription/providers/registry.ts:107
Remove a cached provider instance (forces re-creation on next get)
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Provider name |
Returns
void
WebSpeechProvider
Defined in: src/transcription/providers/web-speech.ts:63
Transcription provider using the browser's Web Speech API
Remarks
This is the default provider. It's free and requires no setup, but has limitations: Chrome-only for best results, no punctuation, limited accuracy.
Example
const provider = new WebSpeechProvider()
await provider.initialize({ language: 'en-US' })
provider.onFinal((result) => console.log(result.text))
provider.startStream(audioSource)Implements
Constructors
Constructor
new WebSpeechProvider(): WebSpeechProvider;Returns
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "web-speech" | 'web-speech' | Provider identifier | src/transcription/providers/web-speech.ts:64 |
capabilities | readonly | ProviderCapabilities | undefined | Provider capabilities | src/transcription/providers/web-speech.ts:66 |
Methods
initialize()
initialize(options): Promise<void>;Defined in: src/transcription/providers/web-speech.ts:112
Initialize the Web Speech API
Parameters
| Parameter | Type |
|---|---|
options | ProviderOptions |
Returns
Promise<void>
Implementation of
TranscriptionProvider.initialize
startStream()
startStream(audioSource): void;Defined in: src/transcription/providers/web-speech.ts:184
Start transcribing audio
Parameters
| Parameter | Type |
|---|---|
audioSource | AudioSource |
Returns
void
Implementation of
TranscriptionProvider.startStream
stopStream()
stopStream(): void;Defined in: src/transcription/providers/web-speech.ts:204
Stop transcribing
Returns
void
Implementation of
TranscriptionProvider.stopStream
onInterim()
onInterim(callback): void;Defined in: src/transcription/providers/web-speech.ts:215
Register interim result callback
Parameters
| Parameter | Type |
|---|---|
callback | (text, sourceId) => void |
Returns
void
Implementation of
TranscriptionProvider.onInterim
onFinal()
onFinal(callback): void;Defined in: src/transcription/providers/web-speech.ts:222
Register final result callback
Parameters
| Parameter | Type |
|---|---|
callback | (result, sourceId) => void |
Returns
void
Implementation of
onError()
onError(callback): void;Defined in: src/transcription/providers/web-speech.ts:229
Register error callback
Parameters
| Parameter | Type |
|---|---|
callback | (error) => void |
Returns
void
Implementation of
dispose()
dispose(): void;Defined in: src/transcription/providers/web-speech.ts:236
Clean up resources
Returns
void
Implementation of
WhisperProvider
Defined in: src/transcription/providers/whisper.ts:83
Transcription provider for Whisper-based servers
Supports:
- faster-whisper-server
- whisper.cpp server
- Custom WebSocket Whisper endpoints
Example
import { providerRegistry, WhisperProvider } from 'vuesip'
providerRegistry.register('whisper', () => new WhisperProvider())
const { start } = useTranscription({
provider: 'whisper',
providerOptions: {
serverUrl: 'ws://localhost:8765/transcribe',
model: 'base',
language: 'en',
},
})Implements
Constructors
Constructor
new WhisperProvider(): WhisperProvider;Returns
Properties
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
name | readonly | "whisper" | 'whisper' | Provider identifier | src/transcription/providers/whisper.ts:84 |
capabilities | readonly | ProviderCapabilities | undefined | Provider capabilities | src/transcription/providers/whisper.ts:86 |
Methods
initialize()
initialize(options): Promise<void>;Defined in: src/transcription/providers/whisper.ts:229
Initialize the Whisper provider
Parameters
| Parameter | Type |
|---|---|
options | WhisperProviderOptions |
Returns
Promise<void>
Implementation of
TranscriptionProvider.initialize
startStream()
startStream(audioSource): void;Defined in: src/transcription/providers/whisper.ts:404
Start transcribing an audio source
Parameters
| Parameter | Type |
|---|---|
audioSource | AudioSource |
Returns
void
Implementation of
TranscriptionProvider.startStream
stopStream()
stopStream(): void;Defined in: src/transcription/providers/whisper.ts:504
Stop transcribing
Returns
void
Implementation of
TranscriptionProvider.stopStream
onInterim()
onInterim(callback): void;Defined in: src/transcription/providers/whisper.ts:537
Register interim result callback
Parameters
| Parameter | Type |
|---|---|
callback | (text, sourceId) => void |
Returns
void
Implementation of
TranscriptionProvider.onInterim
onFinal()
onFinal(callback): void;Defined in: src/transcription/providers/whisper.ts:544
Register final result callback
Parameters
| Parameter | Type |
|---|---|
callback | (result, sourceId) => void |
Returns
void
Implementation of
onError()
onError(callback): void;Defined in: src/transcription/providers/whisper.ts:551
Register error callback
Parameters
| Parameter | Type |
|---|---|
callback | (error) => void |
Returns
void
Implementation of
detectLanguage()
detectLanguage(): Promise<string>;Defined in: src/transcription/providers/whisper.ts:558
Detect language from audio sample
Returns
Promise<string>
Implementation of
TranscriptionProvider.detectLanguage
getSupportedLanguages()
getSupportedLanguages(): string[];Defined in: src/transcription/providers/whisper.ts:566
Get supported languages
Returns
string[]
Implementation of
TranscriptionProvider.getSupportedLanguages
dispose()
dispose(): void;Defined in: src/transcription/providers/whisper.ts:573
Clean up resources
Returns
void
Implementation of
Logger
Defined in: src/utils/logger.ts:131
Logger class with namespace support
Constructors
Constructor
new Logger(namespace): Logger;Defined in: src/utils/logger.ts:142
Creates a new logger instance
Parameters
| Parameter | Type | Description |
|---|---|---|
namespace | string | Logger namespace (e.g., 'SipClient', 'CallSession') |
Returns
Methods
debug()
debug(message, ...args): void;Defined in: src/utils/logger.ts:158
Logs a debug message
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Log message |
...args | unknown[] | Additional arguments to log |
Returns
void
Example
const logger = new Logger('MyComponent')
logger.debug('Debug message', { foo: 'bar' })info()
info(message, ...args): void;Defined in: src/utils/logger.ts:173
Logs an info message
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Log message |
...args | unknown[] | Additional arguments to log |
Returns
void
Example
logger.info('User connected', { userId: '123' })warn()
warn(message, ...args): void;Defined in: src/utils/logger.ts:188
Logs a warning message
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Log message |
...args | unknown[] | Additional arguments to log |
Returns
void
Example
logger.warn('Connection slow', { latency: 500 })error()
error(message, ...args): void;Defined in: src/utils/logger.ts:203
Logs an error message
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Log message |
...args | unknown[] | Additional arguments to log (can include Error objects) |
Returns
void
Example
logger.error('Connection failed', new Error('Network error'))child()
child(childNamespace): Logger;Defined in: src/utils/logger.ts:278
Creates a child logger with an extended namespace
Parameters
| Parameter | Type | Description |
|---|---|---|
childNamespace | string | Child namespace to append |
Returns
New logger instance
Example
const logger = new Logger('SipClient')
const callLogger = logger.child('Call')
// Namespace will be 'SipClient:Call'Interfaces
CallSessionPiPOptions
Defined in: src/composables/types.ts:18
PiP integration options for CallSession
Configuration options for Picture-in-Picture behavior within a call session. These options control automatic PiP entry/exit and preference persistence.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
autoEnterOnAnswer? | boolean | Auto-enter PiP when call is answered When true, PiP mode will automatically activate when an incoming call is answered or an outgoing call is connected. Default false | src/composables/types.ts:25 |
autoExitOnEnd? | boolean | Auto-exit PiP when call ends When true, PiP mode will automatically deactivate when the call terminates or fails. Default true | src/composables/types.ts:33 |
persistPreference? | boolean | Persist PiP preference to localStorage When true, the user's PiP preference will be saved and restored across sessions. Default false | src/composables/types.ts:41 |
UseAmiReturn
Defined in: src/composables/useAmi.ts:42
Return type for useAmi composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
connectionState | Ref<AmiConnectionState> | AMI connection state | src/composables/useAmi.ts:45 |
isConnected | ComputedRef<boolean> | Whether connected to AMI | src/composables/useAmi.ts:47 |
error | Ref<string | null> | Connection error message | src/composables/useAmi.ts:49 |
presenceStates | Ref<Map<string, AmiPresenceState>> | Map of extension presence states | src/composables/useAmi.ts:51 |
discoveredStates | Ref<Set<string>> | List of discovered presence states (from events) | src/composables/useAmi.ts:53 |
connect | (config) => Promise<void> | Connect to AMI WebSocket | src/composables/useAmi.ts:57 |
disconnect | () => void | Disconnect from AMI | src/composables/useAmi.ts:59 |
getPresenceState | (extension) => Promise<AmiPresenceState> | Get presence state for extension | src/composables/useAmi.ts:61 |
setPresenceState | (extension, state, message?) => Promise<void> | Set presence state for extension | src/composables/useAmi.ts:63 |
queryExtensions | (extensions) => Promise<Map<string, AmiPresenceState>> | Query multiple extensions | src/composables/useAmi.ts:65 |
onEvent | (callback) => () => void | Listen for AMI events | src/composables/useAmi.ts:67 |
onPresenceChange | (callback) => () => void | Listen for presence changes | src/composables/useAmi.ts:69 |
getClient | () => AmiClient | null | Get underlying AMI client | src/composables/useAmi.ts:71 |
UseAmiCallsReturn
Defined in: src/composables/useAmiCalls.ts:34
Return type for useAmiCalls composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
calls | Ref<Map<string, ActiveCall>> | Map of active calls by unique ID | src/composables/useAmiCalls.ts:37 |
channels | Ref<ChannelInfo[]> | Raw channel list | src/composables/useAmiCalls.ts:39 |
loading | Ref<boolean> | Loading state | src/composables/useAmiCalls.ts:41 |
error | Ref<string | null> | Error message | src/composables/useAmiCalls.ts:43 |
lastRefresh | Ref<Date | null> | Last refresh timestamp | src/composables/useAmiCalls.ts:45 |
callList | ComputedRef<ActiveCall[]> | List of active calls | src/composables/useAmiCalls.ts:49 |
callCount | ComputedRef<number> | Number of active calls | src/composables/useAmiCalls.ts:51 |
ringingCalls | ComputedRef<ActiveCall[]> | Calls in ringing state | src/composables/useAmiCalls.ts:53 |
connectedCalls | ComputedRef<ActiveCall[]> | Calls in connected/up state | src/composables/useAmiCalls.ts:55 |
dialingCalls | ComputedRef<ActiveCall[]> | Calls in dialing state | src/composables/useAmiCalls.ts:57 |
totalDuration | ComputedRef<number> | Total call duration across all calls | src/composables/useAmiCalls.ts:59 |
refresh | () => Promise<void> | Refresh channel list | src/composables/useAmiCalls.ts:63 |
clickToCall | (agentChannel, destination, options?) => Promise<OriginateResult> | Make a click-to-call (agent-first) | src/composables/useAmiCalls.ts:65 |
originate | (options) => Promise<OriginateResult> | Originate a call (raw) | src/composables/useAmiCalls.ts:67 |
hangup | (channelOrUniqueId) => Promise<void> | Hangup a call | src/composables/useAmiCalls.ts:69 |
transfer | (channelOrUniqueId, destination, context?) => Promise<void> | Transfer a call | src/composables/useAmiCalls.ts:71 |
getStateLabel | (state) => string | Get state label | src/composables/useAmiCalls.ts:73 |
UseAmiDatabaseReturn
Defined in: src/composables/useAmiDatabase.ts:37
Return type for useAmiDatabase composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
contacts | Ref<Map<string, AmiContact>> | Map of contacts by ID | src/composables/useAmiDatabase.ts:40 |
groups | Ref<string[]> | Available groups | src/composables/useAmiDatabase.ts:42 |
loading | Ref<boolean> | Loading state | src/composables/useAmiDatabase.ts:44 |
error | Ref<string | null> | Error message | src/composables/useAmiDatabase.ts:46 |
contactList | ComputedRef<AmiContact[]> | List of all contacts | src/composables/useAmiDatabase.ts:50 |
contactsByGroup | ComputedRef<Map<string, ContactGroup>> | Contacts grouped by group | src/composables/useAmiDatabase.ts:52 |
contactCount | ComputedRef<number> | Total contact count | src/composables/useAmiDatabase.ts:54 |
refresh | () => Promise<void> | Refresh contacts from AstDB | src/composables/useAmiDatabase.ts:58 |
getContact | (id) => Promise<AmiContact | null> | Get a contact by ID | src/composables/useAmiDatabase.ts:60 |
saveContact | (contact) => Promise<AmiContact> | Save a contact | src/composables/useAmiDatabase.ts:62 |
deleteContact | (id) => Promise<void> | Delete a contact | src/composables/useAmiDatabase.ts:64 |
search | (query) => AmiContact[] | Search contacts | src/composables/useAmiDatabase.ts:66 |
getByGroup | (group) => AmiContact[] | Get contacts by group | src/composables/useAmiDatabase.ts:68 |
getGroups | () => string[] | Get available groups | src/composables/useAmiDatabase.ts:70 |
addGroup | (group) => void | Add a group | src/composables/useAmiDatabase.ts:72 |
getFieldDefinitions | () => ContactFieldDefinition[] | Get field definitions | src/composables/useAmiDatabase.ts:74 |
dbGet | (family, key) => Promise<string | null> | Raw DB operations | src/composables/useAmiDatabase.ts:76 |
dbPut | (family, key, value) => Promise<void> | - | src/composables/useAmiDatabase.ts:77 |
dbDel | (family, key) => Promise<void> | - | src/composables/useAmiDatabase.ts:78 |
dbDelTree | (family, key?) => Promise<void> | - | src/composables/useAmiDatabase.ts:79 |
importContacts | (contactsToImport) => Promise<AmiContact[]> | Import contacts from array (bulk operation) | src/composables/useAmiDatabase.ts:81 |
exportContacts | () => AmiContact[] | Export all contacts as array | src/composables/useAmiDatabase.ts:83 |
registerKnownId | (id) => void | Register a known contact ID (for external tracking) | src/composables/useAmiDatabase.ts:85 |
getKnownIds | () => string[] | Get known IDs (for external persistence) | src/composables/useAmiDatabase.ts:87 |
UseAmiParkingReturn
Defined in: src/composables/useAmiParking.ts:31
Return type for useAmiParking composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
parkingLots | Ref<Map<string, ParkingLotStatus>> | Map of parking lots by name | src/composables/useAmiParking.ts:34 |
parkedCalls | ComputedRef<ParkedCall[]> | All parked calls across all lots | src/composables/useAmiParking.ts:36 |
isLoading | Ref<boolean> | Whether currently loading | src/composables/useAmiParking.ts:38 |
error | Ref<string | null> | Error message if any | src/composables/useAmiParking.ts:40 |
totalParkedCalls | ComputedRef<number> | Total parked calls count | src/composables/useAmiParking.ts:42 |
getParkingLots | () => Promise<ParkingLot[]> | Get all parking lots configuration | src/composables/useAmiParking.ts:46 |
getParkedCalls | (parkingLot?) => Promise<ParkedCall[]> | Get parked calls in a lot | src/composables/useAmiParking.ts:48 |
parkCall | (channel, parkingLot?, timeout?) => Promise<number> | Park a call | src/composables/useAmiParking.ts:50 |
retrieveCall | (parkingSpace, channel, parkingLot?) => Promise<void> | Retrieve a parked call | src/composables/useAmiParking.ts:52 |
refreshParkingLot | (parkingLot?) => Promise<void> | Refresh parking lot status | src/composables/useAmiParking.ts:54 |
getParkedCallBySpace | (parkingSpace, parkingLot?) => ParkedCall | undefined | Get parked call by space number | src/composables/useAmiParking.ts:56 |
onParkingEvent | (callback) => () => void | Listen for parking events | src/composables/useAmiParking.ts:58 |
UseAmiPeersReturn
Defined in: src/composables/useAmiPeers.ts:40
Return type for useAmiPeers composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
peers | Ref<Map<string, PeerInfo>> | Map of peers by object name | src/composables/useAmiPeers.ts:43 |
loading | Ref<boolean> | Loading state | src/composables/useAmiPeers.ts:45 |
error | Ref<string | null> | Error message | src/composables/useAmiPeers.ts:47 |
lastRefresh | Ref<Date | null> | Last refresh timestamp | src/composables/useAmiPeers.ts:49 |
peerList | ComputedRef<PeerInfo[]> | List of all peers | src/composables/useAmiPeers.ts:53 |
sipPeers | ComputedRef<PeerInfo[]> | SIP peers only | src/composables/useAmiPeers.ts:55 |
pjsipPeers | ComputedRef<PeerInfo[]> | PJSIP peers only | src/composables/useAmiPeers.ts:57 |
onlinePeers | ComputedRef<PeerInfo[]> | Online peers | src/composables/useAmiPeers.ts:59 |
offlinePeers | ComputedRef<PeerInfo[]> | Offline peers | src/composables/useAmiPeers.ts:61 |
statusSummary | ComputedRef<PeerStatusSummary> | Status summary | src/composables/useAmiPeers.ts:63 |
refresh | () => Promise<void> | Refresh all peer data | src/composables/useAmiPeers.ts:67 |
refreshSipPeers | () => Promise<void> | Refresh SIP peers only | src/composables/useAmiPeers.ts:69 |
refreshPjsipPeers | () => Promise<void> | Refresh PJSIP endpoints only | src/composables/useAmiPeers.ts:71 |
getPeer | (name) => PeerInfo | undefined | Get peer by name | src/composables/useAmiPeers.ts:73 |
isOnline | (nameOrPeer) => boolean | Check if peer is online | src/composables/useAmiPeers.ts:75 |
UseAmiQueuesReturn
Defined in: src/composables/useAmiQueues.ts:36
Return type for useAmiQueues composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
queues | Ref<Map<string, QueueInfo>> | Map of queue name to queue info | src/composables/useAmiQueues.ts:39 |
summaries | Ref<QueueSummary[]> | Queue summaries (quick stats) | src/composables/useAmiQueues.ts:41 |
loading | Ref<boolean> | Loading state | src/composables/useAmiQueues.ts:43 |
error | Ref<string | null> | Error message | src/composables/useAmiQueues.ts:45 |
lastRefresh | Ref<Date | null> | Last refresh timestamp | src/composables/useAmiQueues.ts:47 |
queueList | ComputedRef<QueueInfo[]> | List of all queues | src/composables/useAmiQueues.ts:51 |
totalCallers | ComputedRef<number> | Total callers waiting across all queues | src/composables/useAmiQueues.ts:53 |
totalAvailable | ComputedRef<number> | Total available agents across all queues | src/composables/useAmiQueues.ts:55 |
totalPaused | ComputedRef<number> | Total paused agents across all queues | src/composables/useAmiQueues.ts:57 |
longestWait | ComputedRef< | { queue: string; wait: number; } | null> | Queue with longest wait time | src/composables/useAmiQueues.ts:59 |
overallServiceLevel | ComputedRef<number> | Overall service level across all queues | src/composables/useAmiQueues.ts:61 |
refresh | () => Promise<void> | Refresh all queue data | src/composables/useAmiQueues.ts:65 |
refreshQueue | (queueName) => Promise<void> | Refresh specific queue | src/composables/useAmiQueues.ts:67 |
getSummary | () => Promise<QueueSummary[]> | Get queue summary (quick stats) | src/composables/useAmiQueues.ts:69 |
pauseMember | (queue, iface, reason?) => Promise<void> | Pause a queue member | src/composables/useAmiQueues.ts:71 |
unpauseMember | (queue, iface) => Promise<void> | Unpause a queue member | src/composables/useAmiQueues.ts:73 |
addMember | (queue, iface, options?) => Promise<void> | Add member to queue | src/composables/useAmiQueues.ts:75 |
removeMember | (queue, iface) => Promise<void> | Remove member from queue | src/composables/useAmiQueues.ts:77 |
setPenalty | (queue, iface, penalty) => Promise<void> | Set member penalty | src/composables/useAmiQueues.ts:79 |
getPauseReasons | () => string[] | Get configured pause reasons | src/composables/useAmiQueues.ts:81 |
getStatusLabel | (status) => string | Get status label for a member status | src/composables/useAmiQueues.ts:83 |
UseAmiSupervisorReturn
Defined in: src/composables/useAmiSupervisor.ts:46
Return type for useAmiSupervisor composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
sessions | Ref<Map<string, SupervisionSession>> | Active supervision sessions | src/composables/useAmiSupervisor.ts:49 |
loading | Ref<boolean> | Loading state | src/composables/useAmiSupervisor.ts:51 |
error | Ref<string | null> | Error message | src/composables/useAmiSupervisor.ts:53 |
monitor | (supervisorExtension, targetChannel) => Promise<SupervisionSession> | Start silent monitoring | src/composables/useAmiSupervisor.ts:57 |
whisper | (supervisorExtension, targetChannel) => Promise<SupervisionSession> | Start whisper (coach agent) | src/composables/useAmiSupervisor.ts:59 |
barge | (supervisorExtension, targetChannel) => Promise<SupervisionSession> | Start barge (join call) | src/composables/useAmiSupervisor.ts:61 |
endSession | (sessionId) => Promise<void> | End a supervision session | src/composables/useAmiSupervisor.ts:63 |
endAllSessions | () => Promise<void> | End all supervision sessions | src/composables/useAmiSupervisor.ts:65 |
isSupervising | (targetChannel) => boolean | Check if supervising a channel | src/composables/useAmiSupervisor.ts:67 |
getSessionForChannel | (targetChannel) => SupervisionSession | undefined | Get session for target channel | src/composables/useAmiSupervisor.ts:69 |
switchMode | (sessionId, newMode) => Promise<SupervisionSession> | Switch supervision mode for an existing session | src/composables/useAmiSupervisor.ts:71 |
activeSessionCount | ComputedRef<number> | Get active session count | src/composables/useAmiSupervisor.ts:73 |
UseAmiVoicemailReturn
Defined in: src/composables/useAmiVoicemail.ts:27
Return type for useAmiVoicemail composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
mwiStates | Ref<Map<string, MwiState>> | Map of MWI states by mailbox | src/composables/useAmiVoicemail.ts:30 |
mailboxes | Ref<Map<string, MailboxInfo>> | Map of mailbox info by mailbox | src/composables/useAmiVoicemail.ts:32 |
isLoading | Ref<boolean> | Whether currently loading | src/composables/useAmiVoicemail.ts:34 |
error | Ref<string | null> | Error message if any | src/composables/useAmiVoicemail.ts:36 |
totalNewMessages | ComputedRef<number> | Total new messages across all monitored mailboxes | src/composables/useAmiVoicemail.ts:38 |
totalOldMessages | ComputedRef<number> | Total old messages across all monitored mailboxes | src/composables/useAmiVoicemail.ts:40 |
hasWaitingMessages | ComputedRef<boolean> | Whether any mailbox has waiting messages | src/composables/useAmiVoicemail.ts:42 |
getMwiState | (mailbox, context?) => Promise<MwiState> | Get MWI state for a mailbox | src/composables/useAmiVoicemail.ts:46 |
getMailboxInfo | (mailbox, context?) => Promise<MailboxInfo | null> | Get mailbox info | src/composables/useAmiVoicemail.ts:48 |
getVoicemailUsers | (context?) => Promise<MailboxInfo[]> | Get all voicemail users | src/composables/useAmiVoicemail.ts:50 |
refreshMailbox | (mailbox, context?) => Promise<void> | Refresh MWI for a mailbox | src/composables/useAmiVoicemail.ts:52 |
monitorMailbox | (mailbox, context?) => void | Monitor a mailbox for MWI changes | src/composables/useAmiVoicemail.ts:54 |
unmonitorMailbox | (mailbox, context?) => void | Stop monitoring a mailbox | src/composables/useAmiVoicemail.ts:56 |
clearMonitoring | () => void | Clear all monitored mailboxes | src/composables/useAmiVoicemail.ts:58 |
onMwiChange | (callback) => () => void | Listen for MWI changes | src/composables/useAmiVoicemail.ts:60 |
ActiveTransfer
Defined in: src/composables/useCallControls.ts:28
Active transfer information
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Transfer ID | src/composables/useCallControls.ts:30 |
state | TransferState | Transfer state | src/composables/useCallControls.ts:32 |
type | TransferType | Transfer type | src/composables/useCallControls.ts:34 |
target | string | Target URI | src/composables/useCallControls.ts:36 |
callId | string | Call being transferred | src/composables/useCallControls.ts:38 |
consultationCallId? | string | Consultation call ID (for attended transfer) | src/composables/useCallControls.ts:40 |
initiatedAt | Date | Initiated timestamp | src/composables/useCallControls.ts:42 |
completedAt? | Date | Completed timestamp | src/composables/useCallControls.ts:44 |
error? | string | Error message (if failed) | src/composables/useCallControls.ts:46 |
UseCallControlsReturn
Defined in: src/composables/useCallControls.ts:52
Return type for useCallControls composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activeTransfer | Ref<ActiveTransfer | null> | Active transfer (if any) | src/composables/useCallControls.ts:58 |
transferState | ComputedRef<TransferState> | Transfer state | src/composables/useCallControls.ts:60 |
isTransferring | ComputedRef<boolean> | Whether a transfer is in progress | src/composables/useCallControls.ts:62 |
consultationCall | Ref<CallSession | null> | Consultation call for attended transfer | src/composables/useCallControls.ts:64 |
blindTransfer | (callId, targetUri, extraHeaders?) => Promise<void> | Perform blind transfer | src/composables/useCallControls.ts:71 |
initiateAttendedTransfer | (callId, targetUri) => Promise<string> | Initiate attended transfer (creates consultation call) | src/composables/useCallControls.ts:73 |
completeAttendedTransfer | () => Promise<void> | Complete attended transfer (connect call to consultation call) | src/composables/useCallControls.ts:75 |
cancelTransfer | () => Promise<void> | Cancel active transfer | src/composables/useCallControls.ts:77 |
forwardCall | (callId, targetUri) => Promise<void> | Forward call to target URI | src/composables/useCallControls.ts:79 |
getTransferProgress | () => TransferProgress | null | Get transfer progress | src/composables/useCallControls.ts:81 |
onTransferEvent | (callback) => () => void | Listen for transfer events | src/composables/useCallControls.ts:83 |
UseCallHistoryReturn
Defined in: src/composables/useCallHistory.ts:28
Return type for useCallHistory composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
history | ComputedRef<readonly CallHistoryEntry[]> | All call history entries | src/composables/useCallHistory.ts:34 |
filteredHistory | ComputedRef<readonly CallHistoryEntry[]> | Filtered history entries | src/composables/useCallHistory.ts:36 |
totalCalls | ComputedRef<number> | Total number of calls in history | src/composables/useCallHistory.ts:38 |
missedCallsCount | ComputedRef<number> | Total number of missed calls | src/composables/useCallHistory.ts:40 |
currentFilter | Ref<HistoryFilter | null> | Current filter | src/composables/useCallHistory.ts:42 |
getHistory | (filter?) => HistorySearchResult | Get history with optional filter | src/composables/useCallHistory.ts:49 |
searchHistory | (query, filter?) => HistorySearchResult | Search history by query | src/composables/useCallHistory.ts:51 |
clearHistory | () => Promise<void> | Clear all history | src/composables/useCallHistory.ts:53 |
deleteEntry | (entryId) => Promise<void> | Delete a specific entry | src/composables/useCallHistory.ts:55 |
exportHistory | (options) => Promise<void> | Export history to file | src/composables/useCallHistory.ts:57 |
getStatistics | (filter?) => HistoryStatistics | Get history statistics | src/composables/useCallHistory.ts:59 |
setFilter | (filter) => void | Set current filter | src/composables/useCallHistory.ts:61 |
getMissedCalls | () => readonly CallHistoryEntry[] | Get missed calls only | src/composables/useCallHistory.ts:63 |
getRecentCalls | (limit?) => readonly CallHistoryEntry[] | Get recent calls (last N) | src/composables/useCallHistory.ts:65 |
CallSessionOptions
Defined in: src/composables/useCallSession.ts:36
Call session options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | boolean | Enable audio (default: true) | src/composables/useCallSession.ts:38 |
video? | boolean | Enable video (default: false) | src/composables/useCallSession.ts:40 |
data? | Record<string, unknown> | Custom call data | src/composables/useCallSession.ts:42 |
autoCleanup? | boolean | Auto-cleanup on hangup (default: true) | src/composables/useCallSession.ts:44 |
UseCallSessionReturn
Defined in: src/composables/useCallSession.ts:50
Return type for useCallSession composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
session | Ref<CallSession | null> | Active call session | src/composables/useCallSession.ts:56 |
state | ComputedRef<CallState> | Call state | src/composables/useCallSession.ts:58 |
callId | ComputedRef<string | null> | Call ID | src/composables/useCallSession.ts:60 |
direction | ComputedRef<CallDirection | null> | Call direction | src/composables/useCallSession.ts:62 |
localUri | ComputedRef<string | null> | Local SIP URI | src/composables/useCallSession.ts:64 |
remoteUri | ComputedRef<string | null> | Remote SIP URI | src/composables/useCallSession.ts:66 |
remoteDisplayName | ComputedRef<string | null> | Remote display name | src/composables/useCallSession.ts:68 |
isActive | ComputedRef<boolean> | Is call active | src/composables/useCallSession.ts:70 |
isOnHold | ComputedRef<boolean> | Is on hold | src/composables/useCallSession.ts:72 |
isMuted | ComputedRef<boolean> | Is muted | src/composables/useCallSession.ts:74 |
hasRemoteVideo | ComputedRef<boolean> | Has remote video | src/composables/useCallSession.ts:76 |
hasLocalVideo | ComputedRef<boolean> | Has local video | src/composables/useCallSession.ts:78 |
localStream | ComputedRef<MediaStream | null> | Local media stream | src/composables/useCallSession.ts:80 |
remoteStream | ComputedRef<MediaStream | null> | Remote media stream | src/composables/useCallSession.ts:82 |
timing | ComputedRef<CallTimingInfo> | Call timing information | src/composables/useCallSession.ts:84 |
duration | ComputedRef<number> | Call duration in seconds (if active) | src/composables/useCallSession.ts:86 |
terminationCause | ComputedRef<TerminationCause | undefined> | Termination cause (if ended) | src/composables/useCallSession.ts:88 |
makeCall | (target, options?, signal?) => Promise<void> | Make an outgoing call with optional abort signal | src/composables/useCallSession.ts:95 |
answer | (options?) => Promise<void> | Answer an incoming call | src/composables/useCallSession.ts:97 |
reject | (statusCode?) => Promise<void> | Reject an incoming call | src/composables/useCallSession.ts:99 |
hangup | () => Promise<void> | Hangup the call | src/composables/useCallSession.ts:101 |
hold | () => Promise<void> | Put call on hold | src/composables/useCallSession.ts:103 |
unhold | () => Promise<void> | Resume call from hold | src/composables/useCallSession.ts:105 |
toggleHold | () => Promise<void> | Toggle hold state | src/composables/useCallSession.ts:107 |
mute | () => void | Mute audio | src/composables/useCallSession.ts:109 |
unmute | () => void | Unmute audio | src/composables/useCallSession.ts:111 |
toggleMute | () => void | Toggle mute state | src/composables/useCallSession.ts:113 |
disableVideo | () => void | Disable video | src/composables/useCallSession.ts:115 |
enableVideo | () => void | Enable video | src/composables/useCallSession.ts:117 |
toggleVideo | () => void | Toggle video state | src/composables/useCallSession.ts:119 |
sendDTMF | (tone, options?) => Promise<void> | Send DTMF tone | src/composables/useCallSession.ts:121 |
getStats | () => Promise<CallStatistics | null> | Get call statistics | src/composables/useCallSession.ts:123 |
clearSession | () => void | Clear current session | src/composables/useCallSession.ts:125 |
transferCall | (target, options) => Promise<TransferResult> | Transfer call (blind or attended) | src/composables/useCallSession.ts:127 |
isPiPSupported | Ref<boolean> | Whether PiP is supported by the browser | src/composables/useCallSession.ts:134 |
isPiPActive | Ref<boolean> | Whether PiP mode is currently active | src/composables/useCallSession.ts:136 |
pipWindow | Ref<PictureInPictureWindow | null> | Current PiP window reference (dimensions accessible) | src/composables/useCallSession.ts:138 |
pipError | Ref<Error | null> | Current PiP error state | src/composables/useCallSession.ts:140 |
setVideoRef | (element) => void | Set video element for PiP | src/composables/useCallSession.ts:142 |
enterPiP | (videoElement?) => Promise<PictureInPictureWindow | null> | Enter PiP mode | src/composables/useCallSession.ts:148 |
exitPiP | () => Promise<void> | Exit PiP mode | src/composables/useCallSession.ts:150 |
togglePiP | (videoElement?) => Promise<void> | Toggle PiP mode | src/composables/useCallSession.ts:155 |
UseConferenceReturn
Defined in: src/composables/useConference.ts:39
Return type for useConference composable
Provides reactive state and methods for managing SIP conference calls. Includes participant management, audio controls, recording capabilities, and conference state monitoring.
Since
1.0.0
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
conference | Ref<ConferenceStateInterface | null> | Current conference state object containing all conference data Remarks Null when no conference exists, populated after creating or joining | src/composables/useConference.ts:48 |
state | ComputedRef<ConferenceState> | Current state of the conference (Idle, Creating, Active, Ending, Ended, Failed) Remarks Returns Idle when no conference exists. Watch this for state transitions. | src/composables/useConference.ts:54 |
participants | ComputedRef<Participant[]> | Array of all participants in the conference Remarks Empty array when no conference exists. Includes the local participant. Updates reactively as participants join/leave. | src/composables/useConference.ts:61 |
localParticipant | ComputedRef<Participant | null> | The local participant (self) in the conference Remarks Null when no conference exists. Always has isSelf=true and isModerator=true. | src/composables/useConference.ts:67 |
participantCount | ComputedRef<number> | Total number of participants currently in the conference Remarks Returns 0 when no conference exists. Includes the local participant in the count. | src/composables/useConference.ts:73 |
isActive | ComputedRef<boolean> | Whether the conference is currently active Remarks True only when state is ConferenceState.Active | src/composables/useConference.ts:79 |
isLocked | ComputedRef<boolean> | Whether the conference is locked (no new participants allowed) Remarks Returns false when no conference exists. Locked conferences reject addParticipant calls. | src/composables/useConference.ts:85 |
isRecording | ComputedRef<boolean> | Whether the conference is currently being recorded Remarks Returns false when no conference exists or recording not started | src/composables/useConference.ts:91 |
createConference | (options?) => Promise<string> | Create a new conference Throws If SIP client not initialized or conference already active | src/composables/useConference.ts:103 |
joinConference | (conferenceUri, options?) => Promise<void> | Join an existing conference Throws If SIP client not initialized or join fails | src/composables/useConference.ts:111 |
addParticipant | (uri, displayName?) => Promise<string> | Add a participant to the conference Throws If no active conference, conference locked, or conference full | src/composables/useConference.ts:120 |
removeParticipant | (participantId, reason?) => Promise<void> | Remove a participant from the conference Throws If no active conference or participant not found | src/composables/useConference.ts:128 |
muteParticipant | (participantId) => Promise<void> | Mute a participant's audio Throws If no active conference or participant not found | src/composables/useConference.ts:135 |
unmuteParticipant | (participantId) => Promise<void> | Unmute a participant's audio Throws If no active conference or participant not found | src/composables/useConference.ts:142 |
endConference | () => Promise<void> | End the conference for all participants Throws If no active conference | src/composables/useConference.ts:148 |
lockConference | () => Promise<void> | Lock the conference to prevent new participants from joining Throws If no active conference | src/composables/useConference.ts:154 |
unlockConference | () => Promise<void> | Unlock the conference to allow new participants to join Throws If no active conference | src/composables/useConference.ts:160 |
startRecording | () => Promise<void> | Start recording the conference Throws If no active conference or recording fails | src/composables/useConference.ts:166 |
stopRecording | () => Promise<void> | Stop recording the conference Throws If no active conference | src/composables/useConference.ts:172 |
getParticipant | (participantId) => Participant | null | Get a specific participant by their ID | src/composables/useConference.ts:179 |
onConferenceEvent | (callback) => () => void | Register an event listener for conference events | src/composables/useConference.ts:186 |
DTMFSequenceOptions
Defined in: src/composables/useDTMF.ts:21
DTMF sequence options
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
interToneGap? | number | Inter-tone gap in milliseconds (default: 70ms) | DTMFOptions.interToneGap | - | src/composables/useDTMF.ts:23 |
transport? | "INFO" | "RFC2833" | Transport method for sending DTMF | DTMFOptions.transport | - | src/composables/useDTMF.ts:25 |
onToneSent? | (tone) => void | Callback for each tone sent | - | - | src/composables/useDTMF.ts:27 |
onComplete? | () => void | Callback when sequence completes | - | - | src/composables/useDTMF.ts:29 |
onError? | (error, tone) => void | Callback on error | - | - | src/composables/useDTMF.ts:31 |
duration? | number | Duration of the tone in milliseconds (default: 100) | - | DTMFOptions.duration | src/types/call.types.ts:125 |
transportType? | "INFO" | "RFC2833" | Transport type | - | DTMFOptions.transportType | src/types/call.types.ts:129 |
DTMFSendResult
Defined in: src/composables/useDTMF.ts:37
DTMF send result
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
success | boolean | Success status | src/composables/useDTMF.ts:39 |
tone | string | Tone that was sent | src/composables/useDTMF.ts:41 |
error? | Error | Error if failed | src/composables/useDTMF.ts:43 |
timestamp | Date | Timestamp | src/composables/useDTMF.ts:45 |
UseDTMFReturn
Defined in: src/composables/useDTMF.ts:51
Return type for useDTMF composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
isSending | Ref<boolean> | Is currently sending DTMF | src/composables/useDTMF.ts:57 |
queuedTones | Ref<string[]> | Queued tones | src/composables/useDTMF.ts:59 |
lastSentTone | Ref<string | null> | Last sent tone | src/composables/useDTMF.ts:61 |
lastResult | Ref<DTMFSendResult | null> | Last send result | src/composables/useDTMF.ts:63 |
tonesSentCount | Ref<number> | Total tones sent | src/composables/useDTMF.ts:65 |
queueSize | ComputedRef<number> | Queue size | src/composables/useDTMF.ts:67 |
isQueueEmpty | ComputedRef<boolean> | Is queue empty | src/composables/useDTMF.ts:69 |
sendTone | (tone, options?) => Promise<void> | Send a single DTMF tone | src/composables/useDTMF.ts:76 |
sendToneSequence | (tones, options?) => Promise<void> | Send a sequence of DTMF tones | src/composables/useDTMF.ts:78 |
queueTone | (tone) => void | Queue a tone for sending | src/composables/useDTMF.ts:80 |
queueToneSequence | (tones) => void | Queue multiple tones for sending | src/composables/useDTMF.ts:82 |
processQueue | (options?) => Promise<void> | Process the tone queue | src/composables/useDTMF.ts:84 |
clearQueue | () => void | Clear the tone queue | src/composables/useDTMF.ts:86 |
stopSending | () => void | Stop sending (clear queue and cancel current) | src/composables/useDTMF.ts:88 |
resetStats | () => void | Reset statistics | src/composables/useDTMF.ts:90 |
DeviceTestOptions
Defined in: src/composables/useMediaDevices.ts:39
Device test options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
duration? | number | Test duration in milliseconds (default: 2000) | src/composables/useMediaDevices.ts:41 |
audioLevelThreshold? | number | Audio level threshold for success (0-1, default: 0.01) | src/composables/useMediaDevices.ts:43 |
UseMediaDevicesReturn
Defined in: src/composables/useMediaDevices.ts:49
Return type for useMediaDevices composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audioInputDevices | ComputedRef<readonly MediaDevice[]> | Audio input devices | src/composables/useMediaDevices.ts:55 |
audioOutputDevices | ComputedRef<readonly MediaDevice[]> | Audio output devices | src/composables/useMediaDevices.ts:57 |
videoInputDevices | ComputedRef<readonly MediaDevice[]> | Video input devices | src/composables/useMediaDevices.ts:59 |
allDevices | ComputedRef<readonly MediaDevice[]> | All devices | src/composables/useMediaDevices.ts:61 |
selectedAudioInputId | Ref<string | null> | Selected audio input device ID | src/composables/useMediaDevices.ts:63 |
selectedAudioOutputId | Ref<string | null> | Selected audio output device ID | src/composables/useMediaDevices.ts:65 |
selectedVideoInputId | Ref<string | null> | Selected video input device ID | src/composables/useMediaDevices.ts:67 |
selectedAudioInputDevice | ComputedRef<MediaDevice | undefined> | Selected audio input device | src/composables/useMediaDevices.ts:69 |
selectedAudioOutputDevice | ComputedRef<MediaDevice | undefined> | Selected audio output device | src/composables/useMediaDevices.ts:71 |
selectedVideoInputDevice | ComputedRef<MediaDevice | undefined> | Selected video input device | src/composables/useMediaDevices.ts:73 |
audioPermission | ComputedRef<PermissionStatus> | Audio permission status | src/composables/useMediaDevices.ts:75 |
videoPermission | ComputedRef<PermissionStatus> | Video permission status | src/composables/useMediaDevices.ts:77 |
hasAudioPermission | ComputedRef<boolean> | Has audio permission | src/composables/useMediaDevices.ts:79 |
hasVideoPermission | ComputedRef<boolean> | Has video permission | src/composables/useMediaDevices.ts:81 |
hasAudioInputDevices | ComputedRef<boolean> | Has audio input devices | src/composables/useMediaDevices.ts:83 |
hasAudioOutputDevices | ComputedRef<boolean> | Has audio output devices | src/composables/useMediaDevices.ts:85 |
hasVideoInputDevices | ComputedRef<boolean> | Has video input devices | src/composables/useMediaDevices.ts:87 |
totalDevices | ComputedRef<number> | Total device count | src/composables/useMediaDevices.ts:89 |
isEnumerating | Ref<boolean> | Is enumerating devices | src/composables/useMediaDevices.ts:91 |
lastError | Ref<Error | null> | Last error | src/composables/useMediaDevices.ts:93 |
enumerateDevices | (signal?) => Promise<MediaDevice[]> | Enumerate devices with optional abort signal | src/composables/useMediaDevices.ts:100 |
requestAudioPermission | () => Promise<boolean> | Request audio permission | src/composables/useMediaDevices.ts:102 |
requestVideoPermission | () => Promise<boolean> | Request video permission | src/composables/useMediaDevices.ts:104 |
requestPermissions | (audio?, video?) => Promise<void> | Request permissions | src/composables/useMediaDevices.ts:106 |
selectAudioInput | (deviceId) => void | Select audio input device | src/composables/useMediaDevices.ts:108 |
selectAudioOutput | (deviceId) => void | Select audio output device | src/composables/useMediaDevices.ts:110 |
selectVideoInput | (deviceId) => void | Select video input device | src/composables/useMediaDevices.ts:112 |
testAudioInput | (deviceId?, options?) => Promise<boolean> | Test audio input device | src/composables/useMediaDevices.ts:114 |
testAudioOutput | (deviceId?) => Promise<boolean> | Test audio output device | src/composables/useMediaDevices.ts:116 |
getDeviceById | (deviceId) => MediaDevice | undefined | Get device by ID | src/composables/useMediaDevices.ts:118 |
getDevicesByKind | (kind) => readonly MediaDevice[] | Get devices by kind | src/composables/useMediaDevices.ts:120 |
startDeviceChangeMonitoring | () => void | Start device change monitoring | src/composables/useMediaDevices.ts:122 |
stopDeviceChangeMonitoring | () => void | Stop device change monitoring | src/composables/useMediaDevices.ts:124 |
Conversation
Defined in: src/composables/useMessaging.ts:31
Conversation thread
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | Peer URI | src/composables/useMessaging.ts:33 |
displayName? | string | Peer display name | src/composables/useMessaging.ts:35 |
messages | Message[] | Messages in conversation | src/composables/useMessaging.ts:37 |
unreadCount | number | Unread count | src/composables/useMessaging.ts:39 |
lastMessageAt | Date | null | Last message timestamp | src/composables/useMessaging.ts:41 |
isComposing | boolean | Is peer composing | src/composables/useMessaging.ts:43 |
UseMessagingReturn
Defined in: src/composables/useMessaging.ts:49
Return type for useMessaging composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
messages | Ref<Message[]> | All messages | src/composables/useMessaging.ts:55 |
conversations | ComputedRef<Map<string, Conversation>> | Conversations grouped by URI | src/composables/useMessaging.ts:57 |
unreadCount | ComputedRef<number> | Total unread message count | src/composables/useMessaging.ts:59 |
composingIndicators | Ref<Map<string, ComposingIndicator>> | Composing indicators | src/composables/useMessaging.ts:61 |
sendMessage | (to, content, options?) => Promise<string> | Send a message | src/composables/useMessaging.ts:68 |
markAsRead | (messageId) => void | Mark message as read | src/composables/useMessaging.ts:70 |
markAllAsRead | (uri?) => void | Mark all messages from a URI as read | src/composables/useMessaging.ts:72 |
deleteMessage | (messageId) => void | Delete a message | src/composables/useMessaging.ts:74 |
clearMessages | (uri?) => void | Clear all messages | src/composables/useMessaging.ts:76 |
getMessagesForUri | (uri) => Message[] | Get messages for a specific URI | src/composables/useMessaging.ts:78 |
getFilteredMessages | (filter) => Message[] | Get filtered messages | src/composables/useMessaging.ts:80 |
sendComposingIndicator | (to, isComposing) => Promise<void> | Send composing indicator | src/composables/useMessaging.ts:82 |
onMessagingEvent | (callback) => () => void | Listen for messaging events | src/composables/useMessaging.ts:84 |
UseOAuth2Options
Defined in: src/composables/useOAuth2.ts:76
Options for useOAuth2 composable
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
autoInitialize? | boolean | Auto-initialize on mount (restore session) | - | - | src/composables/useOAuth2.ts:78 |
autoHandleCallback? | boolean | Auto-handle callback if on callback URL | - | - | src/composables/useOAuth2.ts:80 |
callbackPath? | string | Callback path to detect | OAuth2ServiceConfig.callbackPath | - | src/composables/useOAuth2.ts:82 |
provider | OAuth2ProviderConfig | OAuth2 provider configuration | - | OAuth2ServiceConfig.provider | src/types/oauth.types.ts:299 |
credentialMapping | SipCredentialMapping | SIP credential mapping configuration | - | OAuth2ServiceConfig.credentialMapping | src/types/oauth.types.ts:301 |
autoRefresh? | boolean | Auto-refresh tokens before expiry | - | OAuth2ServiceConfig.autoRefresh | src/types/oauth.types.ts:303 |
refreshThreshold? | number | Refresh tokens this many seconds before expiry | - | OAuth2ServiceConfig.refreshThreshold | src/types/oauth.types.ts:305 |
storageKeyPrefix? | string | Storage key prefix for persisting tokens | - | OAuth2ServiceConfig.storageKeyPrefix | src/types/oauth.types.ts:307 |
storageType? | "localStorage" | "sessionStorage" | "memory" | Storage type to use | - | OAuth2ServiceConfig.storageType | src/types/oauth.types.ts:309 |
debug? | boolean | Enable debug logging | - | OAuth2ServiceConfig.debug | src/types/oauth.types.ts:311 |
postLoginRedirect? | string | Post-login redirect URL | - | OAuth2ServiceConfig.postLoginRedirect | src/types/oauth.types.ts:315 |
postLogoutRedirect? | string | Post-logout redirect URL | - | OAuth2ServiceConfig.postLogoutRedirect | src/types/oauth.types.ts:317 |
UseOAuth2ComposableReturn
Defined in: src/composables/useOAuth2.ts:88
Extended return type with additional composable features
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
service | OAuth2ServiceReturn | Service instance (for advanced usage) | - | src/composables/useOAuth2.ts:90 |
isInitialized | Ref<boolean> | Whether initialization is complete | - | src/composables/useOAuth2.ts:92 |
isOnCallbackPage | ComputedRef<boolean> | Whether currently on callback page | - | src/composables/useOAuth2.ts:94 |
authState | Ref<OAuth2AuthState, OAuth2AuthState> | Current authentication state | UseOAuth2Return.authState | src/types/oauth.types.ts:325 |
isAuthenticated | ComputedRef<boolean> | Whether user is authenticated | UseOAuth2Return.isAuthenticated | src/types/oauth.types.ts:327 |
error | Ref<OAuth2Error | null, OAuth2Error | null> | Current error (null if none) | UseOAuth2Return.error | src/types/oauth.types.ts:329 |
userInfo | Ref<OAuth2UserInfo | null, OAuth2UserInfo | null> | Current OAuth2 user info | UseOAuth2Return.userInfo | src/types/oauth.types.ts:331 |
sipCredentials | Ref<ProvisionedSipCredentials | null, ProvisionedSipCredentials | null> | Provisioned SIP credentials | UseOAuth2Return.sipCredentials | src/types/oauth.types.ts:333 |
tokens | Ref<OAuth2TokenResponse | null, OAuth2TokenResponse | null> | Current OAuth2 tokens | UseOAuth2Return.tokens | src/types/oauth.types.ts:335 |
tokenExpiresAt | Ref<Date | null, Date | null> | Token expiration timestamp | UseOAuth2Return.tokenExpiresAt | src/types/oauth.types.ts:337 |
isRefreshing | Ref<boolean, boolean> | Whether token refresh is in progress | UseOAuth2Return.isRefreshing | src/types/oauth.types.ts:339 |
login | (options?) => Promise<void> | Initiate OAuth2 login flow | UseOAuth2Return.login | src/types/oauth.types.ts:343 |
handleCallback | (url?) => Promise<ProvisionedSipCredentials> | Handle OAuth2 callback (after redirect) | UseOAuth2Return.handleCallback | src/types/oauth.types.ts:345 |
logout | () => Promise<void> | Logout and revoke tokens | UseOAuth2Return.logout | src/types/oauth.types.ts:347 |
refreshTokens | () => Promise<OAuth2TokenResponse> | Manually refresh tokens | UseOAuth2Return.refreshTokens | src/types/oauth.types.ts:349 |
getAccessToken | () => Promise<string> | Get current access token (auto-refresh if needed) | UseOAuth2Return.getAccessToken | src/types/oauth.types.ts:351 |
isTokenExpired | () => boolean | Check if tokens are expired | UseOAuth2Return.isTokenExpired | src/types/oauth.types.ts:353 |
clearAuth | () => void | Clear stored auth data | UseOAuth2Return.clearAuth | src/types/oauth.types.ts:355 |
PictureInPictureOptions
Defined in: src/composables/usePictureInPicture.ts:6
Options for the usePictureInPicture composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
persistPreference? | boolean | Whether to persist the user's PiP preference to localStorage Default false | src/composables/usePictureInPicture.ts:11 |
preferenceKey? | string | Key to use for localStorage when persisting preference Default 'vuesip-pip-preference' | src/composables/usePictureInPicture.ts:17 |
PiPWindowDimensions
Defined in: src/composables/usePictureInPicture.ts:23
Picture-in-Picture window dimensions
Properties
| Property | Type | Defined in |
|---|---|---|
width | number | src/composables/usePictureInPicture.ts:24 |
height | number | src/composables/usePictureInPicture.ts:25 |
UsePictureInPictureReturn
Defined in: src/composables/usePictureInPicture.ts:31
Return type for the usePictureInPicture composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
isPiPSupported | Ref<boolean> | Whether PiP is supported by the browser | src/composables/usePictureInPicture.ts:33 |
isPiPActive | Ref<boolean> | Whether PiP mode is currently active | src/composables/usePictureInPicture.ts:35 |
pipWindow | Ref<PictureInPictureWindow | null> | Current PiP window dimensions (null when not in PiP) | src/composables/usePictureInPicture.ts:37 |
enterPiP | () => Promise<void> | Enter PiP mode | src/composables/usePictureInPicture.ts:39 |
exitPiP | () => Promise<void> | Exit PiP mode | src/composables/usePictureInPicture.ts:41 |
togglePiP | () => Promise<void> | Toggle PiP mode | src/composables/usePictureInPicture.ts:43 |
error | Ref<Error | null> | Current error state | src/composables/usePictureInPicture.ts:45 |
UsePresenceReturn
Defined in: src/composables/usePresence.ts:29
Return type for usePresence composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
currentStatus | Ref<PresenceStatus | null> | Current user's presence status | src/composables/usePresence.ts:35 |
watchedUsers | Ref<Map<string, PresenceStatus>> | Map of watched users and their presence status | src/composables/usePresence.ts:37 |
subscriptions | Ref<Map<string, PresenceSubscription>> | Active subscriptions | src/composables/usePresence.ts:39 |
currentState | ComputedRef<PresenceState> | Current presence state | src/composables/usePresence.ts:41 |
subscriptionCount | ComputedRef<number> | Number of active subscriptions | src/composables/usePresence.ts:43 |
setStatus | (state, options?) => Promise<void> | Set own presence status | src/composables/usePresence.ts:50 |
subscribe | (uri, options?) => Promise<string> | Subscribe to user's presence | src/composables/usePresence.ts:52 |
unsubscribe | (uri) => Promise<void> | Unsubscribe from user's presence | src/composables/usePresence.ts:54 |
getStatus | (uri) => PresenceStatus | null | Get presence status for a specific user | src/composables/usePresence.ts:56 |
unsubscribeAll | () => Promise<void> | Unsubscribe from all watched users | src/composables/usePresence.ts:58 |
onPresenceEvent | (callback) => () => void | Listen for presence events | src/composables/usePresence.ts:60 |
UseSipClientReturn
Defined in: src/composables/useSipClient.ts:50
SIP Client composable return type
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
isConnected | ComputedRef<boolean> | Whether client is connected to SIP server | src/composables/useSipClient.ts:56 |
isRegistered | ComputedRef<boolean> | Whether client is registered with SIP server | src/composables/useSipClient.ts:59 |
connectionState | ComputedRef<ConnectionState> | Current connection state | src/composables/useSipClient.ts:62 |
registrationState | ComputedRef<RegistrationState> | Current registration state | src/composables/useSipClient.ts:65 |
registeredUri | ComputedRef<string | null> | Registered SIP URI | src/composables/useSipClient.ts:68 |
error | Ref<Error | null> | Current error message | src/composables/useSipClient.ts:71 |
isConnecting | ComputedRef<boolean> | Whether client is connecting | src/composables/useSipClient.ts:74 |
isDisconnecting | Ref<boolean> | Whether client is disconnecting | src/composables/useSipClient.ts:77 |
isStarted | ComputedRef<boolean> | Whether client is started | src/composables/useSipClient.ts:80 |
connect | () => Promise<void> | Start the SIP client and connect to server Throws If configuration is invalid or connection fails | src/composables/useSipClient.ts:90 |
disconnect | () => Promise<void> | Disconnect from SIP server and stop the client Throws If disconnect fails | src/composables/useSipClient.ts:96 |
register | () => Promise<void> | Register with SIP server Throws If not connected or registration fails | src/composables/useSipClient.ts:102 |
unregister | () => Promise<void> | Unregister from SIP server Throws If not registered or unregistration fails | src/composables/useSipClient.ts:108 |
updateConfig | (config) => ValidationResult | Update SIP client configuration Requires disconnect and reconnect to take effect | src/composables/useSipClient.ts:115 |
reconnect | () => Promise<void> | Reconnect to SIP server Performs disconnect followed by connect Throws If reconnection fails | src/composables/useSipClient.ts:122 |
getClient | () => SipClient | null | Get the underlying SIP client instance | src/composables/useSipClient.ts:128 |
getEventBus | () => EventBus | Get the event bus instance | src/composables/useSipClient.ts:134 |
RegistrationOptions
Defined in: src/composables/useSipRegistration.ts:22
Registration options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
expires? | number | Registration expiry time in seconds (default: 600) | src/composables/useSipRegistration.ts:24 |
maxRetries? | number | Maximum retry attempts before giving up (default: 3) | src/composables/useSipRegistration.ts:26 |
autoRefresh? | boolean | Enable automatic re-registration before expiry (default: true) | src/composables/useSipRegistration.ts:28 |
userAgent? | string | Custom User-Agent header | src/composables/useSipRegistration.ts:30 |
UseSipRegistrationReturn
Defined in: src/composables/useSipRegistration.ts:36
Return type for useSipRegistration composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
state | Ref<RegistrationState> | Current registration state | src/composables/useSipRegistration.ts:42 |
registeredUri | Ref<string | null> | Registered SIP URI | src/composables/useSipRegistration.ts:44 |
isRegistered | ComputedRef<boolean> | Whether currently registered | src/composables/useSipRegistration.ts:46 |
isRegistering | ComputedRef<boolean> | Whether registration is in progress | src/composables/useSipRegistration.ts:48 |
isUnregistering | ComputedRef<boolean> | Whether unregistration is in progress | src/composables/useSipRegistration.ts:50 |
hasRegistrationFailed | ComputedRef<boolean> | Whether registration has failed | src/composables/useSipRegistration.ts:52 |
expires | Ref<number> | Registration expiry time in seconds | src/composables/useSipRegistration.ts:54 |
lastRegistrationTime | Ref<Date | null> | Timestamp when registration was last successful | src/composables/useSipRegistration.ts:56 |
expiryTime | Ref<Date | null> | Timestamp when registration will expire | src/composables/useSipRegistration.ts:58 |
secondsUntilExpiry | ComputedRef<number> | Seconds remaining until registration expires | src/composables/useSipRegistration.ts:60 |
isExpiringSoon | ComputedRef<boolean> | Whether registration is about to expire (less than 30 seconds) | src/composables/useSipRegistration.ts:62 |
hasExpired | ComputedRef<boolean> | Whether registration has expired | src/composables/useSipRegistration.ts:64 |
retryCount | Ref<number> | Number of registration retry attempts | src/composables/useSipRegistration.ts:66 |
lastError | Ref<string | null> | Last registration error message | src/composables/useSipRegistration.ts:68 |
register | () => Promise<void> | Register with SIP server | src/composables/useSipRegistration.ts:75 |
unregister | () => Promise<void> | Unregister from SIP server | src/composables/useSipRegistration.ts:77 |
refresh | () => Promise<void> | Manually refresh registration | src/composables/useSipRegistration.ts:79 |
resetRetries | () => void | Reset retry count | src/composables/useSipRegistration.ts:81 |
getStatistics | () => RegistrationStatistics | Get registration statistics | src/composables/useSipRegistration.ts:83 |
VideoInsetOptions
Defined in: src/composables/useVideoInset.ts:16
Options for the useVideoInset composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
initialPosition? | InsetPosition | Initial position of the inset video Default 'bottom-right' | src/composables/useVideoInset.ts:21 |
initialSize? | InsetSize | Initial size preset Default 'medium' | src/composables/useVideoInset.ts:27 |
customWidth? | number | Custom width in pixels (used when size is 'custom') Default 160 | src/composables/useVideoInset.ts:33 |
customHeight? | number | Custom height in pixels (used when size is 'custom') Default 120 | src/composables/useVideoInset.ts:39 |
margin? | number | Margin from container edges in pixels Default 16 | src/composables/useVideoInset.ts:45 |
borderRadius? | number | Border radius in pixels Default 8 | src/composables/useVideoInset.ts:51 |
draggable? | boolean | Whether the inset can be dragged Default true | src/composables/useVideoInset.ts:57 |
showInitially? | boolean | Whether to show the inset initially Default true | src/composables/useVideoInset.ts:63 |
persistPreference? | boolean | Persist position/size to localStorage Default false | src/composables/useVideoInset.ts:69 |
preferenceKey? | string | Key for localStorage persistence Default 'vuesip-video-inset' | src/composables/useVideoInset.ts:75 |
InsetDimensions
Defined in: src/composables/useVideoInset.ts:81
Inset dimensions
Properties
| Property | Type | Defined in |
|---|---|---|
width | number | src/composables/useVideoInset.ts:82 |
height | number | src/composables/useVideoInset.ts:83 |
UseVideoInsetReturn
Defined in: src/composables/useVideoInset.ts:89
Return type for the useVideoInset composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
isVisible | Ref<boolean> | Whether inset is currently visible | src/composables/useVideoInset.ts:91 |
position | Ref<InsetPosition> | Current position of the inset | src/composables/useVideoInset.ts:93 |
size | Ref<InsetSize> | Current size preset | src/composables/useVideoInset.ts:95 |
dimensions | Ref<InsetDimensions> | Current dimensions in pixels | src/composables/useVideoInset.ts:97 |
isSwapped | Ref<boolean> | Whether videos are swapped (local is main, remote is inset) | src/composables/useVideoInset.ts:99 |
isDraggable | Ref<boolean> | Whether dragging is enabled | src/composables/useVideoInset.ts:101 |
isDragging | Ref<boolean> | Whether currently being dragged | src/composables/useVideoInset.ts:103 |
insetStyles | Ref<CSSProperties> | Computed CSS styles for the inset container | src/composables/useVideoInset.ts:105 |
show | () => void | Show the inset | src/composables/useVideoInset.ts:107 |
hide | () => void | Hide the inset | src/composables/useVideoInset.ts:109 |
toggle | () => void | Toggle inset visibility | src/composables/useVideoInset.ts:111 |
setPosition | (pos) => void | Set position | src/composables/useVideoInset.ts:113 |
setSize | (size) => void | Set size preset | src/composables/useVideoInset.ts:115 |
setCustomDimensions | (width, height) => void | Set custom dimensions | src/composables/useVideoInset.ts:117 |
swapVideos | () => void | Swap main and inset videos | src/composables/useVideoInset.ts:119 |
cyclePosition | () => void | Cycle through positions | src/composables/useVideoInset.ts:121 |
reset | () => void | Reset to initial settings | src/composables/useVideoInset.ts:123 |
VueSipOptions
Defined in: src/index.ts:347
Options for the VueSip Vue plugin.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
debug? | boolean | Enable debug mode Default false | src/index.ts:352 |
logLevel? | "error" | "debug" | "info" | "warn" | Logging level Default 'warn' | src/index.ts:358 |
sipConfig? | object | Global SIP configuration Can also be provided via ConfigProvider component | src/index.ts:364 |
sipConfig.uri? | string | - | src/index.ts:365 |
sipConfig.sipUri? | string | - | src/index.ts:366 |
sipConfig.password? | string | - | src/index.ts:367 |
sipConfig.displayName? | string | - | src/index.ts:368 |
sipConfig.autoRegister? | boolean | - | src/index.ts:369 |
mediaConfig? | object | Global media configuration | src/index.ts:376 |
mediaConfig.audioEnabled? | boolean | - | src/index.ts:377 |
mediaConfig.videoEnabled? | boolean | - | src/index.ts:378 |
userPreferences? | object | User preferences | src/index.ts:385 |
userPreferences.autoAnswer? | boolean | - | src/index.ts:386 |
userPreferences.recordCalls? | boolean | - | src/index.ts:387 |
logger? | Logger | Custom logger instance | src/index.ts:394 |
OAuth2ProviderContext
Defined in: src/providers/OAuth2Provider.ts:88
Provider context shape - what gets injected into children
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
authState | Ref<OAuth2AuthState> | Current authentication state | src/providers/OAuth2Provider.ts:90 |
isAuthenticated | ComputedRef<boolean> | Whether user is authenticated | src/providers/OAuth2Provider.ts:92 |
error | Ref<OAuth2Error | null> | Current error (null if none) | src/providers/OAuth2Provider.ts:94 |
userInfo | Ref<OAuth2UserInfo | null> | Current OAuth2 user info | src/providers/OAuth2Provider.ts:96 |
sipCredentials | Ref<ProvisionedSipCredentials | null> | Provisioned SIP credentials | src/providers/OAuth2Provider.ts:98 |
tokens | Ref<OAuth2TokenResponse | null> | Current OAuth2 tokens | src/providers/OAuth2Provider.ts:100 |
isInitialized | Ref<boolean> | Whether initialization is complete | src/providers/OAuth2Provider.ts:102 |
isRefreshing | Ref<boolean> | Whether token refresh is in progress | src/providers/OAuth2Provider.ts:104 |
login | (options?) => Promise<void> | Initiate OAuth2 login flow | src/providers/OAuth2Provider.ts:106 |
handleCallback | (url?) => Promise<ProvisionedSipCredentials> | Handle OAuth2 callback (after redirect) | src/providers/OAuth2Provider.ts:108 |
logout | () => Promise<void> | Logout and revoke tokens | src/providers/OAuth2Provider.ts:110 |
refreshTokens | () => Promise<OAuth2TokenResponse> | Manually refresh tokens | src/providers/OAuth2Provider.ts:112 |
getAccessToken | () => Promise<string> | Get current access token (auto-refresh if needed) | src/providers/OAuth2Provider.ts:114 |
OAuth2ProviderProps
Defined in: src/providers/OAuth2Provider.ts:136
OAuth2Provider component props
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
config | OAuth2ServiceConfig | OAuth2 service configuration | src/providers/OAuth2Provider.ts:138 |
autoInitialize? | boolean | Auto-initialize on mount (restore session) | src/providers/OAuth2Provider.ts:140 |
autoHandleCallback? | boolean | Auto-handle callback if on callback URL | src/providers/OAuth2Provider.ts:142 |
callbackPath? | string | Callback path to detect | src/providers/OAuth2Provider.ts:144 |
postAuthRedirect? | string | Redirect after successful authentication | src/providers/OAuth2Provider.ts:146 |
SipClientProviderContext
Defined in: src/providers/SipClientProvider.ts:77
Provider context shape - what gets injected into children
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
client | Ref<SipClient | null> | SIP client instance (null if not initialized) | src/providers/SipClientProvider.ts:79 |
eventBus | Ref<EventBus> | Event bus instance for subscribing to events | src/providers/SipClientProvider.ts:81 |
connectionState | Ref<ConnectionState> | Current connection state | src/providers/SipClientProvider.ts:83 |
registrationState | Ref<RegistrationState> | Current registration state | src/providers/SipClientProvider.ts:85 |
isReady | Ref<boolean> | Whether client is ready to use | src/providers/SipClientProvider.ts:87 |
error | Ref<Error | null> | Current error (null if no error) | src/providers/SipClientProvider.ts:89 |
connect | () => Promise<void> | Programmatically connect to SIP server | src/providers/SipClientProvider.ts:91 |
disconnect | () => Promise<void> | Programmatically disconnect from SIP server | src/providers/SipClientProvider.ts:93 |
StorageOptions
Defined in: src/providers/credentialStorage.ts:11
Storage configuration options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
key? | string | Custom storage key (default: 'vuesip_credentials') | src/providers/credentialStorage.ts:13 |
CredentialStorage
Defined in: src/providers/credentialStorage.ts:17
Credential storage interface
Methods
save()
save(credentials): void;Defined in: src/providers/credentialStorage.ts:19
Save credentials to storage
Parameters
| Parameter | Type |
|---|---|
credentials | StoredCredentials |
Returns
void
load()
load(): StoredCredentials | null;Defined in: src/providers/credentialStorage.ts:21
Load credentials from storage
Returns
StoredCredentials | null
clear()
clear(): void;Defined in: src/providers/credentialStorage.ts:23
Clear stored credentials
Returns
void
ProviderRegisterOptions
Defined in: src/providers/providerRegistry.ts:11
Options for provider registration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
force? | boolean | Force overwrite if provider already exists | src/providers/providerRegistry.ts:13 |
SelectOption
Defined in: src/providers/types.ts:11
Option for select fields
Properties
| Property | Type | Defined in |
|---|---|---|
label | string | src/providers/types.ts:12 |
value | string | src/providers/types.ts:13 |
ProviderField
Defined in: src/providers/types.ts:17
Field definition for provider login forms
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name | string | Field identifier (e.g., 'username', 'password', 'domain') | src/providers/types.ts:19 |
label | string | Display label (e.g., 'SIP Username') | src/providers/types.ts:21 |
type | "text" | "password" | "select" | Input type | src/providers/types.ts:23 |
placeholder? | string | Placeholder text | src/providers/types.ts:25 |
required? | boolean | Whether field is required | src/providers/types.ts:27 |
helpText? | string | Help text shown below field | src/providers/types.ts:29 |
helpUrl? | string | Link to provider documentation | src/providers/types.ts:31 |
options? | SelectOption[] | Options for select fields | src/providers/types.ts:33 |
SipCredentials
Defined in: src/providers/types.ts:37
Credentials passed to useSipClient
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | WebSocket URL | src/providers/types.ts:39 |
sipUri | string | SIP URI (sip:user@domain) | src/providers/types.ts:41 |
password | string | SIP password | src/providers/types.ts:43 |
displayName? | string | Display name for caller ID | src/providers/types.ts:45 |
ProviderConfig
Defined in: src/providers/types.ts:49
Config-only provider definition (simple providers)
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique identifier (e.g., '46elks') | src/providers/types.ts:51 |
name | string | Display name (e.g., '46 elks') | src/providers/types.ts:53 |
logo? | string | Provider logo URL or data URI | src/providers/types.ts:55 |
websocketUrl | string | Default WebSocket URL (can be empty if user provides) | src/providers/types.ts:57 |
fields | ProviderField[] | Form fields for this provider | src/providers/types.ts:59 |
mapCredentials | (input) => SipCredentials | Transform user input to SIP credentials | src/providers/types.ts:61 |
OAuthConfig
Defined in: src/providers/types.ts:65
OAuth configuration for providers that support it
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
authUrl | string | OAuth authorization URL | src/providers/types.ts:67 |
tokenUrl | string | OAuth token URL | src/providers/types.ts:69 |
clientId | string | OAuth client ID | src/providers/types.ts:71 |
scopes | string[] | Required OAuth scopes | src/providers/types.ts:73 |
ProviderAdapter
Defined in: src/providers/types.ts:77
Full adapter interface (complex providers like Twilio)
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
id | string | Unique identifier (e.g., '46elks') | ProviderConfig.id | src/providers/types.ts:51 |
name | string | Display name (e.g., '46 elks') | ProviderConfig.name | src/providers/types.ts:53 |
logo? | string | Provider logo URL or data URI | ProviderConfig.logo | src/providers/types.ts:55 |
websocketUrl | string | Default WebSocket URL (can be empty if user provides) | ProviderConfig.websocketUrl | src/providers/types.ts:57 |
fields | ProviderField[] | Form fields for this provider | ProviderConfig.fields | src/providers/types.ts:59 |
mapCredentials | (input) => SipCredentials | Transform user input to SIP credentials | ProviderConfig.mapCredentials | src/providers/types.ts:61 |
connect? | (credentials, sipClient) => Promise<void> | Override connection behavior if needed | - | src/providers/types.ts:79 |
oauth? | OAuthConfig | OAuth flow support | - | src/providers/types.ts:81 |
ProviderSelectorOptions
Defined in: src/providers/types.ts:88
Composable options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
storage? | StorageType | Storage type for credentials (default: 'local') | src/providers/types.ts:90 |
defaultProvider? | string | Default provider ID (default: 'own-pbx') | src/providers/types.ts:92 |
providers? | ProviderConfig[] | Override or extend built-in providers | src/providers/types.ts:94 |
StoredCredentials
Defined in: src/providers/types.ts:98
Stored credential data
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
providerId | string | Provider ID | src/providers/types.ts:100 |
values | Record<string, string> | Credential values keyed by field name | src/providers/types.ts:102 |
storedAt | number | Timestamp when stored | src/providers/types.ts:104 |
UseProviderSelectorReturn
Defined in: src/providers/useProviderSelector.ts:21
Return type for useProviderSelector composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
providers | ComputedRef<ProviderConfig[]> | List of all available providers (computed ref) | src/providers/useProviderSelector.ts:23 |
selectedProvider | Ref<ProviderConfig | null> | Currently selected provider (ref) | src/providers/useProviderSelector.ts:25 |
credentials | Record<string, string> | Current credential values (reactive object) | src/providers/useProviderSelector.ts:27 |
isConfigured | ComputedRef<boolean> | Whether all required fields are filled (computed ref) | src/providers/useProviderSelector.ts:29 |
selectProvider | (providerId) => void | Select a provider by ID | src/providers/useProviderSelector.ts:31 |
updateCredential | (field, value) => void | Update a credential field value | src/providers/useProviderSelector.ts:33 |
saveCredentials | () => void | Save credentials to storage | src/providers/useProviderSelector.ts:35 |
clearCredentials | () => void | Clear stored credentials and reset values | src/providers/useProviderSelector.ts:37 |
getSipConfig | () => SipCredentials | null | Get SIP config for useSipClient | src/providers/useProviderSelector.ts:39 |
PersistenceOptions
Defined in: src/storage/persistence.ts:19
Options for store persistence
Type Parameters
| Type Parameter |
|---|
T |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
adapter | StorageAdapter | Storage adapter to use | src/storage/persistence.ts:21 |
key | string | Storage key | src/storage/persistence.ts:23 |
getState | () => T | State getter function | src/storage/persistence.ts:25 |
setState | (state) => void | State setter function | src/storage/persistence.ts:27 |
watchSource? | WatchSource<T> | Watch source for automatic save | src/storage/persistence.ts:29 |
debounce? | number | Debounce delay for automatic saves (ms, default: 300) | src/storage/persistence.ts:31 |
autoLoad? | boolean | Whether to load state on initialization (default: true) | src/storage/persistence.ts:33 |
serialize? | (state) => unknown | Transform function for serialization (optional) | src/storage/persistence.ts:35 |
deserialize? | (data) => T | Transform function for deserialization (optional) | src/storage/persistence.ts:37 |
PersistenceConfig
Defined in: src/stores/persistence.ts:25
Persistence configuration options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
storage? | StorageConfig | Storage configuration (prefix, version, encryption) | src/stores/persistence.ts:27 |
encryptionPassword? | string | Encryption password for sensitive data | src/stores/persistence.ts:29 |
enabled? | boolean | Enable persistence (default: true) | src/stores/persistence.ts:31 |
autoLoad? | boolean | Auto-load state on initialization (default: true) | src/stores/persistence.ts:33 |
debounce? | number | Debounce delay for saves in ms (default: 300) | src/stores/persistence.ts:35 |
WhisperProviderOptions
Defined in: src/transcription/providers/whisper.ts:24
Whisper provider configuration options
Extends
Indexable
[key: string]: unknownAdditional provider-specific options
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
serverUrl? | string | WebSocket server URL (e.g., 'ws://localhost:8765/transcribe') | - | src/transcription/providers/whisper.ts:26 |
model? | "medium" | "small" | "base" | "large" | "tiny" | "large-v2" | "large-v3" | Whisper model to use (tiny, base, small, medium, large) | - | src/transcription/providers/whisper.ts:28 |
sampleRate? | number | Audio sample rate in Hz (default: 16000) | - | src/transcription/providers/whisper.ts:30 |
chunkDuration? | number | Chunk duration in milliseconds (default: 1000) | - | src/transcription/providers/whisper.ts:32 |
autoReconnect? | boolean | Enable automatic reconnection (default: true) | - | src/transcription/providers/whisper.ts:34 |
maxReconnectAttempts? | number | Maximum reconnection attempts (default: 5) | - | src/transcription/providers/whisper.ts:36 |
reconnectDelay? | number | Initial reconnection delay in ms (default: 1000) | - | src/transcription/providers/whisper.ts:38 |
apiKey? | string | API key (for cloud providers) | ProviderOptions.apiKey | src/types/transcription.types.ts:132 |
language? | string | Language code | ProviderOptions.language | src/types/transcription.types.ts:134 |
interimResults? | boolean | Enable interim results | ProviderOptions.interimResults | src/types/transcription.types.ts:136 |
endpoint? | string | Custom endpoint URL | ProviderOptions.endpoint | src/types/transcription.types.ts:138 |
ActiveSpeakerOptions
Defined in: src/types/active-speaker.types.ts:12
Active speaker detection options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
threshold? | number | Audio level threshold to consider someone speaking (0-1). Default: 0.15 | src/types/active-speaker.types.ts:14 |
debounceMs? | number | Debounce time in ms to prevent rapid speaker switching. Default: 300 | src/types/active-speaker.types.ts:16 |
historySize? | number | Number of recent speakers to track in history. Default: 10 | src/types/active-speaker.types.ts:18 |
excludeMuted? | boolean | Exclude muted participants from detection. Default: true | src/types/active-speaker.types.ts:20 |
onSpeakerChange? | (speaker, previous) => void | Callback when active speaker changes | src/types/active-speaker.types.ts:22 |
SpeakerHistoryEntry
Defined in: src/types/active-speaker.types.ts:28
Speaker history entry
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
participantId | string | Participant ID | src/types/active-speaker.types.ts:30 |
displayName | string | Display name at time of speaking | src/types/active-speaker.types.ts:32 |
startedAt | number | When they started speaking | src/types/active-speaker.types.ts:34 |
endedAt | number | null | When they stopped speaking (null if still speaking) | src/types/active-speaker.types.ts:36 |
peakLevel | number | Peak audio level during this speaking period | src/types/active-speaker.types.ts:38 |
UseActiveSpeakerReturn
Defined in: src/types/active-speaker.types.ts:44
Return type for useActiveSpeaker composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activeSpeaker | ComputedRef<Participant | null> | Current dominant speaker (highest audio level above threshold) | src/types/active-speaker.types.ts:46 |
activeSpeakers | ComputedRef<Participant[]> | All participants currently speaking (above threshold) | src/types/active-speaker.types.ts:48 |
isSomeoneSpeaking | ComputedRef<boolean> | Is anyone currently speaking | src/types/active-speaker.types.ts:50 |
speakerHistory | Ref<SpeakerHistoryEntry[]> | Recent speaker history | src/types/active-speaker.types.ts:52 |
clearHistory | () => void | Clear speaker history | src/types/active-speaker.types.ts:54 |
setThreshold | (threshold) => void | Update threshold dynamically | src/types/active-speaker.types.ts:56 |
BlockEntry
Defined in: src/types/blacklist.types.ts:36
Block entry representing a blocked number
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
number | string | Phone number or pattern (supports wildcards like 1800*) | src/types/blacklist.types.ts:38 |
reason | BlockReason | Reason for blocking | src/types/blacklist.types.ts:40 |
action | BlockAction | Action to take when call from this number is received | src/types/blacklist.types.ts:42 |
description? | string | Optional description or notes | src/types/blacklist.types.ts:44 |
blockedAt | Date | When the number was blocked | src/types/blacklist.types.ts:46 |
expiresAt? | Date | When the block expires (optional, undefined = permanent) | src/types/blacklist.types.ts:48 |
blockedBy? | string | Who blocked the number (extension or system) | src/types/blacklist.types.ts:50 |
status | BlockStatus | Current status | src/types/blacklist.types.ts:52 |
blockedCount | number | Number of blocked call attempts from this number | src/types/blacklist.types.ts:54 |
lastBlockedAt? | Date | Last time a call was blocked from this number | src/types/blacklist.types.ts:56 |
CallQualityScore
Defined in: src/types/call-quality.types.ts:22
Comprehensive call quality score combining multiple metrics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
overall | number | Overall score 0-100 | src/types/call-quality.types.ts:24 |
audio | number | Audio quality score 0-100 | src/types/call-quality.types.ts:26 |
video | number | null | Video quality score 0-100 (null if audio-only) | src/types/call-quality.types.ts:28 |
network | number | Network stability score 0-100 | src/types/call-quality.types.ts:30 |
grade | QualityGrade | Quality grade | src/types/call-quality.types.ts:32 |
description | string | Human-readable quality description | src/types/call-quality.types.ts:34 |
timestamp | number | Timestamp of score calculation | src/types/call-quality.types.ts:36 |
QualityScoreWeights
Defined in: src/types/call-quality.types.ts:43
Quality score weights for different metrics All weights should sum to 1.0
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
packetLoss | number | Weight for packet loss impact (0-1) | src/types/call-quality.types.ts:45 |
jitter | number | Weight for jitter impact (0-1) | src/types/call-quality.types.ts:47 |
rtt | number | Weight for round-trip time impact (0-1) | src/types/call-quality.types.ts:49 |
mos | number | Weight for MOS score impact (0-1) | src/types/call-quality.types.ts:51 |
bitrateStability | number | Weight for bitrate stability impact (0-1) | src/types/call-quality.types.ts:53 |
QualityTrend
Defined in: src/types/call-quality.types.ts:75
Quality trend over time
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
direction | QualityTrendDirection | Direction of quality change | src/types/call-quality.types.ts:77 |
rate | number | Rate of change (-100 to 100, negative = degrading) | src/types/call-quality.types.ts:79 |
confidence | number | Confidence in trend (0-1, higher = more certain) | src/types/call-quality.types.ts:81 |
CallQualityScoreOptions
Defined in: src/types/call-quality.types.ts:87
Options for useCallQualityScore composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
weights? | Partial<QualityScoreWeights> | Custom weight configuration (partial, will be merged with defaults) | src/types/call-quality.types.ts:89 |
historySize? | number | History size for trend calculation Default 10 | src/types/call-quality.types.ts:91 |
updateInterval? | number | Update interval in ms Default 1000 | src/types/call-quality.types.ts:93 |
enableTrendAnalysis? | boolean | Enable trend analysis Default true | src/types/call-quality.types.ts:95 |
QualityScoreInput
Defined in: src/types/call-quality.types.ts:101
Input stats for quality score calculation
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
packetLoss? | number | Packet loss percentage (0-100) | src/types/call-quality.types.ts:103 |
jitter? | number | Jitter in milliseconds | src/types/call-quality.types.ts:105 |
rtt? | number | Round-trip time in milliseconds | src/types/call-quality.types.ts:107 |
mos? | number | MOS score (1-5) | src/types/call-quality.types.ts:109 |
bitrate? | number | Current bitrate in kbps | src/types/call-quality.types.ts:111 |
previousBitrate? | number | Previous bitrate for stability calculation | src/types/call-quality.types.ts:113 |
audioPacketLoss? | number | Audio-specific packet loss | src/types/call-quality.types.ts:115 |
audioJitterBufferDelay? | number | Audio jitter buffer delay in ms | src/types/call-quality.types.ts:117 |
videoPacketLoss? | number | Video packet loss | src/types/call-quality.types.ts:119 |
framerate? | number | Video framerate | src/types/call-quality.types.ts:121 |
targetFramerate? | number | Target framerate | src/types/call-quality.types.ts:123 |
resolutionWidth? | number | Video resolution width | src/types/call-quality.types.ts:125 |
resolutionHeight? | number | Video resolution height | src/types/call-quality.types.ts:127 |
freezeCount? | number | Number of freeze events | src/types/call-quality.types.ts:129 |
audioOnly? | boolean | Whether this is an audio-only call | src/types/call-quality.types.ts:131 |
UseCallQualityScoreReturn
Defined in: src/types/call-quality.types.ts:137
Return type for useCallQualityScore composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
score | Ref<CallQualityScore | null, CallQualityScore | null> | Current quality score (null if no stats available) | src/types/call-quality.types.ts:139 |
trend | Ref<QualityTrend | null, QualityTrend | null> | Quality trend (null if insufficient history) | src/types/call-quality.types.ts:141 |
history | Ref<CallQualityScore[], CallQualityScore[]> | Score history for charting | src/types/call-quality.types.ts:143 |
updateScore | (input) => void | Update score with new stats | src/types/call-quality.types.ts:145 |
reset | () => void | Clear history and reset | src/types/call-quality.types.ts:147 |
weights | Ref<QualityScoreWeights, QualityScoreWeights> | Current weights being used | src/types/call-quality.types.ts:149 |
NetworkDetails
Defined in: src/types/call-quality.types.ts:180
Detailed network metrics for tooltip display
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
rtt | number | Round-trip time in ms | src/types/call-quality.types.ts:182 |
jitter | number | Jitter in ms | src/types/call-quality.types.ts:184 |
packetLoss | number | Packet loss percentage (0-100) | src/types/call-quality.types.ts:186 |
bandwidth | number | Available bandwidth estimate in kbps | src/types/call-quality.types.ts:188 |
connectionType | string | Connection type (relay/srflx/host/prflx) | src/types/call-quality.types.ts:190 |
NetworkQualityIndicatorData
Defined in: src/types/call-quality.types.ts:196
Network quality indicator data for UI
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
level | NetworkQualityLevel | Current quality level | src/types/call-quality.types.ts:198 |
bars | SignalBars | Signal strength bars (1-5) | src/types/call-quality.types.ts:200 |
color | string | Color for UI (CSS color value) | src/types/call-quality.types.ts:202 |
icon | NetworkQualityIcon | Icon name suggestion | src/types/call-quality.types.ts:204 |
ariaLabel | string | Accessibility label | src/types/call-quality.types.ts:206 |
details | NetworkDetails | Detailed metrics for tooltip | src/types/call-quality.types.ts:208 |
NetworkQualityThresholds
Defined in: src/types/call-quality.types.ts:231
Thresholds for network quality level determination
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
rtt | [number, number, number, number] | RTT thresholds in ms [excellent, good, fair, poor] | src/types/call-quality.types.ts:233 |
packetLoss | [number, number, number, number] | Packet loss thresholds in % [excellent, good, fair, poor] | src/types/call-quality.types.ts:235 |
jitter | [number, number, number, number] | Jitter thresholds in ms [excellent, good, fair, poor] | src/types/call-quality.types.ts:237 |
NetworkQualityIndicatorOptions
Defined in: src/types/call-quality.types.ts:252
Options for useNetworkQualityIndicator composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
updateInterval? | number | Update interval in ms Default 1000 | src/types/call-quality.types.ts:254 |
colors? | Partial<NetworkQualityColors> | Custom color scheme | src/types/call-quality.types.ts:256 |
estimateBandwidth? | boolean | Enable bandwidth estimation Default true | src/types/call-quality.types.ts:258 |
thresholds? | Partial<NetworkQualityThresholds> | Custom thresholds | src/types/call-quality.types.ts:260 |
NetworkQualityInput
Defined in: src/types/call-quality.types.ts:266
Input for network quality indicator
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
rtt? | number | Round-trip time in ms | src/types/call-quality.types.ts:268 |
jitter? | number | Jitter in ms | src/types/call-quality.types.ts:270 |
packetLoss? | number | Packet loss percentage (0-100) | src/types/call-quality.types.ts:272 |
bitrate? | number | Current bitrate in kbps (for bandwidth estimation) | src/types/call-quality.types.ts:274 |
availableOutgoingBitrate? | number | Available outgoing bitrate from BWE | src/types/call-quality.types.ts:276 |
candidateType? | string | ICE candidate pair type | src/types/call-quality.types.ts:278 |
UseNetworkQualityIndicatorReturn
Defined in: src/types/call-quality.types.ts:284
Return type for useNetworkQualityIndicator composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
indicator | Ref<NetworkQualityIndicatorData, NetworkQualityIndicatorData> | Current indicator data | src/types/call-quality.types.ts:286 |
isAvailable | Ref<boolean, boolean> | Whether data is available | src/types/call-quality.types.ts:288 |
update | (input) => void | Update indicator with new stats | src/types/call-quality.types.ts:290 |
reset | () => void | Reset to unknown state | src/types/call-quality.types.ts:292 |
AdaptationSuggestion
Defined in: src/types/call-quality.types.ts:317
Specific adaptation suggestion
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | SuggestionType | Type of suggestion | src/types/call-quality.types.ts:319 |
message | string | Suggestion text for display | src/types/call-quality.types.ts:321 |
current | string | Current value description | src/types/call-quality.types.ts:323 |
recommended | string | Recommended value description | src/types/call-quality.types.ts:325 |
impact | number | Impact on quality improvement (0-100) | src/types/call-quality.types.ts:327 |
BandwidthRecommendation
Defined in: src/types/call-quality.types.ts:333
Bandwidth adaptation recommendation
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
action | BandwidthAction | Recommended action | src/types/call-quality.types.ts:335 |
suggestions | AdaptationSuggestion[] | Specific recommendations ordered by impact | src/types/call-quality.types.ts:337 |
priority | RecommendationPriority | Priority level | src/types/call-quality.types.ts:339 |
estimatedImprovement | number | Estimated quality improvement if applied (0-100) | src/types/call-quality.types.ts:341 |
timestamp | number | Timestamp of recommendation | src/types/call-quality.types.ts:343 |
VideoResolution
Defined in: src/types/call-quality.types.ts:349
Video resolution preset
Properties
| Property | Type | Defined in |
|---|---|---|
width | number | src/types/call-quality.types.ts:350 |
height | number | src/types/call-quality.types.ts:351 |
label | string | src/types/call-quality.types.ts:352 |
BandwidthConstraints
Defined in: src/types/call-quality.types.ts:369
Bandwidth adaptation constraints
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
minVideoBitrate? | number | Minimum acceptable video bitrate in kbps Default 100 | src/types/call-quality.types.ts:371 |
maxVideoBitrate? | number | Maximum video bitrate in kbps Default 2500 | src/types/call-quality.types.ts:373 |
minAudioBitrate? | number | Minimum audio bitrate in kbps Default 16 | src/types/call-quality.types.ts:375 |
maxAudioBitrate? | number | Maximum audio bitrate in kbps Default 128 | src/types/call-quality.types.ts:377 |
targetFramerate? | number | Target framerate Default 30 | src/types/call-quality.types.ts:379 |
minFramerate? | number | Minimum acceptable framerate Default 15 | src/types/call-quality.types.ts:381 |
minResolution? | VideoResolution | Minimum acceptable resolution | src/types/call-quality.types.ts:383 |
preferredResolution? | VideoResolution | Preferred resolution | src/types/call-quality.types.ts:385 |
BandwidthAdaptationOptions
Defined in: src/types/call-quality.types.ts:405
Options for useBandwidthAdaptation composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
constraints? | BandwidthConstraints | Constraints for adaptation | src/types/call-quality.types.ts:407 |
sensitivity? | number | Adaptation sensitivity (0-1, higher = more reactive) Default 0.5 | src/types/call-quality.types.ts:409 |
autoAdapt? | boolean | Enable automatic adaptation (vs recommendation only) Default false | src/types/call-quality.types.ts:411 |
onRecommendation? | (rec) => void | Callback when recommendation changes | src/types/call-quality.types.ts:413 |
historySize? | number | History size for smoothing Default 5 | src/types/call-quality.types.ts:415 |
BandwidthAdaptationInput
Defined in: src/types/call-quality.types.ts:421
Input for bandwidth adaptation
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
availableBitrate? | number | Available outgoing bitrate in kbps | src/types/call-quality.types.ts:423 |
currentBitrate? | number | Current send bitrate in kbps | src/types/call-quality.types.ts:425 |
packetLoss? | number | Packet loss percentage | src/types/call-quality.types.ts:427 |
rtt? | number | Round-trip time in ms | src/types/call-quality.types.ts:429 |
currentResolution? | VideoResolution | Current video resolution | src/types/call-quality.types.ts:431 |
currentFramerate? | number | Current framerate | src/types/call-quality.types.ts:433 |
currentAudioBitrate? | number | Current audio bitrate | src/types/call-quality.types.ts:435 |
videoEnabled? | boolean | Whether video is enabled | src/types/call-quality.types.ts:437 |
degradationEvents? | number | Number of recent quality degradation events | src/types/call-quality.types.ts:439 |
UseBandwidthAdaptationReturn
Defined in: src/types/call-quality.types.ts:445
Return type for useBandwidthAdaptation composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
recommendation | Ref<BandwidthRecommendation, BandwidthRecommendation> | Current recommendation | src/types/call-quality.types.ts:447 |
isAutoAdapting | Ref<boolean, boolean> | Whether auto-adaptation is enabled | src/types/call-quality.types.ts:449 |
constraints | Ref<Required<BandwidthConstraints>, Required<BandwidthConstraints>> | Current constraints | src/types/call-quality.types.ts:451 |
update | (input) => void | Update with new stats | src/types/call-quality.types.ts:453 |
setAutoAdapt | (enabled) => void | Enable/disable auto-adaptation | src/types/call-quality.types.ts:455 |
setConstraints | (constraints) => void | Update constraints | src/types/call-quality.types.ts:457 |
reset | () => void | Reset to defaults | src/types/call-quality.types.ts:459 |
applySuggestion | (suggestion) => void | Apply a specific suggestion manually | src/types/call-quality.types.ts:461 |
CallOptions
Defined in: src/types/call.types.ts:77
Call options for making a call
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | boolean | MediaTrackConstraints | Enable audio (shorthand for mediaConstraints.audio) | src/types/call.types.ts:79 |
video? | boolean | MediaTrackConstraints | Enable video (shorthand for mediaConstraints.video) | src/types/call.types.ts:81 |
mediaConstraints? | object | Media constraints (detailed configuration) | src/types/call.types.ts:83 |
mediaConstraints.audio? | boolean | MediaTrackConstraints | - | src/types/call.types.ts:84 |
mediaConstraints.video? | boolean | MediaTrackConstraints | - | src/types/call.types.ts:85 |
rtcConfiguration? | RTCConfiguration | RTC configuration override | src/types/call.types.ts:88 |
extraHeaders? | string[] | Custom SIP headers | src/types/call.types.ts:90 |
anonymous? | boolean | Anonymous call | src/types/call.types.ts:92 |
sessionTimers? | boolean | Enable session timers | src/types/call.types.ts:94 |
sessionTimersExpires? | number | Session timers expiry (seconds) | src/types/call.types.ts:96 |
pcmaCodecOnly? | boolean | PCMA codec only | src/types/call.types.ts:98 |
AnswerOptions
Defined in: src/types/call.types.ts:104
Answer options for incoming calls
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | boolean | MediaTrackConstraints | Enable audio (shorthand for mediaConstraints.audio) | src/types/call.types.ts:106 |
video? | boolean | MediaTrackConstraints | Enable video (shorthand for mediaConstraints.video) | src/types/call.types.ts:108 |
mediaConstraints? | object | Media constraints (detailed configuration) | src/types/call.types.ts:110 |
mediaConstraints.audio? | boolean | MediaTrackConstraints | - | src/types/call.types.ts:111 |
mediaConstraints.video? | boolean | MediaTrackConstraints | - | src/types/call.types.ts:112 |
rtcConfiguration? | RTCConfiguration | RTC configuration override | src/types/call.types.ts:115 |
extraHeaders? | string[] | Custom SIP headers | src/types/call.types.ts:117 |
DTMFOptions
Defined in: src/types/call.types.ts:123
DTMF options
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
duration? | number | Duration of the tone in milliseconds (default: 100) | src/types/call.types.ts:125 |
interToneGap? | number | Inter-tone gap in milliseconds (default: 70) | src/types/call.types.ts:127 |
transportType? | "INFO" | "RFC2833" | Transport type | src/types/call.types.ts:129 |
transport? | "INFO" | "RFC2833" | Transport type (alias for transportType) | src/types/call.types.ts:131 |
CallTimingInfo
Defined in: src/types/call.types.ts:137
Call timing information
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
startTime? | Date | Time when call was initiated | src/types/call.types.ts:139 |
answerTime? | Date | Time when call was answered | src/types/call.types.ts:141 |
endTime? | Date | Time when call ended | src/types/call.types.ts:143 |
duration? | number | Call duration in seconds | src/types/call.types.ts:145 |
ringDuration? | number | Ring duration in seconds | src/types/call.types.ts:147 |
CallStatistics
Defined in: src/types/call.types.ts:153
Call statistics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | object | Audio statistics | src/types/call.types.ts:155 |
audio.bytesSent? | number | Bytes sent | src/types/call.types.ts:157 |
audio.bytesReceived? | number | Bytes received | src/types/call.types.ts:159 |
audio.packetsSent? | number | Packets sent | src/types/call.types.ts:161 |
audio.packetsReceived? | number | Packets received | src/types/call.types.ts:163 |
audio.packetsLost? | number | Packets lost | src/types/call.types.ts:165 |
audio.jitter? | number | Jitter in seconds | src/types/call.types.ts:167 |
audio.roundTripTime? | number | Round trip time in seconds | src/types/call.types.ts:169 |
audio.audioLevel? | number | Audio level (0-1) | src/types/call.types.ts:171 |
audio.codecName? | string | Codec name | src/types/call.types.ts:173 |
video? | object | Video statistics | src/types/call.types.ts:176 |
video.bytesSent? | number | Bytes sent | src/types/call.types.ts:178 |
video.bytesReceived? | number | Bytes received | src/types/call.types.ts:180 |
video.packetsSent? | number | Packets sent | src/types/call.types.ts:182 |
video.packetsReceived? | number | Packets received | src/types/call.types.ts:184 |
video.packetsLost? | number | Packets lost | src/types/call.types.ts:186 |
video.frameRate? | number | Frame rate | src/types/call.types.ts:188 |
video.frameWidth? | number | Frame width | src/types/call.types.ts:190 |
video.frameHeight? | number | Frame height | src/types/call.types.ts:192 |
video.codecName? | string | Codec name | src/types/call.types.ts:194 |
network? | object | Network statistics | src/types/call.types.ts:197 |
network.currentRoundTripTime? | number | Current round trip time | src/types/call.types.ts:199 |
network.availableOutgoingBitrate? | number | Available outgoing bitrate | src/types/call.types.ts:201 |
network.availableIncomingBitrate? | number | Available incoming bitrate | src/types/call.types.ts:203 |
CallEvent
Defined in: src/types/call.types.ts:250
Call event
Extended by
CallProgressEventCallFailedEventCallEndedEventCallAcceptedEventCallConfirmedEventCallHoldEventCallMuteEvent
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | string | Event type | src/types/call.types.ts:252 |
session | CallSession | Call session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | src/types/call.types.ts:258 |
originator? | "local" | "remote" | "system" | Event originator (local, remote, or system) - present in hold/unhold/ended events | src/types/call.types.ts:260 |
error? | string | Error message - present in failed events | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | src/types/call.types.ts:274 |
CallProgressEvent
Defined in: src/types/call.types.ts:280
Call progress event (provisional responses)
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
originator? | "local" | "remote" | "system" | Event originator (local, remote, or system) - present in hold/unhold/ended events | - | CallEvent.originator | src/types/call.types.ts:260 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "progress" | Event type | CallEvent.type | - | src/types/call.types.ts:281 |
responseCode | number | Response code (e.g., 180, 183) | - | - | src/types/call.types.ts:283 |
reasonPhrase | string | Reason phrase | - | - | src/types/call.types.ts:285 |
CallFailedEvent
Defined in: src/types/call.types.ts:291
Call failed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
originator? | "local" | "remote" | "system" | Event originator (local, remote, or system) - present in hold/unhold/ended events | - | CallEvent.originator | src/types/call.types.ts:260 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "failed" | Event type | CallEvent.type | - | src/types/call.types.ts:292 |
cause | TerminationCause | Termination cause | - | - | src/types/call.types.ts:294 |
responseCode? | number | Response code | - | - | src/types/call.types.ts:296 |
reasonPhrase? | string | Reason phrase | - | - | src/types/call.types.ts:298 |
message? | string | Error message | - | - | src/types/call.types.ts:300 |
CallEndedEvent
Defined in: src/types/call.types.ts:306
Call ended event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "ended" | Event type | CallEvent.type | - | src/types/call.types.ts:307 |
cause | TerminationCause | Termination cause | - | - | src/types/call.types.ts:309 |
originator | "local" | "remote" | "system" | Originator of the BYE | CallEvent.originator | - | src/types/call.types.ts:311 |
CallAcceptedEvent
Defined in: src/types/call.types.ts:317
Call accepted event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
originator? | "local" | "remote" | "system" | Event originator (local, remote, or system) - present in hold/unhold/ended events | - | CallEvent.originator | src/types/call.types.ts:260 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "accepted" | Event type | CallEvent.type | - | src/types/call.types.ts:318 |
responseCode | number | Response code | - | - | src/types/call.types.ts:320 |
CallConfirmedEvent
Defined in: src/types/call.types.ts:326
Call confirmed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
originator? | "local" | "remote" | "system" | Event originator (local, remote, or system) - present in hold/unhold/ended events | - | CallEvent.originator | src/types/call.types.ts:260 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "confirmed" | Event type | CallEvent.type | - | src/types/call.types.ts:327 |
CallHoldEvent
Defined in: src/types/call.types.ts:333
Call hold event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "hold" | "unhold" | Event type | CallEvent.type | - | src/types/call.types.ts:334 |
originator | "local" | "remote" | Originator of the hold/unhold | CallEvent.originator | - | src/types/call.types.ts:336 |
CallMuteEvent
Defined in: src/types/call.types.ts:342
Call mute event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
session | CallSession | Call session | - | CallEvent.session | src/types/call.types.ts:254 |
originalEvent? | unknown | Original event data | - | CallEvent.originalEvent | src/types/call.types.ts:256 |
timestamp | Date | Timestamp | - | CallEvent.timestamp | src/types/call.types.ts:258 |
originator? | "local" | "remote" | "system" | Event originator (local, remote, or system) - present in hold/unhold/ended events | - | CallEvent.originator | src/types/call.types.ts:260 |
error? | string | Error message - present in failed events | - | CallEvent.error | src/types/call.types.ts:262 |
transferType? | "blind" | "attended" | Transfer type - present in transfer events | - | CallEvent.transferType | src/types/call.types.ts:264 |
target? | string | Transfer target URI - present in transfer events | - | CallEvent.target | src/types/call.types.ts:266 |
transferId? | string | Transfer ID - present in transfer progress events | - | CallEvent.transferId | src/types/call.types.ts:268 |
state? | string | Transfer state - present in transfer progress events | - | CallEvent.state | src/types/call.types.ts:270 |
progress? | number | Transfer progress percentage - present in transfer progress events | - | CallEvent.progress | src/types/call.types.ts:272 |
replaceCallId? | string | Replace call ID - present in attended transfer events | - | CallEvent.replaceCallId | src/types/call.types.ts:274 |
type | "muted" | "unmuted" | Event type | CallEvent.type | - | src/types/call.types.ts:343 |
HoldOptions
Defined in: src/types/call.types.ts:370
Hold options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
direction? | HoldDirection | SDP direction for hold state (default: 'sendonly') | src/types/call.types.ts:372 |
extraHeaders? | string[] | Custom SIP headers | src/types/call.types.ts:374 |
HoldEvent
Defined in: src/types/call.types.ts:380
Hold event
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | "hold" | "unhold" | "hold_failed" | "unhold_failed" | Event type | src/types/call.types.ts:382 |
state | HoldState | Hold state | src/types/call.types.ts:384 |
originator | "local" | "remote" | Originator of the hold/unhold | src/types/call.types.ts:386 |
timestamp | Date | Timestamp | src/types/call.types.ts:388 |
error? | string | Error message (if failed) | src/types/call.types.ts:390 |
callId | string | Call ID | src/types/call.types.ts:392 |
HoldResult
Defined in: src/types/call.types.ts:398
Hold result
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
success | boolean | Whether operation was successful | src/types/call.types.ts:400 |
state | HoldState | Hold state after operation | src/types/call.types.ts:402 |
error? | string | Error message if failed | src/types/call.types.ts:404 |
CallbackRequest
Defined in: src/types/callback.types.ts:25
Callback request from a caller
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique callback ID | src/types/callback.types.ts:27 |
callerNumber | string | Caller's phone number to call back | src/types/callback.types.ts:30 |
callerName? | string | Optional caller name | src/types/callback.types.ts:33 |
targetQueue? | string | Queue or extension that should handle the callback | src/types/callback.types.ts:36 |
targetAgent? | string | Specific agent to handle the callback | src/types/callback.types.ts:39 |
reason? | string | Original call context (why they called) | src/types/callback.types.ts:42 |
notes? | string | Notes added by agent or system | src/types/callback.types.ts:45 |
priority | CallbackPriority | Priority level | src/types/callback.types.ts:48 |
status | CallbackStatus | Current status | src/types/callback.types.ts:51 |
requestedAt | Date | When the callback was requested | src/types/callback.types.ts:54 |
scheduledAt? | Date | Scheduled callback time (if specified) | src/types/callback.types.ts:57 |
executedAt? | Date | When the callback was actually executed | src/types/callback.types.ts:60 |
completedAt? | Date | When the callback was completed | src/types/callback.types.ts:63 |
attempts | number | Number of callback attempts | src/types/callback.types.ts:66 |
maxAttempts | number | Maximum attempts before marking as failed | src/types/callback.types.ts:69 |
handledBy? | string | Agent who handled the callback | src/types/callback.types.ts:72 |
channel? | string | Channel ID when callback is in progress | src/types/callback.types.ts:75 |
duration? | number | Duration of the callback call in seconds | src/types/callback.types.ts:78 |
disposition? | "failed" | "no_answer" | "busy" | "answered" | "voicemail" | Result/disposition of the callback | src/types/callback.types.ts:81 |
metadata? | Record<string, string> | Custom metadata | src/types/callback.types.ts:84 |
Participant
Defined in: src/types/conference.types.ts:45
Conference participant
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Participant ID | src/types/conference.types.ts:47 |
uri | string | Participant URI | src/types/conference.types.ts:49 |
displayName? | string | Display name | src/types/conference.types.ts:51 |
state | ParticipantState | Participant state | src/types/conference.types.ts:53 |
isMuted | boolean | Is muted | src/types/conference.types.ts:55 |
isOnHold | boolean | Is on hold | src/types/conference.types.ts:57 |
isModerator | boolean | Is moderator | src/types/conference.types.ts:59 |
isSelf | boolean | Is self (local participant) | src/types/conference.types.ts:61 |
audioLevel? | number | Audio level (0-1) | src/types/conference.types.ts:63 |
stream? | MediaStream | Media stream | src/types/conference.types.ts:65 |
joinedAt | Date | Join time | src/types/conference.types.ts:67 |
metadata? | Record<string, unknown> | Custom metadata | src/types/conference.types.ts:69 |
ConferenceStateInterface
Defined in: src/types/conference.types.ts:75
Conference state interface
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Conference ID | src/types/conference.types.ts:77 |
state | ConferenceState | Conference state | src/types/conference.types.ts:79 |
uri? | string | Conference URI | src/types/conference.types.ts:81 |
participants | Map<string, Participant> | Participants | src/types/conference.types.ts:83 |
localParticipant? | Participant | Local participant | src/types/conference.types.ts:85 |
maxParticipants? | number | Maximum participants allowed | src/types/conference.types.ts:87 |
startedAt? | Date | Start time | src/types/conference.types.ts:89 |
endedAt? | Date | End time | src/types/conference.types.ts:91 |
isLocked | boolean | Is locked | src/types/conference.types.ts:93 |
isRecording | boolean | Is recording | src/types/conference.types.ts:95 |
metadata? | Record<string, unknown> | Custom metadata | src/types/conference.types.ts:97 |
ConferenceOptions
Defined in: src/types/conference.types.ts:103
Conference options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
maxParticipants? | number | Maximum participants | src/types/conference.types.ts:105 |
enableRecording? | boolean | Enable recording | src/types/conference.types.ts:107 |
enableVideo? | boolean | Enable video | src/types/conference.types.ts:109 |
locked? | boolean | Lock conference on creation | src/types/conference.types.ts:111 |
moderatorPin? | string | Moderator PIN | src/types/conference.types.ts:113 |
metadata? | Record<string, unknown> | Custom metadata | src/types/conference.types.ts:115 |
ConferenceEvent
Defined in: src/types/conference.types.ts:121
Conference event
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | string | Event type | src/types/conference.types.ts:123 |
conferenceId | string | Conference ID | src/types/conference.types.ts:125 |
state? | ConferenceState | Conference state | src/types/conference.types.ts:127 |
participant? | Participant | Participant (if applicable) | src/types/conference.types.ts:129 |
timestamp | Date | Timestamp | src/types/conference.types.ts:131 |
data? | unknown | Additional data | src/types/conference.types.ts:133 |
ParticipantJoinedEvent
Defined in: src/types/conference.types.ts:139
Participant joined event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
conferenceId | string | Conference ID | - | ConferenceEvent.conferenceId | src/types/conference.types.ts:125 |
state? | ConferenceState | Conference state | - | ConferenceEvent.state | src/types/conference.types.ts:127 |
timestamp | Date | Timestamp | - | ConferenceEvent.timestamp | src/types/conference.types.ts:131 |
data? | unknown | Additional data | - | ConferenceEvent.data | src/types/conference.types.ts:133 |
type | "participant:joined" | Event type | ConferenceEvent.type | - | src/types/conference.types.ts:140 |
participant | Participant | Participant (if applicable) | ConferenceEvent.participant | - | src/types/conference.types.ts:141 |
ParticipantLeftEvent
Defined in: src/types/conference.types.ts:147
Participant left event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
conferenceId | string | Conference ID | - | ConferenceEvent.conferenceId | src/types/conference.types.ts:125 |
state? | ConferenceState | Conference state | - | ConferenceEvent.state | src/types/conference.types.ts:127 |
timestamp | Date | Timestamp | - | ConferenceEvent.timestamp | src/types/conference.types.ts:131 |
data? | unknown | Additional data | - | ConferenceEvent.data | src/types/conference.types.ts:133 |
type | "participant:left" | Event type | ConferenceEvent.type | - | src/types/conference.types.ts:148 |
participant | Participant | Participant (if applicable) | ConferenceEvent.participant | - | src/types/conference.types.ts:149 |
reason? | string | Reason for leaving | - | - | src/types/conference.types.ts:151 |
ParticipantUpdatedEvent
Defined in: src/types/conference.types.ts:157
Participant updated event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
conferenceId | string | Conference ID | - | ConferenceEvent.conferenceId | src/types/conference.types.ts:125 |
state? | ConferenceState | Conference state | - | ConferenceEvent.state | src/types/conference.types.ts:127 |
timestamp | Date | Timestamp | - | ConferenceEvent.timestamp | src/types/conference.types.ts:131 |
data? | unknown | Additional data | - | ConferenceEvent.data | src/types/conference.types.ts:133 |
type | "participant:updated" | Event type | ConferenceEvent.type | - | src/types/conference.types.ts:158 |
participant | Participant | Participant (if applicable) | ConferenceEvent.participant | - | src/types/conference.types.ts:159 |
changes | Partial<Participant> | Changed properties | - | - | src/types/conference.types.ts:161 |
AudioLevelEvent
Defined in: src/types/conference.types.ts:167
Audio level event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
conferenceId | string | Conference ID | - | ConferenceEvent.conferenceId | src/types/conference.types.ts:125 |
state? | ConferenceState | Conference state | - | ConferenceEvent.state | src/types/conference.types.ts:127 |
participant? | Participant | Participant (if applicable) | - | ConferenceEvent.participant | src/types/conference.types.ts:129 |
timestamp | Date | Timestamp | - | ConferenceEvent.timestamp | src/types/conference.types.ts:131 |
data? | unknown | Additional data | - | ConferenceEvent.data | src/types/conference.types.ts:133 |
type | "audio:level" | Event type | ConferenceEvent.type | - | src/types/conference.types.ts:168 |
levels | Map<string, number> | Participant audio levels | - | - | src/types/conference.types.ts:170 |
TurnServerConfig
Defined in: src/types/config.types.ts:9
TURN server configuration for NAT traversal
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
urls | string | readonly string[] | TURN server URLs (e.g., 'turn:turn.example.com:3478') | src/types/config.types.ts:11 |
username? | string | Username for TURN server authentication | src/types/config.types.ts:13 |
credential? | string | Credential for TURN server authentication | src/types/config.types.ts:15 |
credentialType? | "password" | "oauth" | Credential type (default: 'password') | src/types/config.types.ts:17 |
MediaConfiguration
Defined in: src/types/config.types.ts:26
Media configuration (readonly-compatible for Vue reactivity)
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | | boolean | MediaTrackConstraints | { [key: string]: unknown; } | Audio constraints | src/types/config.types.ts:28 |
video? | | boolean | MediaTrackConstraints | { [key: string]: unknown; } | Video constraints | src/types/config.types.ts:30 |
echoCancellation? | boolean | Enable echo cancellation (default: true) | src/types/config.types.ts:32 |
noiseSuppression? | boolean | Enable noise suppression (default: true) | src/types/config.types.ts:34 |
autoGainControl? | boolean | Enable auto gain control (default: true) | src/types/config.types.ts:36 |
audioCodec? | "opus" | "pcmu" | "pcma" | "g722" | Preferred audio codec | src/types/config.types.ts:38 |
videoCodec? | "vp8" | "vp9" | "h264" | Preferred video codec | src/types/config.types.ts:40 |
dataChannel? | boolean | Enable data channel | src/types/config.types.ts:42 |
UserPreferences
Defined in: src/types/config.types.ts:48
User preferences for the SIP client
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audioInputDeviceId? | string | Default audio input device ID | src/types/config.types.ts:50 |
audioOutputDeviceId? | string | Default audio output device ID | src/types/config.types.ts:52 |
videoInputDeviceId? | string | Default video input device ID | src/types/config.types.ts:54 |
enableAudio? | boolean | Enable local audio by default | src/types/config.types.ts:56 |
enableVideo? | boolean | Enable local video by default | src/types/config.types.ts:58 |
autoAnswer? | boolean | Auto-answer incoming calls | src/types/config.types.ts:60 |
autoAnswerDelay? | number | Auto-answer delay in milliseconds | src/types/config.types.ts:62 |
ringToneUrl? | string | Ring tone URL | src/types/config.types.ts:64 |
ringBackToneUrl? | string | Ring back tone URL | src/types/config.types.ts:66 |
enableDtmfTones? | boolean | Enable DTMF tones | src/types/config.types.ts:68 |
ExtendedRTCConfiguration
Defined in: src/types/config.types.ts:74
Extended RTCConfiguration with VueSip-specific options
Extends
RTCConfiguration
Properties
| Property | Type | Description | Overrides | Defined in |
|---|---|---|---|---|
stunServers? | readonly string[] | STUN server URLs | - | src/types/config.types.ts:76 |
turnServers? | readonly TurnServerConfig[] | TURN server configurations | - | src/types/config.types.ts:78 |
iceTransportPolicy? | RTCIceTransportPolicy | ICE transport policy | RTCConfiguration.iceTransportPolicy | src/types/config.types.ts:80 |
bundlePolicy? | RTCBundlePolicy | Bundle policy | RTCConfiguration.bundlePolicy | src/types/config.types.ts:82 |
rtcpMuxPolicy? | "require" | RTC configuration | RTCConfiguration.rtcpMuxPolicy | src/types/config.types.ts:84 |
iceCandidatePoolSize? | number | ICE candidate pool size | RTCConfiguration.iceCandidatePoolSize | src/types/config.types.ts:86 |
SipClientConfig
Defined in: src/types/config.types.ts:92
Main SIP client configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | WebSocket SIP server URI (e.g., 'wss://sip.example.com:7443') | src/types/config.types.ts:94 |
sipUri | string | SIP user URI (e.g., 'sip:user@domain.com') | src/types/config.types.ts:96 |
password | string | SIP password for authentication | src/types/config.types.ts:98 |
displayName? | string | Display name for the user | src/types/config.types.ts:100 |
authorizationUsername? | string | Authorization username (if different from SIP username) | src/types/config.types.ts:102 |
realm? | string | SIP realm for authentication | src/types/config.types.ts:104 |
ha1? | string | HA1 hash for enhanced security (alternative to password) | src/types/config.types.ts:106 |
wsOptions? | object | WebSocket connection options | src/types/config.types.ts:109 |
wsOptions.protocols? | readonly string[] | WebSocket protocols | src/types/config.types.ts:111 |
wsOptions.connectionTimeout? | number | Connection timeout in milliseconds (default: 10000) | src/types/config.types.ts:113 |
wsOptions.maxReconnectionAttempts? | number | Maximum reconnection attempts (default: 5) | src/types/config.types.ts:115 |
wsOptions.reconnectionDelay? | number | Reconnection delay in milliseconds (default: 2000) | src/types/config.types.ts:117 |
registrationOptions? | object | Registration options | src/types/config.types.ts:121 |
registrationOptions.expires? | number | Registration expiry time in seconds (default: 600) | src/types/config.types.ts:123 |
registrationOptions.autoRegister? | boolean | Enable automatic registration on connection (default: true) | src/types/config.types.ts:125 |
registrationOptions.registrationRetryInterval? | number | Registration retry interval in milliseconds (default: 30000) | src/types/config.types.ts:127 |
sessionOptions? | object | Session options | src/types/config.types.ts:131 |
sessionOptions.sessionTimers? | boolean | Session timers (default: true) | src/types/config.types.ts:133 |
sessionOptions.sessionTimersRefreshMethod? | "INVITE" | "UPDATE" | Session timers refresh method | src/types/config.types.ts:135 |
sessionOptions.maxConcurrentCalls? | number | Maximum concurrent calls (default: 1) | src/types/config.types.ts:137 |
sessionOptions.callTimeout? | number | Call timeout in milliseconds (default: 60000) | src/types/config.types.ts:139 |
mediaConfiguration? | MediaConfiguration | Media configuration | src/types/config.types.ts:143 |
rtcConfiguration? | ExtendedRTCConfiguration | RTC configuration | src/types/config.types.ts:146 |
userPreferences? | UserPreferences | User preferences | src/types/config.types.ts:149 |
userAgent? | string | User agent string | src/types/config.types.ts:152 |
debug? | boolean | Enable debug mode | src/types/config.types.ts:155 |
logger? | object | Logger instance (if custom logging is needed) | src/types/config.types.ts:158 |
logger.debug | (...args) => void | - | src/types/config.types.ts:159 |
logger.info | (...args) => void | - | src/types/config.types.ts:160 |
logger.warn | (...args) => void | - | src/types/config.types.ts:161 |
logger.error | (...args) => void | - | src/types/config.types.ts:162 |
ValidationResult
Defined in: src/types/config.types.ts:169
Validation result for configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
valid | boolean | Whether the validation passed | src/types/config.types.ts:171 |
errors? | string[] | Error messages if validation failed | src/types/config.types.ts:173 |
warnings? | string[] | Warning messages | src/types/config.types.ts:175 |
NetworkInfo
Defined in: src/types/connection-recovery.types.ts:9
Network information from Network Information API
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | string | Connection type (wifi, cellular, ethernet, etc.) | src/types/connection-recovery.types.ts:11 |
effectiveType | string | Effective connection type (4g, 3g, 2g, slow-2g) | src/types/connection-recovery.types.ts:13 |
downlink | number | Downlink speed in Mbps | src/types/connection-recovery.types.ts:15 |
rtt | number | Round-trip time in ms | src/types/connection-recovery.types.ts:17 |
isOnline | boolean | Whether browser is online | src/types/connection-recovery.types.ts:19 |
IceHealthStatus
Defined in: src/types/connection-recovery.types.ts:42
ICE connection health status
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
iceState | RTCIceConnectionState | Current ICE connection state | src/types/connection-recovery.types.ts:44 |
stateAge | number | Time since last state change (ms) | src/types/connection-recovery.types.ts:46 |
recoveryAttempts | number | Number of recovery attempts | src/types/connection-recovery.types.ts:48 |
isHealthy | boolean | Whether connection is considered healthy | src/types/connection-recovery.types.ts:50 |
RecoveryAttempt
Defined in: src/types/connection-recovery.types.ts:56
Recovery attempt result
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
attempt | number | Attempt number | src/types/connection-recovery.types.ts:58 |
strategy | RecoveryStrategy | Strategy used | src/types/connection-recovery.types.ts:60 |
success | boolean | Whether attempt succeeded | src/types/connection-recovery.types.ts:62 |
duration | number | Duration of attempt (ms) | src/types/connection-recovery.types.ts:64 |
error? | string | Error if failed | src/types/connection-recovery.types.ts:66 |
timestamp | number | Timestamp | src/types/connection-recovery.types.ts:68 |
ConnectionRecoveryOptions
Defined in: src/types/connection-recovery.types.ts:74
Connection recovery options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
autoRecover? | boolean | Enable automatic recovery (default: true) | src/types/connection-recovery.types.ts:76 |
maxAttempts? | number | Maximum recovery attempts before giving up (default: 3) | src/types/connection-recovery.types.ts:78 |
attemptDelay? | number | Delay between attempts in ms (default: 2000) | src/types/connection-recovery.types.ts:80 |
iceRestartTimeout? | number | ICE restart timeout in ms (default: 10000) | src/types/connection-recovery.types.ts:82 |
strategy? | RecoveryStrategy | Strategy to use (default: 'ice-restart') | src/types/connection-recovery.types.ts:84 |
autoReconnectOnNetworkChange? | boolean | Enable automatic reconnection on network changes (default: false) | src/types/connection-recovery.types.ts:86 |
networkChangeDelay? | number | Delay before triggering recovery after network change in ms (default: 500) | src/types/connection-recovery.types.ts:88 |
exponentialBackoff? | boolean | Use exponential backoff for retry delays (default: false) | src/types/connection-recovery.types.ts:90 |
maxBackoffDelay? | number | Maximum backoff delay in ms when using exponential backoff (default: 30000) | src/types/connection-recovery.types.ts:92 |
onReconnect? | () => Promise<boolean> | Custom reconnect handler for 'reconnect' strategy - must return Promise<boolean> | src/types/connection-recovery.types.ts:94 |
onRecoveryStart? | () => void | Callback when recovery starts | src/types/connection-recovery.types.ts:96 |
onRecoverySuccess? | (attempt) => void | Callback when recovery succeeds | src/types/connection-recovery.types.ts:98 |
onRecoveryFailed? | (attempts) => void | Callback when recovery fails | src/types/connection-recovery.types.ts:100 |
onNetworkChange? | (info) => void | Callback when network changes (type change or online/offline) | src/types/connection-recovery.types.ts:102 |
UseConnectionRecoveryReturn
Defined in: src/types/connection-recovery.types.ts:108
Connection recovery return type
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
state | ComputedRef<RecoveryState> | Current recovery state (readonly) | src/types/connection-recovery.types.ts:110 |
iceHealth | ComputedRef<IceHealthStatus> | Current ICE health status (readonly) | src/types/connection-recovery.types.ts:112 |
attempts | ComputedRef<RecoveryAttempt[]> | History of recovery attempts (readonly) | src/types/connection-recovery.types.ts:114 |
isRecovering | ComputedRef<boolean> | Whether recovery is in progress | src/types/connection-recovery.types.ts:116 |
isHealthy | ComputedRef<boolean> | Whether connection is healthy | src/types/connection-recovery.types.ts:118 |
error | ComputedRef<string | null> | Last error message (readonly) | src/types/connection-recovery.types.ts:120 |
networkInfo | ComputedRef<NetworkInfo> | Current network information (readonly) | src/types/connection-recovery.types.ts:122 |
recover | () => Promise<boolean> | Manually trigger recovery | src/types/connection-recovery.types.ts:124 |
reset | () => void | Reset recovery state | src/types/connection-recovery.types.ts:126 |
monitor | (pc) => void | Start monitoring a peer connection | src/types/connection-recovery.types.ts:128 |
stopMonitoring | () => void | Stop monitoring | src/types/connection-recovery.types.ts:130 |
SipResponse
Defined in: src/types/events.types.ts:15
SIP Response helper interface
Indexable
[key: string]: unknownProperties
| Property | Type | Defined in |
|---|---|---|
status_code? | number | src/types/events.types.ts:16 |
reason_phrase? | string | src/types/events.types.ts:17 |
headers? | Record<string, unknown> | src/types/events.types.ts:18 |
body? | string | src/types/events.types.ts:19 |
SipRequest
Defined in: src/types/events.types.ts:26
SIP Request helper interface
Indexable
[key: string]: unknownProperties
| Property | Type | Defined in |
|---|---|---|
method? | string | src/types/events.types.ts:27 |
ruri? | string | src/types/events.types.ts:28 |
headers? | Record<string, unknown> | src/types/events.types.ts:29 |
body? | string | src/types/events.types.ts:30 |
SipSession
Defined in: src/types/events.types.ts:37
SIP Session helper interface (for event types)
Indexable
[key: string]: unknownProperties
| Property | Type | Defined in |
|---|---|---|
id? | string | src/types/events.types.ts:38 |
direction? | "outgoing" | "incoming" | src/types/events.types.ts:39 |
status? | string | src/types/events.types.ts:40 |
connection? | RTCPeerConnection | src/types/events.types.ts:41 |
SipMessage
Defined in: src/types/events.types.ts:48
SIP Message helper interface
Indexable
[key: string]: unknownProperties
| Property | Type | Defined in |
|---|---|---|
direction | "outgoing" | "incoming" | src/types/events.types.ts:49 |
body? | string | src/types/events.types.ts:50 |
contentType? | string | src/types/events.types.ts:51 |
SipEventObject
Defined in: src/types/events.types.ts:58
SIP Event Object helper interface
Indexable
[key: string]: unknownProperties
| Property | Type | Defined in |
|---|---|---|
event | string | src/types/events.types.ts:59 |
BaseEvent
Defined in: src/types/events.types.ts:66
Base event interface
Extended by
MediaStreamEventMediaTrackEventErrorEventSipConnectedEventSipDisconnectedEventSipRegisteredEventSipUnregisteredEventSipRegistrationFailedEventSipRegistrationExpiringEventSipNewSessionEventSipNewMessageEventSipGenericEventConferenceCreatedEventConferenceJoinedEventConferenceEndedEventConferenceParticipantJoinedEventConferenceParticipantLeftEventConferenceParticipantInvitedEventConferenceParticipantRemovedEventConferenceParticipantMutedEventConferenceParticipantUnmutedEventConferenceRecordingStartedEventConferenceRecordingStoppedEventAudioMutedEventAudioUnmutedEventVideoDisabledEventVideoEnabledEventPresencePublishEventPresenceSubscribeEventPresenceUnsubscribeEventPluginInstalledEventPluginErrorEventPluginUnregisteredEventPluginConfigUpdatedEventCallTransferInitiatedEventCallTransferAcceptedEventCallTransferFailedEventCallTransferCompletedEvent
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | string | Event type | src/types/events.types.ts:68 |
payload? | T | Event payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | src/types/events.types.ts:74 |
EventListenerOptions
Defined in: src/types/events.types.ts:95
Event listener options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
once? | boolean | Execute only once | src/types/events.types.ts:97 |
priority? | number | Priority (higher priority handlers execute first) | src/types/events.types.ts:99 |
id? | string | Handler ID (for removal) | src/types/events.types.ts:101 |
EventMap
Defined in: src/types/events.types.ts:189
Event map for type-safe event handling
Indexable
[key: string]: BaseEvent<unknown>Properties
ErrorEvent
Defined in: src/types/events.types.ts:282
Error event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "error" | Event type | BaseEvent.type | - | src/types/events.types.ts:283 |
error | Error | Error object | - | - | src/types/events.types.ts:285 |
context? | string | Error context | - | - | src/types/events.types.ts:287 |
severity? | "low" | "medium" | "high" | "critical" | Error severity | - | - | src/types/events.types.ts:289 |
SipConnectedEvent
Defined in: src/types/events.types.ts:295
SIP Connected event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:connected" | Event type | BaseEvent.type | - | src/types/events.types.ts:296 |
transport? | string | Transport URL | - | - | src/types/events.types.ts:298 |
SipDisconnectedEvent
Defined in: src/types/events.types.ts:304
SIP Disconnected event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:disconnected" | Event type | BaseEvent.type | - | src/types/events.types.ts:305 |
error? | any | Error if applicable | - | - | src/types/events.types.ts:308 |
SipRegisteredEvent
Defined in: src/types/events.types.ts:314
SIP Registered event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:registered" | Event type | BaseEvent.type | - | src/types/events.types.ts:315 |
uri | string | Registered URI | - | - | src/types/events.types.ts:317 |
expires? | string | number | Expiry time in seconds | - | - | src/types/events.types.ts:319 |
SipUnregisteredEvent
Defined in: src/types/events.types.ts:325
SIP Unregistered event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:unregistered" | Event type | BaseEvent.type | - | src/types/events.types.ts:326 |
cause? | string | Unregistration cause | - | - | src/types/events.types.ts:328 |
SipRegistrationFailedEvent
Defined in: src/types/events.types.ts:334
SIP Registration Failed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:registration_failed" | Event type | BaseEvent.type | - | src/types/events.types.ts:335 |
cause? | string | Failure cause | - | - | src/types/events.types.ts:337 |
response? | SipResponse | Response object | - | - | src/types/events.types.ts:339 |
SipRegistrationExpiringEvent
Defined in: src/types/events.types.ts:345
SIP Registration Expiring event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:registration_expiring" | Event type | BaseEvent.type | - | src/types/events.types.ts:346 |
SipNewSessionEvent
Defined in: src/types/events.types.ts:352
SIP New Session event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:new_session" | Event type | BaseEvent.type | - | src/types/events.types.ts:353 |
session | SipSession | Session object | - | - | src/types/events.types.ts:355 |
originator | "local" | "remote" | Session originator | - | - | src/types/events.types.ts:357 |
request? | SipRequest | SIP request object | - | - | src/types/events.types.ts:359 |
callId | string | Call ID | - | - | src/types/events.types.ts:361 |
SipNewMessageEvent
Defined in: src/types/events.types.ts:367
SIP New Message event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:new_message" | Event type | BaseEvent.type | - | src/types/events.types.ts:368 |
message | SipMessage | Message object | - | - | src/types/events.types.ts:370 |
originator | "local" | "remote" | Message originator | - | - | src/types/events.types.ts:372 |
request? | SipRequest | SIP request object | - | - | src/types/events.types.ts:374 |
from | string | Sender URI | - | - | src/types/events.types.ts:376 |
content | string | Message content | - | - | src/types/events.types.ts:378 |
contentType? | string | Content type | - | - | src/types/events.types.ts:380 |
SipGenericEvent
Defined in: src/types/events.types.ts:386
SIP Generic Event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:event" | Event type | BaseEvent.type | - | src/types/events.types.ts:387 |
event | SipEventObject | Event object | - | - | src/types/events.types.ts:389 |
request | SipRequest | Request object | - | - | src/types/events.types.ts:391 |
ConferenceCreatedEvent
Defined in: src/types/events.types.ts:397
Conference Created event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:created" | Event type | BaseEvent.type | - | src/types/events.types.ts:398 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:400 |
conference | ConferenceStateInterface | Conference state | - | - | src/types/events.types.ts:402 |
ConferenceJoinedEvent
Defined in: src/types/events.types.ts:408
Conference Joined event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:joined" | Event type | BaseEvent.type | - | src/types/events.types.ts:409 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:411 |
conference | ConferenceStateInterface | Conference state | - | - | src/types/events.types.ts:413 |
ConferenceEndedEvent
Defined in: src/types/events.types.ts:419
Conference Ended event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:ended" | Event type | BaseEvent.type | - | src/types/events.types.ts:420 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:422 |
conference | ConferenceStateInterface | Conference state | - | - | src/types/events.types.ts:424 |
ConferenceParticipantJoinedEvent
Defined in: src/types/events.types.ts:430
Conference Participant Joined event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:participant:joined" | Event type | BaseEvent.type | - | src/types/events.types.ts:431 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:433 |
participant | Participant | Participant | - | - | src/types/events.types.ts:435 |
ConferenceParticipantLeftEvent
Defined in: src/types/events.types.ts:441
Conference Participant Left event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:participant:left" | Event type | BaseEvent.type | - | src/types/events.types.ts:442 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:444 |
participant | Participant | Participant | - | - | src/types/events.types.ts:446 |
ConferenceParticipantInvitedEvent
Defined in: src/types/events.types.ts:452
Conference Participant Invited event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:participant:invited" | Event type | BaseEvent.type | - | src/types/events.types.ts:453 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:455 |
participant | Participant | Participant | - | - | src/types/events.types.ts:457 |
ConferenceParticipantRemovedEvent
Defined in: src/types/events.types.ts:463
Conference Participant Removed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:participant:removed" | Event type | BaseEvent.type | - | src/types/events.types.ts:464 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:466 |
participant | Participant | Participant | - | - | src/types/events.types.ts:468 |
ConferenceParticipantMutedEvent
Defined in: src/types/events.types.ts:474
Conference Participant Muted event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:participant:muted" | Event type | BaseEvent.type | - | src/types/events.types.ts:475 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:477 |
participant | Participant | Participant | - | - | src/types/events.types.ts:479 |
ConferenceParticipantUnmutedEvent
Defined in: src/types/events.types.ts:485
Conference Participant Unmuted event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:participant:unmuted" | Event type | BaseEvent.type | - | src/types/events.types.ts:486 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:488 |
participant | Participant | Participant | - | - | src/types/events.types.ts:490 |
ConferenceRecordingStartedEvent
Defined in: src/types/events.types.ts:496
Conference Recording Started event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:recording:started" | Event type | BaseEvent.type | - | src/types/events.types.ts:497 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:499 |
ConferenceRecordingStoppedEvent
Defined in: src/types/events.types.ts:505
Conference Recording Stopped event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:conference:recording:stopped" | Event type | BaseEvent.type | - | src/types/events.types.ts:506 |
conferenceId | string | Conference ID | - | - | src/types/events.types.ts:508 |
AudioMutedEvent
Defined in: src/types/events.types.ts:514
Audio Muted event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:audio:muted" | Event type | BaseEvent.type | - | src/types/events.types.ts:515 |
AudioUnmutedEvent
Defined in: src/types/events.types.ts:521
Audio Unmuted event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:audio:unmuted" | Event type | BaseEvent.type | - | src/types/events.types.ts:522 |
VideoDisabledEvent
Defined in: src/types/events.types.ts:528
Video Disabled event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:video:disabled" | Event type | BaseEvent.type | - | src/types/events.types.ts:529 |
VideoEnabledEvent
Defined in: src/types/events.types.ts:535
Video Enabled event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:video:enabled" | Event type | BaseEvent.type | - | src/types/events.types.ts:536 |
PresencePublishEvent
Defined in: src/types/events.types.ts:542
Presence Publish event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:presence:publish" | Event type | BaseEvent.type | - | src/types/events.types.ts:543 |
presence | PresencePublishOptions | Presence options | - | - | src/types/events.types.ts:545 |
body | string | PIDF XML body | - | - | src/types/events.types.ts:547 |
extraHeaders? | string[] | Extra SIP headers | - | - | src/types/events.types.ts:549 |
PresenceSubscribeEvent
Defined in: src/types/events.types.ts:555
Presence Subscribe event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:presence:subscribe" | Event type | BaseEvent.type | - | src/types/events.types.ts:556 |
uri | string | Target URI | - | - | src/types/events.types.ts:558 |
options? | PresenceSubscriptionOptions | Subscription options | - | - | src/types/events.types.ts:560 |
PresenceUnsubscribeEvent
Defined in: src/types/events.types.ts:566
Presence Unsubscribe event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "sip:presence:unsubscribe" | Event type | BaseEvent.type | - | src/types/events.types.ts:567 |
uri | string | Target URI | - | - | src/types/events.types.ts:569 |
PluginInstalledEvent
Defined in: src/types/events.types.ts:575
Plugin Installed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
type | "plugin:installed" | Event type | BaseEvent.type | - | src/types/events.types.ts:576 |
pluginName | string | Plugin name | - | - | src/types/events.types.ts:578 |
metadata | object | Plugin metadata | BaseEvent.metadata | - | src/types/events.types.ts:580 |
metadata.name | string | - | - | - | src/types/events.types.ts:581 |
metadata.version | string | - | - | - | src/types/events.types.ts:582 |
metadata.description? | string | - | - | - | src/types/events.types.ts:583 |
metadata.author? | string | - | - | - | src/types/events.types.ts:584 |
metadata.license? | string | - | - | - | src/types/events.types.ts:585 |
metadata.minVersion? | string | - | - | - | src/types/events.types.ts:586 |
metadata.maxVersion? | string | - | - | - | src/types/events.types.ts:587 |
metadata.dependencies? | string[] | - | - | - | src/types/events.types.ts:588 |
PluginErrorEvent
Defined in: src/types/events.types.ts:595
Plugin Error event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "plugin:error" | Event type | BaseEvent.type | - | src/types/events.types.ts:596 |
pluginName | string | Plugin name | - | - | src/types/events.types.ts:598 |
error | unknown | Error that occurred | - | - | src/types/events.types.ts:600 |
PluginUnregisteredEvent
Defined in: src/types/events.types.ts:606
Plugin Unregistered event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "plugin:unregistered" | Event type | BaseEvent.type | - | src/types/events.types.ts:607 |
pluginName | string | Plugin name | - | - | src/types/events.types.ts:609 |
PluginConfigUpdatedEvent
Defined in: src/types/events.types.ts:615
Plugin Config Updated event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "plugin:configUpdated" | Event type | BaseEvent.type | - | src/types/events.types.ts:616 |
pluginName | string | Plugin name | - | - | src/types/events.types.ts:618 |
config | Record<string, unknown> | Updated configuration | - | - | src/types/events.types.ts:620 |
CallTransferInitiatedEvent
Defined in: src/types/events.types.ts:626
Call Transfer Initiated event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "call:transfer_initiated" | Event type | BaseEvent.type | - | src/types/events.types.ts:627 |
target | string | Transfer target URI | - | - | src/types/events.types.ts:629 |
transferType | "blind" | "attended" | Transfer method | - | - | src/types/events.types.ts:631 |
replaceCallId? | string | Replace call ID (for attended transfers) | - | - | src/types/events.types.ts:633 |
CallTransferAcceptedEvent
Defined in: src/types/events.types.ts:639
Call Transfer Accepted event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "call:transfer_accepted" | Event type | BaseEvent.type | - | src/types/events.types.ts:640 |
target | string | Transfer target URI | - | - | src/types/events.types.ts:642 |
CallTransferFailedEvent
Defined in: src/types/events.types.ts:648
Call Transfer Failed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "call:transfer_failed" | Event type | BaseEvent.type | - | src/types/events.types.ts:649 |
target | string | Transfer target URI | - | - | src/types/events.types.ts:651 |
error? | string | Error message | - | - | src/types/events.types.ts:653 |
CallTransferCompletedEvent
Defined in: src/types/events.types.ts:659
Call Transfer Completed event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "call:transfer_completed" | Event type | BaseEvent.type | - | src/types/events.types.ts:660 |
target | string | Transfer target URI | - | - | src/types/events.types.ts:662 |
EventEmitter
Defined in: src/types/events.types.ts:668
Event emitter interface
Methods
on()
on<K>(
event,
handler,
options?): void;Defined in: src/types/events.types.ts:672
Add an event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
handler | EventHandler<EventMap[K]> |
options? | EventListenerOptions |
Returns
void
once()
once<K>(event, handler): void;Defined in: src/types/events.types.ts:681
Add a one-time event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
handler | EventHandler<EventMap[K]> |
Returns
void
off()
off<K>(event, handler): void;Defined in: src/types/events.types.ts:686
Remove an event listener
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
handler | EventHandler<EventMap[K]> |
Returns
void
emit()
emit<K>(event, data): void;Defined in: src/types/events.types.ts:691
Emit an event
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
data | EventMap[K] |
Returns
void
removeAllListeners()
removeAllListeners(event?): void;Defined in: src/types/events.types.ts:696
Remove all listeners for an event or all events
Parameters
| Parameter | Type |
|---|---|
event? | keyof EventMap |
Returns
void
waitFor()
waitFor<K>(event, timeout?): Promise<EventMap[K]>;Defined in: src/types/events.types.ts:701
Wait for an event to be emitted
Type Parameters
| Type Parameter |
|---|
K extends keyof EventMap |
Parameters
| Parameter | Type |
|---|---|
event | K |
timeout? | number |
Returns
Promise<EventMap[K]>
ContainerSize
Defined in: src/types/gallery-layout.types.ts:25
Container dimensions for layout calculations
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
width | number | Container width in pixels | src/types/gallery-layout.types.ts:27 |
height | number | Container height in pixels | src/types/gallery-layout.types.ts:29 |
TileDimensions
Defined in: src/types/gallery-layout.types.ts:35
Tile dimensions for participant video tiles
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
width | number | Tile width in pixels | src/types/gallery-layout.types.ts:37 |
height | number | Tile height in pixels | src/types/gallery-layout.types.ts:39 |
GalleryLayoutOptions
Defined in: src/types/gallery-layout.types.ts:45
Gallery layout options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
containerSize? | Ref<ContainerSize, ContainerSize> | Container size for dimension calculations | src/types/gallery-layout.types.ts:47 |
gap? | number | Gap between tiles in pixels. Default: 8 | src/types/gallery-layout.types.ts:49 |
activeSpeakerId? | Ref<string | null, string | null> | Active speaker ID for speaker-focused layouts | src/types/gallery-layout.types.ts:51 |
maxCols? | number | Maximum columns. Default: 4 | src/types/gallery-layout.types.ts:53 |
maxRows? | number | Maximum rows. Default: 4 | src/types/gallery-layout.types.ts:55 |
aspectRatio? | number | Aspect ratio for tiles (width/height). Default: 16/9 | src/types/gallery-layout.types.ts:57 |
UseGalleryLayoutReturn
Defined in: src/types/gallery-layout.types.ts:63
Return type for useGalleryLayout composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
layout | Ref<GalleryLayoutMode> | Current layout mode | src/types/gallery-layout.types.ts:65 |
gridCols | ComputedRef<number> | Number of grid columns | src/types/gallery-layout.types.ts:67 |
gridRows | ComputedRef<number> | Number of grid rows | src/types/gallery-layout.types.ts:69 |
tileDimensions | ComputedRef<TileDimensions> | Calculated tile dimensions | src/types/gallery-layout.types.ts:71 |
gridStyle | ComputedRef<string> | CSS grid style string | src/types/gallery-layout.types.ts:73 |
focusedParticipantId | ComputedRef<string | null> | Currently focused participant ID (for speaker layout) | src/types/gallery-layout.types.ts:75 |
pinnedParticipantId | Ref<string | null> | Pinned participant ID | src/types/gallery-layout.types.ts:77 |
setLayout | (mode) => void | Set layout mode | src/types/gallery-layout.types.ts:79 |
pinParticipant | (id) => void | Pin a participant to focus | src/types/gallery-layout.types.ts:81 |
unpinParticipant | () => void | Unpin the focused participant | src/types/gallery-layout.types.ts:83 |
CallHistoryEntry
Defined in: src/types/history.types.ts:11
Call history entry
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Entry ID | src/types/history.types.ts:13 |
direction | CallDirection | Call direction | src/types/history.types.ts:15 |
remoteUri | string | Remote URI | src/types/history.types.ts:17 |
remoteDisplayName? | string | Remote display name | src/types/history.types.ts:19 |
localUri | string | Local URI | src/types/history.types.ts:21 |
startTime | Date | Call start time | src/types/history.types.ts:23 |
answerTime? | Date | Call answer time (if answered) | src/types/history.types.ts:25 |
endTime | Date | Call end time | src/types/history.types.ts:27 |
duration | number | Call duration in seconds | src/types/history.types.ts:29 |
ringDuration? | number | Ring duration in seconds | src/types/history.types.ts:31 |
finalState | CallState | Final call state | src/types/history.types.ts:33 |
terminationCause | TerminationCause | Termination cause | src/types/history.types.ts:35 |
wasAnswered | boolean | Was answered | src/types/history.types.ts:37 |
wasMissed | boolean | Was missed (for incoming calls) | src/types/history.types.ts:39 |
hasVideo | boolean | Was video call | src/types/history.types.ts:41 |
tags? | readonly string[] | Custom tags | src/types/history.types.ts:43 |
metadata? | Record<string, unknown> | Custom metadata | src/types/history.types.ts:45 |
HistoryFilter
Defined in: src/types/history.types.ts:51
History filter options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
direction? | CallDirection | Filter by direction | src/types/history.types.ts:53 |
remoteUri? | string | Filter by remote URI | src/types/history.types.ts:55 |
wasAnswered? | boolean | Filter by answered/unanswered | src/types/history.types.ts:57 |
wasMissed? | boolean | Filter by missed calls | src/types/history.types.ts:59 |
hasVideo? | boolean | Filter by video calls | src/types/history.types.ts:61 |
dateFrom? | Date | Filter by date range (from) | src/types/history.types.ts:63 |
dateTo? | Date | Filter by date range (to) | src/types/history.types.ts:65 |
tags? | readonly string[] | Filter by tags | src/types/history.types.ts:67 |
searchQuery? | string | Search query (searches in URI and display name) | src/types/history.types.ts:69 |
sortBy? | "remoteUri" | "startTime" | "duration" | Sort field | src/types/history.types.ts:71 |
sortOrder? | "desc" | "asc" | Sort order | src/types/history.types.ts:73 |
limit? | number | Limit results | src/types/history.types.ts:75 |
offset? | number | Offset for pagination | src/types/history.types.ts:77 |
HistoryExportOptions
Defined in: src/types/history.types.ts:95
History export options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
format | HistoryExportFormat | Export format | src/types/history.types.ts:97 |
filter? | HistoryFilter | Filter to apply before export | src/types/history.types.ts:99 |
includeMetadata? | boolean | Include metadata | src/types/history.types.ts:101 |
filename? | string | Filename (without extension) | src/types/history.types.ts:103 |
HistoryStatistics
Defined in: src/types/history.types.ts:109
History statistics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
totalCalls | number | Total calls | src/types/history.types.ts:111 |
incomingCalls | number | Total incoming calls | src/types/history.types.ts:113 |
outgoingCalls | number | Total outgoing calls | src/types/history.types.ts:115 |
answeredCalls | number | Total answered calls | src/types/history.types.ts:117 |
missedCalls | number | Total missed calls | src/types/history.types.ts:119 |
totalDuration | number | Total call duration (seconds) | src/types/history.types.ts:121 |
averageDuration | number | Average call duration (seconds) | src/types/history.types.ts:123 |
videoCalls | number | Total video calls | src/types/history.types.ts:125 |
frequentContacts | object[] | Most frequent contacts | src/types/history.types.ts:127 |
HistorySearchResult
Defined in: src/types/history.types.ts:137
History search result
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
entries | readonly CallHistoryEntry[] | Matched entries | src/types/history.types.ts:139 |
totalCount | number | Total count (before pagination) | src/types/history.types.ts:141 |
hasMore | boolean | Has more results | src/types/history.types.ts:143 |
LocalRecordingOptions
Defined in: src/types/local-recording.types.ts:6
Options for useLocalRecording composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
mimeType? | string | MIME type for recording (default: 'audio/webm') | src/types/local-recording.types.ts:8 |
audioBitsPerSecond? | number | Audio bits per second | src/types/local-recording.types.ts:10 |
videoBitsPerSecond? | number | Video bits per second (if recording video) | src/types/local-recording.types.ts:12 |
timeslice? | number | Time slice in ms for ondataavailable events (default: 1000) | src/types/local-recording.types.ts:14 |
persist? | boolean | Enable IndexedDB persistence (default: false) | src/types/local-recording.types.ts:16 |
dbName? | string | IndexedDB database name (default: 'vuesip-recordings') | src/types/local-recording.types.ts:18 |
storeName? | string | IndexedDB store name (default: 'recordings') | src/types/local-recording.types.ts:20 |
autoDownload? | boolean | Auto-download on stop (default: false) | src/types/local-recording.types.ts:22 |
filenamePrefix? | string | Filename prefix for downloads (default: 'recording') | src/types/local-recording.types.ts:24 |
LocalRecordingData
Defined in: src/types/local-recording.types.ts:30
Recorded data with metadata
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique recording ID | src/types/local-recording.types.ts:32 |
blob | Blob | Recording blob | src/types/local-recording.types.ts:34 |
mimeType | string | MIME type | src/types/local-recording.types.ts:36 |
startedAt | number | Recording start timestamp | src/types/local-recording.types.ts:38 |
stoppedAt | number | Recording end timestamp | src/types/local-recording.types.ts:40 |
duration | number | Duration in milliseconds | src/types/local-recording.types.ts:42 |
url? | string | Object URL for playback (created on demand) | src/types/local-recording.types.ts:44 |
metadata? | Record<string, unknown> | Optional metadata | src/types/local-recording.types.ts:46 |
UseLocalRecordingReturn
Defined in: src/types/local-recording.types.ts:52
Return type for useLocalRecording composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
state | Ref<RecordingState, RecordingState> | Current recording state | src/types/local-recording.types.ts:54 |
isRecording | ComputedRef<boolean> | Whether recording is active | src/types/local-recording.types.ts:56 |
isPaused | ComputedRef<boolean> | Whether recording is paused | src/types/local-recording.types.ts:58 |
duration | Ref<number, number> | Current recording duration in ms | src/types/local-recording.types.ts:60 |
recordingData | Ref<LocalRecordingData | null, LocalRecordingData | null> | Recorded data after stop | src/types/local-recording.types.ts:62 |
error | Ref<Error | null, Error | null> | Error if any | src/types/local-recording.types.ts:64 |
start | (stream, metadata?) => void | Start recording with given stream | src/types/local-recording.types.ts:66 |
pause | () => void | Pause recording | src/types/local-recording.types.ts:68 |
resume | () => void | Resume recording | src/types/local-recording.types.ts:70 |
stop | () => Promise<LocalRecordingData | null> | Stop recording | src/types/local-recording.types.ts:72 |
download | (filename?) => void | Download recording | src/types/local-recording.types.ts:74 |
clear | () => void | Clear current recording data | src/types/local-recording.types.ts:76 |
isSupported | (mimeType?) => boolean | Check if MIME type is supported | src/types/local-recording.types.ts:78 |
MediaDevice
Defined in: src/types/media.types.ts:20
Media device information
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
deviceId | string | Device ID | src/types/media.types.ts:22 |
kind | MediaDeviceKind | Device kind | src/types/media.types.ts:24 |
label | string | Device label | src/types/media.types.ts:26 |
groupId | string | Group ID | src/types/media.types.ts:28 |
isDefault? | boolean | Is default device | src/types/media.types.ts:30 |
MediaPermissions
Defined in: src/types/media.types.ts:55
Media permissions
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio | PermissionStatus | Audio permission status | src/types/media.types.ts:57 |
video | PermissionStatus | Video permission status | src/types/media.types.ts:59 |
AudioStatistics
Defined in: src/types/media.types.ts:65
Audio statistics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
inputLevel? | number | Audio input level (0-1) | src/types/media.types.ts:67 |
outputLevel? | number | Audio output level (0-1) | src/types/media.types.ts:69 |
bytesSent? | number | Bytes sent | src/types/media.types.ts:71 |
bytesReceived? | number | Bytes received | src/types/media.types.ts:73 |
packetsSent? | number | Packets sent | src/types/media.types.ts:75 |
packetsReceived? | number | Packets received | src/types/media.types.ts:77 |
packetsLost? | number | Packets lost | src/types/media.types.ts:79 |
packetLossPercentage? | number | Packet loss percentage | src/types/media.types.ts:81 |
jitter? | number | Jitter (seconds) | src/types/media.types.ts:83 |
roundTripTime? | number | Round trip time (seconds) | src/types/media.types.ts:85 |
codec? | string | Audio codec | src/types/media.types.ts:87 |
bitrate? | number | Bitrate (bits per second) | src/types/media.types.ts:89 |
sampleRate? | number | Sample rate | src/types/media.types.ts:91 |
channels? | number | Channels | src/types/media.types.ts:93 |
VideoStatistics
Defined in: src/types/media.types.ts:99
Video statistics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
bytesSent? | number | Bytes sent | src/types/media.types.ts:101 |
bytesReceived? | number | Bytes received | src/types/media.types.ts:103 |
packetsSent? | number | Packets sent | src/types/media.types.ts:105 |
packetsReceived? | number | Packets received | src/types/media.types.ts:107 |
packetsLost? | number | Packets lost | src/types/media.types.ts:109 |
packetLossPercentage? | number | Packet loss percentage | src/types/media.types.ts:111 |
frameRate? | number | Frame rate | src/types/media.types.ts:113 |
frameWidth? | number | Frame width | src/types/media.types.ts:115 |
frameHeight? | number | Frame height | src/types/media.types.ts:117 |
framesSent? | number | Frames sent | src/types/media.types.ts:119 |
framesReceived? | number | Frames received | src/types/media.types.ts:121 |
framesDropped? | number | Frames dropped | src/types/media.types.ts:123 |
codec? | string | Video codec | src/types/media.types.ts:125 |
bitrate? | number | Bitrate (bits per second) | src/types/media.types.ts:127 |
NetworkStatistics
Defined in: src/types/media.types.ts:133
Network statistics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
currentRoundTripTime? | number | Current round trip time | src/types/media.types.ts:135 |
availableOutgoingBitrate? | number | Available outgoing bitrate | src/types/media.types.ts:137 |
availableIncomingBitrate? | number | Available incoming bitrate | src/types/media.types.ts:139 |
totalBytesSent? | number | Total bytes sent | src/types/media.types.ts:141 |
totalBytesReceived? | number | Total bytes received | src/types/media.types.ts:143 |
transportType? | string | Transport type | src/types/media.types.ts:145 |
localCandidateType? | string | Local candidate type | src/types/media.types.ts:147 |
remoteCandidateType? | string | Remote candidate type | src/types/media.types.ts:149 |
MediaStatistics
Defined in: src/types/media.types.ts:155
Combined media statistics
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | AudioStatistics | Audio statistics | src/types/media.types.ts:157 |
video? | VideoStatistics | Video statistics | src/types/media.types.ts:159 |
network? | NetworkStatistics | Network statistics | src/types/media.types.ts:161 |
timestamp | Date | Timestamp | src/types/media.types.ts:163 |
RecordingOptions
Defined in: src/types/media.types.ts:185
Recording options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
mimeType? | string | MIME type (e.g., 'audio/webm', 'video/webm') | src/types/media.types.ts:187 |
audioBitsPerSecond? | number | Audio bits per second | src/types/media.types.ts:189 |
videoBitsPerSecond? | number | Video bits per second | src/types/media.types.ts:191 |
timeslice? | number | Time slice in milliseconds | src/types/media.types.ts:193 |
audio? | boolean | Include audio | src/types/media.types.ts:195 |
video? | boolean | Include video | src/types/media.types.ts:197 |
RecordingData
Defined in: src/types/media.types.ts:203
Recording data
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Recording ID | src/types/media.types.ts:205 |
callId? | string | Call ID associated with this recording | src/types/media.types.ts:207 |
state? | RecordingState | Current recording state | src/types/media.types.ts:209 |
blob? | Blob | Blob data | src/types/media.types.ts:211 |
mimeType | string | MIME type | src/types/media.types.ts:213 |
duration? | number | Duration in milliseconds | src/types/media.types.ts:215 |
size? | number | Size in bytes | src/types/media.types.ts:217 |
startTime | Date | Start time | src/types/media.types.ts:219 |
endTime? | Date | End time | src/types/media.types.ts:221 |
MediaStreamEvent
Defined in: src/types/media.types.ts:227
Media stream event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "active" | "inactive" | "addtrack" | "removetrack" | Event type | BaseEvent.type | - | src/types/media.types.ts:229 |
stream | MediaStream | Media stream | - | - | src/types/media.types.ts:231 |
track? | MediaStreamTrack | Track (if applicable) | - | - | src/types/media.types.ts:233 |
direction? | "local" | "remote" | Stream direction (local or remote) | - | - | src/types/media.types.ts:235 |
MediaTrackEvent
Defined in: src/types/media.types.ts:241
Media track event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
payload? | unknown | Event payload | - | BaseEvent.payload | src/types/events.types.ts:70 |
timestamp | Date | Timestamp when the event occurred | - | BaseEvent.timestamp | src/types/events.types.ts:72 |
metadata? | Record<string, unknown> | Event metadata | - | BaseEvent.metadata | src/types/events.types.ts:74 |
type | "ended" | "mute" | "unmute" | "added" | "removed" | Event type | BaseEvent.type | - | src/types/media.types.ts:243 |
track | MediaStreamTrack | Track | - | - | src/types/media.types.ts:245 |
direction? | "local" | "remote" | Track direction (local or remote) | - | - | src/types/media.types.ts:247 |
streams? | readonly MediaStream[] | Associated streams (if applicable) | - | - | src/types/media.types.ts:249 |
MediaDeviceChangeEvent
Defined in: src/types/media.types.ts:255
Media device change event
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | "devicechange" | Event type | src/types/media.types.ts:257 |
addedDevices | MediaDevice[] | Added devices | src/types/media.types.ts:259 |
removedDevices | MediaDevice[] | Removed devices | src/types/media.types.ts:261 |
currentDevices | MediaDevice[] | Current devices | src/types/media.types.ts:263 |
timestamp | Date | Timestamp | src/types/media.types.ts:265 |
MediaError
Defined in: src/types/media.types.ts:271
Media error
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name | string | Error name | src/types/media.types.ts:273 |
message | string | Error message | src/types/media.types.ts:275 |
constraint? | string | Constraint that failed (if applicable) | src/types/media.types.ts:277 |
ExtendedMediaStreamConstraints
Defined in: src/types/media.types.ts:283
Extended media stream constraints
Extends
MediaStreamConstraints
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audioDeviceId? | string | Audio device ID | src/types/media.types.ts:285 |
videoDeviceId? | string | Video device ID | src/types/media.types.ts:287 |
echoCancellation? | boolean | Echo cancellation | src/types/media.types.ts:289 |
noiseSuppression? | boolean | Noise suppression | src/types/media.types.ts:291 |
autoGainControl? | boolean | Auto gain control | src/types/media.types.ts:293 |
DTMFSender
Defined in: src/types/media.types.ts:315
DTMF Sender interface
Represents the DTMF sender for sending dual-tone multi-frequency signaling. Used for sending telephone keypad tones (0-9, *, #, A-D) during active calls.
This is a browser API provided by WebRTC's RTCRtpSender.
See
https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFSender
Example
const audioSender = peerConnection.getSenders()
.find(sender => sender.track?.kind === 'audio') as RTCRtpSenderWithDTMF
if (audioSender?.dtmf) {
audioSender.dtmf.insertDTMF('123', 100, 70)
}Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
toneBuffer | readonly | string | Tone buffer containing queued DTMF tones | src/types/media.types.ts:325 |
ontonechange? | public | (event) => void | null | Event handler called when a tone starts playing | src/types/media.types.ts:328 |
Methods
insertDTMF()
insertDTMF(
tones,
duration?,
interToneGap?): void;Defined in: src/types/media.types.ts:322
Insert DTMF tones into the audio stream
Parameters
| Parameter | Type | Description |
|---|---|---|
tones | string | String of DTMF tones to send (0-9, A-D, *, #) |
duration? | number | Duration of each tone in milliseconds (default: 100) |
interToneGap? | number | Gap between tones in milliseconds (default: 70) |
Returns
void
RTCRtpSenderWithDTMF
Defined in: src/types/media.types.ts:345
RTCRtpSender with DTMF support
Extends the standard RTCRtpSender with the dtmf property for DTMF signaling. Not all senders support DTMF (only audio senders typically do).
Example
const audioSender = senders.find(s => s.track?.kind === 'audio') as RTCRtpSenderWithDTMF
if (audioSender && 'dtmf' in audioSender && audioSender.dtmf) {
// DTMF is supported
}Extends
RTCRtpSender
Properties
| Property | Modifier | Type | Description | Overrides | Defined in |
|---|---|---|---|---|---|
dtmf | readonly | RTCDTMFSender | null | DTMF sender for this RTP sender (null if not supported) | RTCRtpSender.dtmf | src/types/media.types.ts:347 |
SessionDescriptionHandler
Defined in: src/types/media.types.ts:360
Session Description Handler interface
Represents the internal session description handler from JsSIP. This is a minimal interface for accessing the underlying RTCPeerConnection.
Note: This interface is intentionally minimal as JsSIP's SessionDescriptionHandler is an internal implementation detail. We only expose the peerConnection property which is needed for accessing RTP senders/receivers.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
peerConnection? | RTCPeerConnection | The peer connection used by this session | src/types/media.types.ts:362 |
Message
Defined in: src/types/messaging.types.ts:51
Message interface
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Message ID | src/types/messaging.types.ts:53 |
direction | MessageDirection | Message direction | src/types/messaging.types.ts:55 |
from | string | Sender URI | src/types/messaging.types.ts:57 |
to | string | Recipient URI | src/types/messaging.types.ts:59 |
content | string | Message content | src/types/messaging.types.ts:61 |
contentType | MessageContentType | Content type | src/types/messaging.types.ts:63 |
status | MessageStatus | Message status | src/types/messaging.types.ts:65 |
timestamp | Date | Timestamp when message was created | src/types/messaging.types.ts:67 |
sentAt? | Date | Timestamp when message was sent | src/types/messaging.types.ts:69 |
deliveredAt? | Date | Timestamp when message was delivered | src/types/messaging.types.ts:71 |
readAt? | Date | Timestamp when message was read | src/types/messaging.types.ts:73 |
isRead | boolean | Is message read | src/types/messaging.types.ts:75 |
metadata? | Record<string, unknown> | Custom metadata | src/types/messaging.types.ts:77 |
MessageSendOptions
Defined in: src/types/messaging.types.ts:83
Message send options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
contentType? | MessageContentType | Content type | src/types/messaging.types.ts:85 |
extraHeaders? | string[] | Custom SIP headers | src/types/messaging.types.ts:87 |
requestDeliveryNotification? | boolean | Request delivery notification | src/types/messaging.types.ts:89 |
requestReadNotification? | boolean | Request read notification | src/types/messaging.types.ts:91 |
MessagingEvent
Defined in: src/types/messaging.types.ts:97
Messaging event
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | "failed" | "sent" | "delivered" | "read" | "received" | Event type | src/types/messaging.types.ts:99 |
message | Message | Message | src/types/messaging.types.ts:101 |
timestamp | Date | Timestamp | src/types/messaging.types.ts:103 |
error? | string | Error message (if failed) | src/types/messaging.types.ts:105 |
ComposingIndicator
Defined in: src/types/messaging.types.ts:111
Composing indicator
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | User URI | src/types/messaging.types.ts:113 |
isComposing | boolean | Is composing | src/types/messaging.types.ts:115 |
lastUpdated | Date | Last updated | src/types/messaging.types.ts:117 |
idleTimeout? | number | Idle timeout | src/types/messaging.types.ts:119 |
MessageFilter
Defined in: src/types/messaging.types.ts:125
Message filter options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri? | string | Filter by URI | src/types/messaging.types.ts:127 |
direction? | MessageDirection | Filter by direction | src/types/messaging.types.ts:129 |
status? | MessageStatus | Filter by status | src/types/messaging.types.ts:131 |
dateFrom? | Date | Filter by date range | src/types/messaging.types.ts:133 |
dateTo? | Date | Filter by date range | src/types/messaging.types.ts:135 |
contentType? | MessageContentType | Filter by content type | src/types/messaging.types.ts:137 |
searchQuery? | string | Search query | src/types/messaging.types.ts:139 |
OAuth2TokenResponse
Defined in: src/types/oauth.types.ts:34
OAuth2 token response from provider
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
access_token | string | Access token for API calls | src/types/oauth.types.ts:36 |
token_type | string | Token type (usually 'Bearer') | src/types/oauth.types.ts:38 |
expires_in | number | Token expiration time in seconds | src/types/oauth.types.ts:40 |
refresh_token? | string | Refresh token for obtaining new access tokens | src/types/oauth.types.ts:42 |
scope? | string | Granted scopes | src/types/oauth.types.ts:44 |
id_token? | string | ID token (OpenID Connect) | src/types/oauth.types.ts:46 |
OAuth2UserInfo
Defined in: src/types/oauth.types.ts:52
OAuth2 user info from provider
Indexable
[key: string]: unknownAdditional custom claims
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
sub | string | Unique user identifier from provider | src/types/oauth.types.ts:54 |
email? | string | User's email address | src/types/oauth.types.ts:56 |
email_verified? | boolean | Whether email is verified | src/types/oauth.types.ts:58 |
name? | string | User's display name | src/types/oauth.types.ts:60 |
given_name? | string | User's given (first) name | src/types/oauth.types.ts:62 |
family_name? | string | User's family (last) name | src/types/oauth.types.ts:64 |
preferred_username? | string | User's preferred username | src/types/oauth.types.ts:66 |
picture? | string | URL to user's profile picture | src/types/oauth.types.ts:68 |
locale? | string | User's locale | src/types/oauth.types.ts:70 |
exp? | number | Token expiration timestamp | src/types/oauth.types.ts:72 |
iat? | number | Token issued at timestamp | src/types/oauth.types.ts:74 |
iss? | string | Token issuer | src/types/oauth.types.ts:76 |
aud? | string | string[] | Token audience | src/types/oauth.types.ts:78 |
PKCEParams
Defined in: src/types/oauth.types.ts:86
PKCE (Proof Key for Code Exchange) parameters
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
codeVerifier | string | Code verifier (random string) | src/types/oauth.types.ts:88 |
codeChallenge | string | Code challenge (derived from verifier) | src/types/oauth.types.ts:90 |
codeChallengeMethod | "S256" | Challenge method (always S256 for security) | src/types/oauth.types.ts:92 |
OAuth2ProviderConfig
Defined in: src/types/oauth.types.ts:98
OAuth2 provider configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | OAuth2ProviderType | Provider type identifier | src/types/oauth.types.ts:100 |
clientId | string | OAuth2 client ID | src/types/oauth.types.ts:102 |
clientSecret? | string | OAuth2 client secret (for confidential clients - NOT for SPAs) | src/types/oauth.types.ts:104 |
authorizationEndpoint | string | Authorization endpoint URL | src/types/oauth.types.ts:106 |
tokenEndpoint | string | Token endpoint URL | src/types/oauth.types.ts:108 |
userInfoEndpoint? | string | User info endpoint URL | src/types/oauth.types.ts:110 |
revocationEndpoint? | string | Token revocation endpoint URL | src/types/oauth.types.ts:112 |
jwksEndpoint? | string | JWKS (JSON Web Key Set) endpoint URL | src/types/oauth.types.ts:114 |
issuer? | string | Issuer URL for token validation | src/types/oauth.types.ts:116 |
redirectUri | string | Redirect URI after authentication | src/types/oauth.types.ts:118 |
scopes | string[] | Requested OAuth2 scopes | src/types/oauth.types.ts:120 |
grantType | OAuth2GrantType | OAuth2 grant type to use | src/types/oauth.types.ts:122 |
usePKCE? | boolean | Use PKCE for authorization code flow (recommended for SPAs) | src/types/oauth.types.ts:124 |
additionalParams? | Record<string, string> | Additional authorization parameters | src/types/oauth.types.ts:126 |
responseType? | string | Response type (code, token, id_token) | src/types/oauth.types.ts:128 |
responseMode? | "query" | "fragment" | "form_post" | Response mode (query, fragment, form_post) | src/types/oauth.types.ts:130 |
SipCredentialMapping
Defined in: src/types/oauth.types.ts:208
SIP credential mapping from OAuth2 user info
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
usernameField | keyof OAuth2UserInfo | Field to use for SIP username (from OAuth2 user info) | src/types/oauth.types.ts:210 |
displayNameField? | keyof OAuth2UserInfo | Field to use for SIP display name | src/types/oauth.types.ts:212 |
sipDomain | string | SIP domain to use | src/types/oauth.types.ts:214 |
sipRealm? | string | SIP realm for authentication | src/types/oauth.types.ts:216 |
wsServerUri | string | WebSocket server URI | src/types/oauth.types.ts:218 |
passwordStrategy | SipPasswordStrategy | Strategy for generating SIP password | src/types/oauth.types.ts:220 |
usernameTransformer? | (userInfo) => string | Custom username transformer | src/types/oauth.types.ts:222 |
displayNameTransformer? | (userInfo) => string | Custom display name transformer | src/types/oauth.types.ts:224 |
ProvisionedSipCredentials
Defined in: src/types/oauth.types.ts:244
Auto-provisioned SIP user credentials
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
sipUri | string | SIP URI (e.g., sip:user@domain.com) | src/types/oauth.types.ts:246 |
username | string | SIP username | src/types/oauth.types.ts:248 |
password | string | SIP password or token | src/types/oauth.types.ts:250 |
displayName | string | Display name for calls | src/types/oauth.types.ts:252 |
wsServerUri | string | WebSocket server URI | src/types/oauth.types.ts:254 |
realm? | string | SIP realm | src/types/oauth.types.ts:256 |
authorizationUsername? | string | Authorization username if different | src/types/oauth.types.ts:258 |
expiresAt? | Date | When credentials expire (based on token expiry) | src/types/oauth.types.ts:260 |
oauthUserInfo | OAuth2UserInfo | Original OAuth2 user info | src/types/oauth.types.ts:262 |
tokens | OAuth2TokenResponse | OAuth2 tokens for refresh | src/types/oauth.types.ts:264 |
OAuth2Error
Defined in: src/types/oauth.types.ts:283
OAuth2 error types
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
error | string | Error code from provider | src/types/oauth.types.ts:285 |
error_description? | string | Human-readable error description | src/types/oauth.types.ts:287 |
error_uri? | string | URI with more error information | src/types/oauth.types.ts:289 |
state? | string | OAuth2 state parameter | src/types/oauth.types.ts:291 |
OAuth2ServiceConfig
Defined in: src/types/oauth.types.ts:297
OAuth2 service configuration
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
provider | OAuth2ProviderConfig | OAuth2 provider configuration | src/types/oauth.types.ts:299 |
credentialMapping | SipCredentialMapping | SIP credential mapping configuration | src/types/oauth.types.ts:301 |
autoRefresh? | boolean | Auto-refresh tokens before expiry | src/types/oauth.types.ts:303 |
refreshThreshold? | number | Refresh tokens this many seconds before expiry | src/types/oauth.types.ts:305 |
storageKeyPrefix? | string | Storage key prefix for persisting tokens | src/types/oauth.types.ts:307 |
storageType? | "localStorage" | "sessionStorage" | "memory" | Storage type to use | src/types/oauth.types.ts:309 |
debug? | boolean | Enable debug logging | src/types/oauth.types.ts:311 |
callbackPath? | string | Callback URL path (for handling redirects) | src/types/oauth.types.ts:313 |
postLoginRedirect? | string | Post-login redirect URL | src/types/oauth.types.ts:315 |
postLogoutRedirect? | string | Post-logout redirect URL | src/types/oauth.types.ts:317 |
UseOAuth2Return
Defined in: src/types/oauth.types.ts:323
OAuth2 service return type (for composable)
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
authState | Ref<OAuth2AuthState, OAuth2AuthState> | Current authentication state | src/types/oauth.types.ts:325 |
isAuthenticated | ComputedRef<boolean> | Whether user is authenticated | src/types/oauth.types.ts:327 |
error | Ref<OAuth2Error | null, OAuth2Error | null> | Current error (null if none) | src/types/oauth.types.ts:329 |
userInfo | Ref<OAuth2UserInfo | null, OAuth2UserInfo | null> | Current OAuth2 user info | src/types/oauth.types.ts:331 |
sipCredentials | Ref<ProvisionedSipCredentials | null, ProvisionedSipCredentials | null> | Provisioned SIP credentials | src/types/oauth.types.ts:333 |
tokens | Ref<OAuth2TokenResponse | null, OAuth2TokenResponse | null> | Current OAuth2 tokens | src/types/oauth.types.ts:335 |
tokenExpiresAt | Ref<Date | null, Date | null> | Token expiration timestamp | src/types/oauth.types.ts:337 |
isRefreshing | Ref<boolean, boolean> | Whether token refresh is in progress | src/types/oauth.types.ts:339 |
login | (options?) => Promise<void> | Initiate OAuth2 login flow | src/types/oauth.types.ts:343 |
handleCallback | (url?) => Promise<ProvisionedSipCredentials> | Handle OAuth2 callback (after redirect) | src/types/oauth.types.ts:345 |
logout | () => Promise<void> | Logout and revoke tokens | src/types/oauth.types.ts:347 |
refreshTokens | () => Promise<OAuth2TokenResponse> | Manually refresh tokens | src/types/oauth.types.ts:349 |
getAccessToken | () => Promise<string> | Get current access token (auto-refresh if needed) | src/types/oauth.types.ts:351 |
isTokenExpired | () => boolean | Check if tokens are expired | src/types/oauth.types.ts:353 |
clearAuth | () => void | Clear stored auth data | src/types/oauth.types.ts:355 |
OAuth2ProviderService
Defined in: src/types/oauth.types.ts:361
OAuth2 provider service interface
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
type | readonly | OAuth2ProviderType | Provider type | src/types/oauth.types.ts:363 |
config | readonly | OAuth2ProviderConfig | Provider configuration | src/types/oauth.types.ts:365 |
Methods
getAuthorizationUrl()
getAuthorizationUrl(state, pkce?): string;Defined in: src/types/oauth.types.ts:368
Generate authorization URL
Parameters
| Parameter | Type |
|---|---|
state | string |
pkce? | PKCEParams |
Returns
string
exchangeCode()
exchangeCode(code, pkce?): Promise<OAuth2TokenResponse>;Defined in: src/types/oauth.types.ts:370
Exchange authorization code for tokens
Parameters
| Parameter | Type |
|---|---|
code | string |
pkce? | PKCEParams |
Returns
Promise<OAuth2TokenResponse>
refreshToken()
refreshToken(refreshToken): Promise<OAuth2TokenResponse>;Defined in: src/types/oauth.types.ts:372
Refresh access token
Parameters
| Parameter | Type |
|---|---|
refreshToken | string |
Returns
Promise<OAuth2TokenResponse>
fetchUserInfo()
fetchUserInfo(accessToken): Promise<OAuth2UserInfo>;Defined in: src/types/oauth.types.ts:374
Fetch user info from provider
Parameters
| Parameter | Type |
|---|---|
accessToken | string |
Returns
Promise<OAuth2UserInfo>
revokeToken()
revokeToken(token, tokenType?): Promise<void>;Defined in: src/types/oauth.types.ts:376
Revoke token
Parameters
| Parameter | Type |
|---|---|
token | string |
tokenType? | "access_token" | "refresh_token" |
Returns
Promise<void>
validateIdToken()?
optional validateIdToken(idToken): Promise<OAuth2UserInfo>;Defined in: src/types/oauth.types.ts:378
Validate ID token (if applicable)
Parameters
| Parameter | Type |
|---|---|
idToken | string |
Returns
Promise<OAuth2UserInfo>
UserProvisioningService
Defined in: src/types/oauth.types.ts:384
User provisioning service interface
Methods
provisionUser()
provisionUser(
userInfo,
tokens,
mapping): Promise<ProvisionedSipCredentials>;Defined in: src/types/oauth.types.ts:386
Provision SIP credentials from OAuth2 user info
Parameters
| Parameter | Type |
|---|---|
userInfo | OAuth2UserInfo |
tokens | OAuth2TokenResponse |
mapping | SipCredentialMapping |
Returns
Promise<ProvisionedSipCredentials>
updateCredentials()
updateCredentials(existing, newTokens): Promise<ProvisionedSipCredentials>;Defined in: src/types/oauth.types.ts:393
Update provisioned credentials (e.g., on token refresh)
Parameters
| Parameter | Type |
|---|---|
existing | ProvisionedSipCredentials |
newTokens | OAuth2TokenResponse |
Returns
Promise<ProvisionedSipCredentials>
deprovisionUser()
deprovisionUser(credentials): Promise<void>;Defined in: src/types/oauth.types.ts:399
Deprovision/cleanup user credentials
Parameters
| Parameter | Type |
|---|---|
credentials | ProvisionedSipCredentials |
Returns
Promise<void>
OAuth2TokenStorage
Defined in: src/types/oauth.types.ts:405
Token storage interface
Methods
store()
store(key, data): Promise<void>;Defined in: src/types/oauth.types.ts:407
Store tokens
Parameters
| Parameter | Type |
|---|---|
key | string |
data | OAuth2StoredData |
Returns
Promise<void>
retrieve()
retrieve(key): Promise<OAuth2StoredData | null>;Defined in: src/types/oauth.types.ts:409
Retrieve tokens
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
Promise<OAuth2StoredData | null>
remove()
remove(key): Promise<void>;Defined in: src/types/oauth.types.ts:411
Remove tokens
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
Promise<void>
clear()
clear(): Promise<void>;Defined in: src/types/oauth.types.ts:413
Clear all OAuth2 data
Returns
Promise<void>
OAuth2StoredData
Defined in: src/types/oauth.types.ts:419
Data structure for stored OAuth2 data
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
tokens | OAuth2TokenResponse | OAuth2 tokens | src/types/oauth.types.ts:421 |
userInfo | OAuth2UserInfo | User info | src/types/oauth.types.ts:423 |
sipCredentials | ProvisionedSipCredentials | Provisioned SIP credentials | src/types/oauth.types.ts:425 |
storedAt | string | When data was stored | src/types/oauth.types.ts:427 |
expiresAt | string | When tokens expire | src/types/oauth.types.ts:429 |
pkceVerifier? | string | PKCE verifier (for pending auth flows) | src/types/oauth.types.ts:431 |
state? | string | OAuth2 state (for CSRF protection) | src/types/oauth.types.ts:433 |
OAuth2Events
Defined in: src/types/oauth.types.ts:439
Events emitted by OAuth2 service
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
oauth:state_changed | object | Emitted when authentication state changes | src/types/oauth.types.ts:441 |
oauth:state_changed.state | OAuth2AuthState | - | src/types/oauth.types.ts:441 |
oauth:state_changed.previousState | OAuth2AuthState | - | src/types/oauth.types.ts:441 |
oauth:authenticated | object | Emitted on successful authentication | src/types/oauth.types.ts:443 |
oauth:authenticated.userInfo | OAuth2UserInfo | - | src/types/oauth.types.ts:443 |
oauth:authenticated.credentials | ProvisionedSipCredentials | - | src/types/oauth.types.ts:443 |
oauth:error | object | Emitted on authentication error | src/types/oauth.types.ts:445 |
oauth:error.error | OAuth2Error | - | src/types/oauth.types.ts:445 |
oauth:tokens_refreshed | object | Emitted when tokens are refreshed | src/types/oauth.types.ts:447 |
oauth:tokens_refreshed.tokens | OAuth2TokenResponse | - | src/types/oauth.types.ts:447 |
oauth:logout | void | Emitted on logout | src/types/oauth.types.ts:449 |
oauth:credentials_provisioned | object | Emitted when SIP credentials are provisioned | src/types/oauth.types.ts:451 |
oauth:credentials_provisioned.credentials | ProvisionedSipCredentials | - | src/types/oauth.types.ts:451 |
ParticipantControlsOptions
Defined in: src/types/participant-controls.types.ts:12
Participant controls options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
isModerator? | Ref<boolean, boolean> | Whether the current user is a moderator | src/types/participant-controls.types.ts:14 |
isPinned? | Ref<boolean, boolean> | Whether this participant is currently pinned | src/types/participant-controls.types.ts:16 |
initialVolume? | number | Initial volume level (0-1). Default: 1 | src/types/participant-controls.types.ts:18 |
onMute? | (participant) => void | Callback when participant is muted | src/types/participant-controls.types.ts:20 |
onUnmute? | (participant) => void | Callback when participant is unmuted | src/types/participant-controls.types.ts:22 |
onKick? | (participant) => void | Callback when participant is kicked | src/types/participant-controls.types.ts:24 |
onPin? | (participant) => void | Callback when participant is pinned | src/types/participant-controls.types.ts:26 |
onUnpin? | (participant) => void | Callback when participant is unpinned | src/types/participant-controls.types.ts:28 |
onVolumeChange? | (participant, volume) => void | Callback when volume changes | src/types/participant-controls.types.ts:30 |
UseParticipantControlsReturn
Defined in: src/types/participant-controls.types.ts:36
Return type for useParticipantControls composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
canMute | ComputedRef<boolean> | Can mute/unmute this participant | src/types/participant-controls.types.ts:38 |
canKick | ComputedRef<boolean> | Can kick this participant | src/types/participant-controls.types.ts:40 |
canPin | ComputedRef<boolean> | Can pin this participant | src/types/participant-controls.types.ts:42 |
volume | Ref<number> | Current volume level | src/types/participant-controls.types.ts:44 |
toggleMute | () => void | Toggle mute state | src/types/participant-controls.types.ts:46 |
kickParticipant | () => void | Kick participant from conference | src/types/participant-controls.types.ts:48 |
togglePin | () => void | Toggle pin state | src/types/participant-controls.types.ts:50 |
setVolume | (level) => void | Set volume level | src/types/participant-controls.types.ts:52 |
HookOptions
Defined in: src/types/plugin.types.ts:101
Hook registration options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
priority? | number | Priority of this hook handler | src/types/plugin.types.ts:103 |
once? | boolean | If true, removes handler after first execution | src/types/plugin.types.ts:105 |
condition? | (context, data?) => boolean | Optional condition function to determine if hook should run | src/types/plugin.types.ts:107 |
HookRegistration
Defined in: src/types/plugin.types.ts:114
Hook registration details
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | any |
TReturn | any |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name | string | The hook name | src/types/plugin.types.ts:116 |
handler | HookHandler<TData, TReturn> | The handler function | src/types/plugin.types.ts:118 |
options | Required<HookOptions> | Registration options | src/types/plugin.types.ts:120 |
pluginName | string | Plugin that registered this hook (for cleanup) | src/types/plugin.types.ts:122 |
id | string | Unique ID for this registration | src/types/plugin.types.ts:124 |
PluginContext
Defined in: src/types/plugin.types.ts:132
Plugin context
Provides access to the application's core systems and utilities.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
eventBus | EventBus | Event bus for global event communication | src/types/plugin.types.ts:134 |
sipClient | SipClient | null | SIP client instance (may be null before initialization) | src/types/plugin.types.ts:137 |
mediaManager | MediaManager | null | Media manager instance | src/types/plugin.types.ts:140 |
config | SipClientConfig | null | Current SIP configuration | src/types/plugin.types.ts:143 |
activeCalls | Map<string, CallSession> | Active call sessions | src/types/plugin.types.ts:146 |
hooks | object | Hook system for registering lifecycle hooks | src/types/plugin.types.ts:149 |
hooks.register | <TData, TReturn>(name, handler, options?) => string | Register a hook handler | src/types/plugin.types.ts:152 |
hooks.unregister | (hookId) => boolean | Unregister a hook handler by ID | src/types/plugin.types.ts:158 |
hooks.execute | <TData, TReturn>(name, data?) => Promise<TReturn[]> | Execute all handlers for a hook | src/types/plugin.types.ts:161 |
logger | object | Logger instance | src/types/plugin.types.ts:165 |
logger.debug | (message, ...args) => void | - | src/types/plugin.types.ts:166 |
logger.info | (message, ...args) => void | - | src/types/plugin.types.ts:167 |
logger.warn | (message, ...args) => void | - | src/types/plugin.types.ts:168 |
logger.error | (message, ...args) => void | - | src/types/plugin.types.ts:169 |
version | string | Application version | src/types/plugin.types.ts:173 |
PluginMetadata
Defined in: src/types/plugin.types.ts:179
Plugin metadata
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name | string | Plugin name (must be unique) | src/types/plugin.types.ts:181 |
version | string | Plugin version | src/types/plugin.types.ts:183 |
description? | string | Plugin description | src/types/plugin.types.ts:185 |
author? | string | Plugin author | src/types/plugin.types.ts:187 |
license? | string | Plugin license | src/types/plugin.types.ts:189 |
minVersion? | string | Minimum VueSip version required | src/types/plugin.types.ts:191 |
maxVersion? | string | Maximum VueSip version supported | src/types/plugin.types.ts:193 |
dependencies? | string[] | Dependencies on other plugins | src/types/plugin.types.ts:195 |
PluginConfig
Defined in: src/types/plugin.types.ts:201
Plugin configuration options
Extended by
Indexable
[key: string]: unknownPlugin-specific configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled? | boolean | Enable/disable the plugin | src/types/plugin.types.ts:203 |
Plugin
Defined in: src/types/plugin.types.ts:213
Plugin interface
All plugins must implement this interface.
Type Parameters
| Type Parameter | Default type |
|---|---|
TConfig extends PluginConfig | PluginConfig |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
metadata | PluginMetadata | Plugin metadata | src/types/plugin.types.ts:215 |
defaultConfig? | TConfig | Default configuration | src/types/plugin.types.ts:218 |
Methods
install()
install(context, config?): void | Promise<void>;Defined in: src/types/plugin.types.ts:230
Install the plugin
Called when the plugin is registered. Use this to set up event listeners, register hooks, etc.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | PluginContext | Plugin context |
config? | TConfig | Plugin configuration |
Returns
void | Promise<void>
Promise that resolves when installation is complete
uninstall()?
optional uninstall(context): void | Promise<void>;Defined in: src/types/plugin.types.ts:241
Uninstall the plugin
Called when the plugin is unregistered or the application is destroyed. Use this to clean up resources, remove event listeners, etc.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | PluginContext | Plugin context |
Returns
void | Promise<void>
Promise that resolves when cleanup is complete
updateConfig()?
optional updateConfig(context, config): void | Promise<void>;Defined in: src/types/plugin.types.ts:252
Update plugin configuration
Called when the plugin configuration is updated at runtime.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | PluginContext | Plugin context |
config | TConfig | New configuration |
Returns
void | Promise<void>
Promise that resolves when configuration is applied
PluginEntry
Defined in: src/types/plugin.types.ts:274
Plugin registry entry
Type Parameters
| Type Parameter | Default type |
|---|---|
TConfig extends PluginConfig | PluginConfig |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
plugin | Plugin<TConfig> | The plugin instance | src/types/plugin.types.ts:276 |
config | TConfig | Plugin configuration | src/types/plugin.types.ts:278 |
state | PluginState | Current state | src/types/plugin.types.ts:280 |
installedAt? | Date | Installation timestamp | src/types/plugin.types.ts:282 |
error? | Error | Error if installation failed | src/types/plugin.types.ts:284 |
hookIds | string[] | Hook IDs registered by this plugin (for cleanup) | src/types/plugin.types.ts:286 |
AnalyticsEvent
Defined in: src/types/plugin.types.ts:324
Analytics event types
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | string | Event type | src/types/plugin.types.ts:326 |
timestamp | Date | Event timestamp | src/types/plugin.types.ts:328 |
data? | Record<string, unknown> | Event data | src/types/plugin.types.ts:330 |
sessionId? | string | User session ID | src/types/plugin.types.ts:332 |
userId? | string | User ID | src/types/plugin.types.ts:334 |
AnalyticsPluginConfig
Defined in: src/types/plugin.types.ts:340
Analytics plugin configuration
Extends
Indexable
[key: string]: unknownPlugin-specific configuration
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
enabled? | boolean | Enable/disable the plugin | PluginConfig.enabled | src/types/plugin.types.ts:203 |
endpoint? | string | Analytics endpoint URL | - | src/types/plugin.types.ts:342 |
batchEvents? | boolean | Batch events before sending | - | src/types/plugin.types.ts:344 |
batchSize? | number | Batch size | - | src/types/plugin.types.ts:346 |
sendInterval? | number | Send interval (ms) | - | src/types/plugin.types.ts:348 |
includeUserInfo? | boolean | Include user information | - | src/types/plugin.types.ts:350 |
transformEvent? | (event) => AnalyticsEvent | Custom event transformer | - | src/types/plugin.types.ts:352 |
trackEvents? | string[] | Events to track | - | src/types/plugin.types.ts:354 |
ignoreEvents? | string[] | Events to ignore | - | src/types/plugin.types.ts:356 |
maxQueueSize? | number | Maximum events in queue before dropping (prevents memory overflow) | - | src/types/plugin.types.ts:358 |
requestTimeout? | number | Request timeout in milliseconds (prevents hanging requests) | - | src/types/plugin.types.ts:360 |
maxPayloadSize? | number | Maximum event payload size in bytes (prevents large payloads) | - | src/types/plugin.types.ts:362 |
validateEventData? | boolean | Validate event data (null, undefined, empty objects) | - | src/types/plugin.types.ts:364 |
RecordingPluginConfig
Defined in: src/types/plugin.types.ts:370
Recording plugin configuration
Extends
Indexable
[key: string]: unknownPlugin-specific configuration
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
enabled? | boolean | Enable/disable the plugin | PluginConfig.enabled | src/types/plugin.types.ts:203 |
autoStart? | boolean | Auto-start recording on call start | - | src/types/plugin.types.ts:372 |
recordingOptions? | RecordingOptions | Recording options | - | src/types/plugin.types.ts:374 |
storeInIndexedDB? | boolean | Store recordings in IndexedDB | - | src/types/plugin.types.ts:376 |
dbName? | string | IndexedDB database name | - | src/types/plugin.types.ts:378 |
maxRecordings? | number | Max recordings to keep | - | src/types/plugin.types.ts:380 |
autoDeleteOld? | boolean | Auto-delete old recordings | - | src/types/plugin.types.ts:382 |
onRecordingStart? | (data) => void | Callback when recording starts | - | src/types/plugin.types.ts:384 |
onRecordingStop? | (data) => void | Callback when recording stops | - | src/types/plugin.types.ts:386 |
onRecordingError? | (error) => void | Callback when recording fails | - | src/types/plugin.types.ts:388 |
StateDisplayOptions
Defined in: src/types/presence.types.ts:31
Display options for a dialog state
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
color | string | CSS color class or value | src/types/presence.types.ts:33 |
icon | string | Icon name or class | src/types/presence.types.ts:35 |
label | string | Human-readable label | src/types/presence.types.ts:37 |
isActive | boolean | Whether the state indicates active call | src/types/presence.types.ts:39 |
DialogStatus
Defined in: src/types/presence.types.ts:99
Dialog status for a specific extension
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri? | string | Extension URI | src/types/presence.types.ts:101 |
state | DialogState | Current dialog state | src/types/presence.types.ts:103 |
direction? | "initiator" | "recipient" | Call direction (initiator or recipient) | src/types/presence.types.ts:105 |
remoteTag? | string | Remote party tag | src/types/presence.types.ts:107 |
remoteIdentity? | string | Remote party identity (SIP URI) | src/types/presence.types.ts:109 |
remoteDisplayName? | string | Remote party display name | src/types/presence.types.ts:111 |
callId? | string | Call ID if in a call | src/types/presence.types.ts:113 |
dialogId? | string | Dialog ID from dialog-info | src/types/presence.types.ts:115 |
rawState? | string | Raw state string from XML | src/types/presence.types.ts:117 |
lastUpdated? | Date | Last updated timestamp | src/types/presence.types.ts:119 |
DialogSubscription
Defined in: src/types/presence.types.ts:125
Dialog subscription info
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Subscription ID | src/types/presence.types.ts:127 |
targetUri | string | Target extension URI | src/types/presence.types.ts:129 |
state | "active" | "terminated" | "pending" | Subscription state | src/types/presence.types.ts:131 |
expires? | number | Expiry time in seconds | src/types/presence.types.ts:133 |
expiresAt? | Date | Expiry timestamp | src/types/presence.types.ts:135 |
lastEvent? | DialogEvent | Last event received | src/types/presence.types.ts:137 |
lastStatus? | DialogStatus | Last received status | src/types/presence.types.ts:139 |
DialogEvent
Defined in: src/types/presence.types.ts:145
Dialog event from subscription
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | | "error" | "state-changed" | "subscribed" | "unsubscribed" | "updated" | "refreshed" | Event type | src/types/presence.types.ts:147 |
uri | string | Extension URI | src/types/presence.types.ts:149 |
status? | DialogStatus | Dialog status | src/types/presence.types.ts:151 |
subscription? | DialogSubscription | Subscription info | src/types/presence.types.ts:153 |
timestamp | Date | Timestamp | src/types/presence.types.ts:155 |
error? | string | Error message if applicable | src/types/presence.types.ts:157 |
DialogSubscriptionOptions
Defined in: src/types/presence.types.ts:163
Options for dialog subscription
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
expires? | number | Subscription expiry in seconds | src/types/presence.types.ts:165 |
extraHeaders? | string[] | Extra SIP headers | src/types/presence.types.ts:167 |
onStateChange? | (status) => void | Callback for state changes | src/types/presence.types.ts:169 |
PresenceDisplayConfig
Defined in: src/types/presence.types.ts:175
Presence display configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
mode? | "emoji" | "icon" | "text" | Display mode: 'emoji' | 'icon' |
animations? | boolean | Enable animations | src/types/presence.types.ts:179 |
showIcon? | boolean | Show icon | src/types/presence.types.ts:181 |
showLabel? | boolean | Show label | src/types/presence.types.ts:183 |
stateOverrides? | Partial<Record<DialogState, Partial<StateDisplayOptions>>> | Custom state display overrides (legacy) | src/types/presence.types.ts:185 |
stateDisplay? | Partial<Record<DialogState, Partial<StateDisplayOptions>>> | Custom state display mapping | src/types/presence.types.ts:187 |
PresenceStatus
Defined in: src/types/presence.types.ts:209
Presence status
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | User URI | src/types/presence.types.ts:211 |
state | PresenceState | Presence state | src/types/presence.types.ts:213 |
statusMessage? | string | Custom status message | src/types/presence.types.ts:215 |
lastUpdated | Date | Last updated timestamp | src/types/presence.types.ts:217 |
metadata? | Record<string, any> | Additional metadata | src/types/presence.types.ts:220 |
PresenceSubscription
Defined in: src/types/presence.types.ts:226
Presence subscription
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Subscription ID | src/types/presence.types.ts:228 |
targetUri | string | Target URI being watched | src/types/presence.types.ts:230 |
state | "active" | "terminated" | "pending" | Subscription state | src/types/presence.types.ts:232 |
expires? | number | Expiry time | src/types/presence.types.ts:234 |
lastStatus? | PresenceStatus | Last presence status received | src/types/presence.types.ts:236 |
PresenceEvent
Defined in: src/types/presence.types.ts:242
Presence event
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | "error" | "subscribed" | "unsubscribed" | "updated" | Event type | src/types/presence.types.ts:244 |
uri | string | User URI | src/types/presence.types.ts:246 |
status? | PresenceStatus | Presence status | src/types/presence.types.ts:248 |
subscription? | PresenceSubscription | Subscription information | src/types/presence.types.ts:250 |
timestamp | Date | Timestamp | src/types/presence.types.ts:252 |
error? | string | Error message (if applicable) | src/types/presence.types.ts:254 |
PresencePublishOptions
Defined in: src/types/presence.types.ts:260
Presence options for publishing status
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
state | PresenceState | "open" | "closed" | Presence state - accepts enum values or raw PIDF basic status ('open' | 'closed') |
statusMessage? | string | Status message | src/types/presence.types.ts:264 |
expires? | number | Expiry time in seconds | src/types/presence.types.ts:266 |
extraHeaders? | string[] | Custom headers | src/types/presence.types.ts:268 |
PresenceSubscriptionOptions
Defined in: src/types/presence.types.ts:274
Presence subscription options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
expires? | number | Expiry time in seconds | src/types/presence.types.ts:276 |
extraHeaders? | string[] | Custom headers | src/types/presence.types.ts:278 |
onNotify? | (status) => void | Callback for presence notifications | src/types/presence.types.ts:280 |
ConfigProviderContext
Defined in: src/types/provider.types.ts:19
Configuration Provider Context
Provides configuration management functionality to child components
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
sipConfig | readonly | SipClientConfig | null | Current SIP configuration (readonly) | src/types/provider.types.ts:21 |
mediaConfig | readonly | MediaConfiguration | Current media configuration (readonly) | src/types/provider.types.ts:24 |
userPreferences | readonly | UserPreferences | Current user preferences (readonly) | src/types/provider.types.ts:27 |
hasSipConfig | readonly | boolean | Whether SIP configuration is set | src/types/provider.types.ts:30 |
isConfigValid | readonly | boolean | Whether configuration is valid | src/types/provider.types.ts:33 |
lastValidation | readonly | ValidationResult | null | Last validation result | src/types/provider.types.ts:36 |
Methods
setSipConfig()
setSipConfig(config, validate?): ValidationResult;Defined in: src/types/provider.types.ts:44
Set SIP configuration
Parameters
| Parameter | Type | Description |
|---|---|---|
config | SipClientConfig | SIP client configuration |
validate? | boolean | Whether to validate configuration (default: true) |
Returns
Validation result
updateSipConfig()
updateSipConfig(updates, validate?): ValidationResult;Defined in: src/types/provider.types.ts:52
Update SIP configuration (partial update)
Parameters
| Parameter | Type | Description |
|---|---|---|
updates | Partial<SipClientConfig> | Partial SIP configuration updates |
validate? | boolean | Whether to validate after update (default: true) |
Returns
Validation result
setMediaConfig()
setMediaConfig(config, validate?): ValidationResult;Defined in: src/types/provider.types.ts:60
Set media configuration
Parameters
| Parameter | Type | Description |
|---|---|---|
config | MediaConfiguration | Media configuration |
validate? | boolean | Whether to validate configuration (default: true) |
Returns
Validation result
updateMediaConfig()
updateMediaConfig(updates, validate?): ValidationResult;Defined in: src/types/provider.types.ts:68
Update media configuration (partial update)
Parameters
| Parameter | Type | Description |
|---|---|---|
updates | Partial<MediaConfiguration> | Partial media configuration updates |
validate? | boolean | Whether to validate after update (default: true) |
Returns
Validation result
setUserPreferences()
setUserPreferences(preferences): void;Defined in: src/types/provider.types.ts:74
Set user preferences
Parameters
| Parameter | Type | Description |
|---|---|---|
preferences | UserPreferences | User preferences |
Returns
void
updateUserPreferences()
updateUserPreferences(updates): void;Defined in: src/types/provider.types.ts:80
Update user preferences (partial update)
Parameters
| Parameter | Type | Description |
|---|---|---|
updates | Partial<UserPreferences> | Partial user preferences updates |
Returns
void
validateAll()
validateAll(): ValidationResult;Defined in: src/types/provider.types.ts:86
Validate all configurations
Returns
Combined validation result
reset()
reset(): void;Defined in: src/types/provider.types.ts:91
Reset configuration to initial state
Returns
void
ConfigProviderProps
Defined in: src/types/provider.types.ts:103
Configuration Provider Props
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
sipConfig? | SipClientConfig | Initial SIP configuration | src/types/provider.types.ts:105 |
mediaConfig? | MediaConfiguration | Initial media configuration | src/types/provider.types.ts:108 |
userPreferences? | UserPreferences | Initial user preferences | src/types/provider.types.ts:111 |
validateOnMount? | boolean | Whether to validate configuration on mount (default: true) | src/types/provider.types.ts:114 |
autoMerge? | boolean | Whether to automatically merge configuration with existing (default: false) | src/types/provider.types.ts:117 |
MediaProviderContext
Defined in: src/types/provider.types.ts:131
Media Provider Context
Provides media device management functionality to child components
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
audioInputDevices | readonly | readonly MediaDevice[] | Available audio input devices | src/types/provider.types.ts:134 |
audioOutputDevices | readonly | readonly MediaDevice[] | Available audio output devices | src/types/provider.types.ts:137 |
videoInputDevices | readonly | readonly MediaDevice[] | Available video input devices | src/types/provider.types.ts:140 |
allDevices | readonly | readonly MediaDevice[] | All available devices | src/types/provider.types.ts:143 |
selectedAudioInputId | readonly | string | null | Selected audio input device ID | src/types/provider.types.ts:147 |
selectedAudioOutputId | readonly | string | null | Selected audio output device ID | src/types/provider.types.ts:150 |
selectedVideoInputId | readonly | string | null | Selected video input device ID | src/types/provider.types.ts:153 |
selectedAudioInputDevice | readonly | MediaDevice | undefined | Selected audio input device | src/types/provider.types.ts:156 |
selectedAudioOutputDevice | readonly | MediaDevice | undefined | Selected audio output device | src/types/provider.types.ts:159 |
selectedVideoInputDevice | readonly | MediaDevice | undefined | Selected video input device | src/types/provider.types.ts:162 |
audioPermission | readonly | PermissionStatus | Audio permission status | src/types/provider.types.ts:166 |
videoPermission | readonly | PermissionStatus | Video permission status | src/types/provider.types.ts:169 |
hasAudioPermission | readonly | boolean | Whether audio permission is granted | src/types/provider.types.ts:172 |
hasVideoPermission | readonly | boolean | Whether video permission is granted | src/types/provider.types.ts:175 |
hasAudioInputDevices | readonly | boolean | Whether audio input devices are available | src/types/provider.types.ts:179 |
hasAudioOutputDevices | readonly | boolean | Whether audio output devices are available | src/types/provider.types.ts:182 |
hasVideoInputDevices | readonly | boolean | Whether video input devices are available | src/types/provider.types.ts:185 |
totalDevices | readonly | number | Total number of devices | src/types/provider.types.ts:188 |
isEnumerating | readonly | boolean | Whether devices are being enumerated | src/types/provider.types.ts:192 |
lastError | readonly | Error | null | Last error that occurred | src/types/provider.types.ts:195 |
Methods
enumerateDevices()
enumerateDevices(): Promise<MediaDevice[]>;Defined in: src/types/provider.types.ts:202
Enumerate available media devices
Returns
Promise<MediaDevice[]>
Promise resolving to array of devices
getDeviceById()
getDeviceById(deviceId): MediaDevice | undefined;Defined in: src/types/provider.types.ts:209
Get device by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId | string | Device ID to find |
Returns
MediaDevice | undefined
Device if found, undefined otherwise
selectAudioInput()
selectAudioInput(deviceId): void;Defined in: src/types/provider.types.ts:216
Select audio input device
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId | string | Device ID to select |
Returns
void
selectAudioOutput()
selectAudioOutput(deviceId): void;Defined in: src/types/provider.types.ts:222
Select audio output device
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId | string | Device ID to select |
Returns
void
selectVideoInput()
selectVideoInput(deviceId): void;Defined in: src/types/provider.types.ts:228
Select video input device
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId | string | Device ID to select |
Returns
void
requestAudioPermission()
requestAudioPermission(): Promise<boolean>;Defined in: src/types/provider.types.ts:235
Request audio permission
Returns
Promise<boolean>
Promise resolving to true if granted, false otherwise
requestVideoPermission()
requestVideoPermission(): Promise<boolean>;Defined in: src/types/provider.types.ts:241
Request video permission
Returns
Promise<boolean>
Promise resolving to true if granted, false otherwise
requestPermissions()
requestPermissions(audio?, video?): Promise<void>;Defined in: src/types/provider.types.ts:248
Request permissions for audio and/or video
Parameters
| Parameter | Type | Description |
|---|---|---|
audio? | boolean | Whether to request audio permission (default: true) |
video? | boolean | Whether to request video permission (default: false) |
Returns
Promise<void>
testAudioInput()
testAudioInput(deviceId?, options?): Promise<boolean>;Defined in: src/types/provider.types.ts:257
Test audio input device
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId? | string | Optional device ID to test (defaults to selected device) |
options? | { duration?: number; audioLevelThreshold?: number; } | Test options (duration, audioLevelThreshold) |
options.duration? | number | - |
options.audioLevelThreshold? | number | - |
Returns
Promise<boolean>
Promise resolving to true if test passed
testAudioOutput()
testAudioOutput(deviceId?): Promise<boolean>;Defined in: src/types/provider.types.ts:267
Test audio output device
Parameters
| Parameter | Type | Description |
|---|---|---|
deviceId? | string | Optional device ID to test (defaults to selected device) |
Returns
Promise<boolean>
Promise resolving to true if test passed
MediaProviderProps
Defined in: src/types/provider.types.ts:279
Media Provider Props
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
mediaConfig? | MediaConfiguration | Initial media configuration | src/types/provider.types.ts:281 |
autoEnumerate? | boolean | Whether to automatically enumerate devices on mount (default: true) | src/types/provider.types.ts:284 |
autoRequestPermissions? | boolean | Whether to automatically request permissions on mount (default: false) | src/types/provider.types.ts:287 |
requestAudio? | boolean | Request audio permission on mount (only if autoRequestPermissions is true, default: true) | src/types/provider.types.ts:290 |
requestVideo? | boolean | Request video permission on mount (only if autoRequestPermissions is true, default: false) | src/types/provider.types.ts:293 |
watchDeviceChanges? | boolean | Whether to automatically monitor device changes (default: true) | src/types/provider.types.ts:296 |
autoSelectDefaults? | boolean | Whether to automatically select default devices after enumeration (default: true) | src/types/provider.types.ts:299 |
RecordingIndicatorColors
Defined in: src/types/recording-indicator.types.ts:11
Recording indicator color configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
recording | string | Color when recording (default: red) | src/types/recording-indicator.types.ts:13 |
paused | string | Color when paused (default: yellow) | src/types/recording-indicator.types.ts:15 |
inactive | string | Color when inactive (default: gray) | src/types/recording-indicator.types.ts:17 |
RecordingIndicatorOptions
Defined in: src/types/recording-indicator.types.ts:23
Options for useRecordingIndicator composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
blinkInterval? | number | Blink interval in milliseconds (default: 500ms) | src/types/recording-indicator.types.ts:25 |
colors? | Partial<RecordingIndicatorColors> | Custom colors for different states | src/types/recording-indicator.types.ts:27 |
initialState? | RecordingIndicatorState | Initial state (default: 'inactive') | src/types/recording-indicator.types.ts:29 |
UseRecordingIndicatorReturn
Defined in: src/types/recording-indicator.types.ts:35
Return type for useRecordingIndicator composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
state | Ref<RecordingIndicatorState> | Current recording indicator state | src/types/recording-indicator.types.ts:37 |
isRecording | ComputedRef<boolean> | Whether currently recording | src/types/recording-indicator.types.ts:39 |
isPaused | ComputedRef<boolean> | Whether currently paused | src/types/recording-indicator.types.ts:41 |
duration | Ref<number> | Recording duration in milliseconds | src/types/recording-indicator.types.ts:43 |
formattedDuration | ComputedRef<string> | Formatted duration string (MM:SS or HH:MM:SS) | src/types/recording-indicator.types.ts:45 |
blinkState | Ref<boolean> | Blink animation state | src/types/recording-indicator.types.ts:47 |
indicatorStyle | ComputedRef<CSSProperties> | CSS styles for the indicator | src/types/recording-indicator.types.ts:49 |
setRecordingState | (state) => void | Set the recording state | src/types/recording-indicator.types.ts:51 |
reset | () => void | Reset to inactive state and clear duration | src/types/recording-indicator.types.ts:53 |
unmount? | () => void | Cleanup function for manual unmounting | src/types/recording-indicator.types.ts:55 |
PersistedSessionState
Defined in: src/types/session-persistence.types.ts:18
Persistable session state
Contains all the data needed to restore a call session after a page refresh or network reconnection.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
sessionId | string | Unique session identifier | src/types/session-persistence.types.ts:20 |
remoteUri | string | Remote party URI (SIP address) | src/types/session-persistence.types.ts:22 |
callDirection | "inbound" | "outbound" | Call direction | src/types/session-persistence.types.ts:24 |
holdState | boolean | Whether the call is on hold | src/types/session-persistence.types.ts:26 |
muteState | object | Mute state for audio and video | src/types/session-persistence.types.ts:28 |
muteState.audio | boolean | Whether audio is muted | src/types/session-persistence.types.ts:30 |
muteState.video | boolean | Whether video is muted | src/types/session-persistence.types.ts:32 |
timestamp | number | Time when session was saved (timestamp in milliseconds) | src/types/session-persistence.types.ts:35 |
customData? | Record<string, unknown> | Custom metadata for application-specific data | src/types/session-persistence.types.ts:37 |
SessionPersistenceOptions
Defined in: src/types/session-persistence.types.ts:45
Session persistence options
Configuration for the session persistence behavior.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
storageKey? | string | Storage key for IndexedDB (default: 'vuesip_session') | src/types/session-persistence.types.ts:47 |
maxAge? | number | Maximum age of saved session in milliseconds (default: 300000 = 5 minutes) | src/types/session-persistence.types.ts:49 |
autoRestore? | boolean | Auto-restore session on initialization (default: false) | src/types/session-persistence.types.ts:51 |
onRestoreSuccess? | (state) => void | Callback when session restore succeeds | src/types/session-persistence.types.ts:53 |
onRestoreError? | (error) => void | Callback when session restore fails | src/types/session-persistence.types.ts:55 |
SavedSessionInfo
Defined in: src/types/session-persistence.types.ts:63
Saved session summary information
Lightweight info about a saved session without the full state.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
exists | boolean | Whether a saved session exists | src/types/session-persistence.types.ts:65 |
sessionId? | string | Session identifier (if exists) | src/types/session-persistence.types.ts:67 |
timestamp? | number | Time when session was saved (if exists) | src/types/session-persistence.types.ts:69 |
age? | number | Age of the session in milliseconds (calculated: Date.now() - timestamp) | src/types/session-persistence.types.ts:71 |
UseSessionPersistenceReturn
Defined in: src/types/session-persistence.types.ts:79
Return type for useSessionPersistence composable
Provides methods and reactive state for managing session persistence.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
saveSession | (state) => Promise<void> | Save current session state to IndexedDB | src/types/session-persistence.types.ts:84 |
loadSession | () => Promise<PersistedSessionState | null> | Load saved session state from IndexedDB | src/types/session-persistence.types.ts:90 |
clearSession | () => Promise<void> | Clear saved session from IndexedDB | src/types/session-persistence.types.ts:95 |
hasSavedSession | Ref<boolean> | Whether a saved session exists (reactive) | src/types/session-persistence.types.ts:100 |
isLoading | Ref<boolean> | Whether an async operation is in progress | src/types/session-persistence.types.ts:105 |
error | Ref<Error | null> | Error state from the last operation | src/types/session-persistence.types.ts:110 |
savedSessionInfo | ComputedRef<SavedSessionInfo | null> | Summary info about the saved session (without full state) | src/types/session-persistence.types.ts:115 |
SipUri
Defined in: src/types/sip.types.ts:9
SIP URI type with utility methods
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | The complete SIP URI (e.g., 'sip:user@domain.com') | src/types/sip.types.ts:11 |
scheme | "sip" | "sips" | Scheme (sip or sips) | src/types/sip.types.ts:13 |
user | string | Username part | src/types/sip.types.ts:15 |
host | string | Host/domain part | src/types/sip.types.ts:17 |
port? | number | Port number (optional) | src/types/sip.types.ts:19 |
displayName? | string | Display name (optional) | src/types/sip.types.ts:21 |
parameters? | Record<string, string> | URI parameters | src/types/sip.types.ts:23 |
headers? | Record<string, string> | URI headers | src/types/sip.types.ts:25 |
Methods
toString()
toString(): string;Defined in: src/types/sip.types.ts:28
Convert to string representation
Returns
string
clone()
clone(): SipUri;Defined in: src/types/sip.types.ts:30
Clone the SIP URI
Returns
AuthenticationChallenge
Defined in: src/types/sip.types.ts:158
Authentication challenge information
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
realm | string | Authentication realm | src/types/sip.types.ts:160 |
nonce | string | Nonce value | src/types/sip.types.ts:162 |
qop? | string | Quality of protection | src/types/sip.types.ts:164 |
opaque? | string | Opaque value | src/types/sip.types.ts:166 |
algorithm? | "MD5" | "SHA-256" | Algorithm (default: MD5) | src/types/sip.types.ts:168 |
stale? | boolean | Stale flag | src/types/sip.types.ts:170 |
AuthenticationCredentials
Defined in: src/types/sip.types.ts:176
Authentication credentials
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
username | string | Username | src/types/sip.types.ts:178 |
password? | string | Password | src/types/sip.types.ts:180 |
ha1? | string | HA1 hash (alternative to password) | src/types/sip.types.ts:182 |
realm? | string | Realm | src/types/sip.types.ts:184 |
SipEvent
Defined in: src/types/sip.types.ts:190
SIP event base interface
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | string | Event type | src/types/sip.types.ts:192 |
timestamp | Date | Timestamp when the event occurred | src/types/sip.types.ts:194 |
data? | unknown | Additional event data | src/types/sip.types.ts:196 |
RegistrationEvent
Defined in: src/types/sip.types.ts:202
SIP registration event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
timestamp | Date | Timestamp when the event occurred | - | SipEvent.timestamp | src/types/sip.types.ts:194 |
data? | unknown | Additional event data | - | SipEvent.data | src/types/sip.types.ts:196 |
type | "registration" | "unregistration" | "registrationFailed" | Event type | SipEvent.type | - | src/types/sip.types.ts:203 |
state | RegistrationState | Registration state | - | - | src/types/sip.types.ts:205 |
responseCode? | SipResponseCode | Response code | - | - | src/types/sip.types.ts:207 |
reasonPhrase? | string | Reason phrase | - | - | src/types/sip.types.ts:209 |
expires? | number | Expiry time in seconds | - | - | src/types/sip.types.ts:211 |
ConnectionEvent
Defined in: src/types/sip.types.ts:217
SIP connection event
Extends
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
timestamp | Date | Timestamp when the event occurred | - | SipEvent.timestamp | src/types/sip.types.ts:194 |
data? | unknown | Additional event data | - | SipEvent.data | src/types/sip.types.ts:196 |
type | "disconnected" | "connected" | "connectionFailed" | Event type | SipEvent.type | - | src/types/sip.types.ts:218 |
state | ConnectionState | Connection state | - | - | src/types/sip.types.ts:220 |
error? | string | Error message if applicable | - | - | src/types/sip.types.ts:222 |
retryAttempt? | number | Retry attempt number | - | - | src/types/sip.types.ts:224 |
SipMessageOptions
Defined in: src/types/sip.types.ts:230
SIP message options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
contentType? | string | Content type (default: 'text/plain') | src/types/sip.types.ts:232 |
extraHeaders? | string[] | Custom headers | src/types/sip.types.ts:234 |
eventHandlers? | object | Event handlers | src/types/sip.types.ts:236 |
eventHandlers.succeeded? | (response) => void | - | src/types/sip.types.ts:237 |
eventHandlers.failed? | (response) => void | - | src/types/sip.types.ts:238 |
RegisterOptions
Defined in: src/types/sip.types.ts:258
Registration options
Configuration options for SIP REGISTER requests. Used when registering the SIP client with the SIP server.
Example
const options: RegisterOptions = {
expires: 3600, // Register for 1 hour
extraHeaders: ['X-Custom-Header: value'],
instanceId: 'unique-device-id'
}
await sipClient.register(options)Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
expires? | number | Registration expiry time in seconds Default is typically 600 seconds (10 minutes) Range: 60-3600 seconds recommended | src/types/sip.types.ts:264 |
extraHeaders? | string[] | Extra SIP headers to include in REGISTER request Example: ['X-Custom-Header: value', 'X-Auth-Token: token'] | src/types/sip.types.ts:270 |
extraContactUriParams? | string[] | Extra contact URI parameters These are appended to the Contact header URI Example: ['+sip.instance="urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF"'] | src/types/sip.types.ts:277 |
instanceId? | string | Instance ID for multiple registrations Used to uniquely identify this client instance when multiple devices register with the same SIP URI | src/types/sip.types.ts:284 |
refreshInterval? | number | Registration refresh interval in seconds How often to send re-REGISTER requests Should be less than expires value | src/types/sip.types.ts:291 |
StorageResult
Defined in: src/types/storage.types.ts:14
Storage operation result
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
success | boolean | Whether the operation succeeded | src/types/storage.types.ts:16 |
data? | T | The data (if successful) | src/types/storage.types.ts:18 |
error? | string | Error message (if failed) | src/types/storage.types.ts:20 |
StorageAdapter
Defined in: src/types/storage.types.ts:28
Storage adapter interface
All storage adapters must implement this interface
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
name | readonly | string | Adapter name (for debugging) | src/types/storage.types.ts:30 |
Methods
get()
get<T>(key): Promise<StorageResult<T>>;Defined in: src/types/storage.types.ts:37
Get a value from storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<T>>
Promise resolving to the value or null if not found
set()
set<T>(key, value): Promise<StorageResult<void>>;Defined in: src/types/storage.types.ts:45
Set a value in storage
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
value | T | Value to store |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
remove()
remove(key): Promise<StorageResult<void>>;Defined in: src/types/storage.types.ts:52
Remove a value from storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
clear()
clear(prefix?): Promise<StorageResult<void>>;Defined in: src/types/storage.types.ts:59
Clear all values from storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<StorageResult<void>>
Promise resolving to success status
has()
has(key): Promise<boolean>;Defined in: src/types/storage.types.ts:66
Check if a key exists in storage
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | Storage key |
Returns
Promise<boolean>
Promise resolving to true if key exists
keys()
keys(prefix?): Promise<string[]>;Defined in: src/types/storage.types.ts:73
Get all keys in storage (with optional prefix filter)
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix? | string | Optional prefix to filter keys |
Returns
Promise<string[]>
Promise resolving to array of keys
EncryptionOptions
Defined in: src/types/storage.types.ts:79
Storage encryption options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled | boolean | Whether to encrypt the data | src/types/storage.types.ts:81 |
algorithm? | "AES-GCM" | "AES-CBC" | Encryption algorithm (default: AES-GCM) | src/types/storage.types.ts:83 |
iterations? | number | Key derivation function iterations (default: 100000) | src/types/storage.types.ts:85 |
salt? | string | Salt for key derivation (will be generated if not provided) | src/types/storage.types.ts:87 |
EncryptedData
Defined in: src/types/storage.types.ts:93
Encrypted data structure
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
data | string | Encrypted data as base64 string | src/types/storage.types.ts:95 |
iv | string | Initialization vector as base64 string | src/types/storage.types.ts:97 |
salt | string | Salt used for key derivation as base64 string | src/types/storage.types.ts:99 |
algorithm | string | Algorithm used | src/types/storage.types.ts:101 |
iterations | number | Key derivation iterations | src/types/storage.types.ts:103 |
version | number | Version (for future migrations) | src/types/storage.types.ts:105 |
StorageConfig
Defined in: src/types/storage.types.ts:111
Storage configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
prefix? | string | Storage key prefix (default: 'vuesip') | src/types/storage.types.ts:113 |
version? | string | Storage version (for migrations, default: '1') | src/types/storage.types.ts:115 |
encryption? | EncryptionOptions | Encryption configuration for sensitive data | src/types/storage.types.ts:117 |
StoredSipCredentials
Defined in: src/types/storage.types.ts:158
Stored SIP credentials (to be encrypted)
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
username | string | SIP username | src/types/storage.types.ts:160 |
password | string | SIP password | src/types/storage.types.ts:162 |
authorizationUsername? | string | Authorization username (if different from username) | src/types/storage.types.ts:164 |
ha1? | string | HA1 hash (if using pre-computed hash) | src/types/storage.types.ts:166 |
StoredSipConfig
Defined in: src/types/storage.types.ts:172
Stored SIP configuration (to be encrypted)
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
uri | string | WebSocket URI | src/types/storage.types.ts:174 |
credentials | StoredSipCredentials | Credentials | src/types/storage.types.ts:176 |
displayName? | string | Display name | src/types/storage.types.ts:178 |
contactUri? | string | Contact URI | src/types/storage.types.ts:180 |
instanceId? | string | Instance ID | src/types/storage.types.ts:182 |
StoredMediaConfig
Defined in: src/types/storage.types.ts:188
Stored media configuration
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audio? | MediaTrackConstraints | Audio constraints | src/types/storage.types.ts:190 |
video? | boolean | MediaTrackConstraints | Video constraints | src/types/storage.types.ts:192 |
iceServers? | RTCIceServer[] | STUN/TURN servers | src/types/storage.types.ts:194 |
StoredUserPreferences
Defined in: src/types/storage.types.ts:200
Stored user preferences
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
autoAnswer? | boolean | Auto-answer incoming calls | src/types/storage.types.ts:202 |
autoAnswerDelay? | number | Auto-answer delay in milliseconds | src/types/storage.types.ts:204 |
enableAudio? | boolean | Enable audio by default | src/types/storage.types.ts:206 |
enableVideo? | boolean | Enable video by default | src/types/storage.types.ts:208 |
enableCallHistory? | boolean | Enable call history | src/types/storage.types.ts:210 |
callHistoryMaxEntries? | number | Call history max entries | src/types/storage.types.ts:212 |
debug? | boolean | Enable debug logging | src/types/storage.types.ts:214 |
StoredDeviceSelection
Defined in: src/types/storage.types.ts:220
Stored device selection
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
audioInput? | string | Selected audio input device ID | src/types/storage.types.ts:222 |
audioOutput? | string | Selected audio output device ID | src/types/storage.types.ts:224 |
videoInput? | string | Selected video input device ID | src/types/storage.types.ts:226 |
StoredDevicePermissions
Defined in: src/types/storage.types.ts:232
Stored device permissions
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
microphone | "granted" | "denied" | "prompt" | "not-requested" | Microphone permission status | src/types/storage.types.ts:234 |
camera | "granted" | "denied" | "prompt" | "not-requested" | Camera permission status | src/types/storage.types.ts:236 |
speaker | "granted" | "denied" | "prompt" | "not-requested" | Speaker permission status | src/types/storage.types.ts:238 |
lastUpdated | number | Last updated timestamp | src/types/storage.types.ts:240 |
TranscriptEntry
Defined in: src/types/transcription.types.ts:25
A single transcript entry representing finalized speech
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique identifier for this entry | src/types/transcription.types.ts:27 |
participantId | string | Unique participant identifier | src/types/transcription.types.ts:29 |
participantName? | string | Display name of the speaker (if available) | src/types/transcription.types.ts:31 |
speaker | SpeakerType | Whether this is local or remote audio | src/types/transcription.types.ts:33 |
text | string | The transcribed text | src/types/transcription.types.ts:35 |
timestamp | number | Unix timestamp when speech started | src/types/transcription.types.ts:37 |
confidence? | number | Confidence score from provider (0-1) | src/types/transcription.types.ts:39 |
isFinal | boolean | Whether this is a final or interim result | src/types/transcription.types.ts:41 |
language? | string | Detected or configured language code | src/types/transcription.types.ts:43 |
words? | WordTimestamp[] | Word-level timestamps if supported by provider | src/types/transcription.types.ts:45 |
WordTimestamp
Defined in: src/types/transcription.types.ts:51
Word-level timing information
Properties
| Property | Type | Defined in |
|---|---|---|
word | string | src/types/transcription.types.ts:52 |
startTime | number | src/types/transcription.types.ts:53 |
endTime | number | src/types/transcription.types.ts:54 |
confidence? | number | src/types/transcription.types.ts:55 |
ParticipantConfig
Defined in: src/types/transcription.types.ts:65
Configuration for a participant's transcription
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique participant identifier | src/types/transcription.types.ts:67 |
name? | string | Display name | src/types/transcription.types.ts:69 |
enabled | boolean | Whether transcription is enabled for this participant | src/types/transcription.types.ts:71 |
language? | string | Language code for this participant (overrides default) | src/types/transcription.types.ts:73 |
audioSource? | MediaStream | AudioNode | Audio source for this participant | src/types/transcription.types.ts:75 |
ProviderCapabilities
Defined in: src/types/transcription.types.ts:85
Capabilities supported by a transcription provider
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
streaming | boolean | Supports real-time streaming transcription | src/types/transcription.types.ts:87 |
interimResults | boolean | Provides interim results while speaking | src/types/transcription.types.ts:89 |
languageDetection | boolean | Can auto-detect language | src/types/transcription.types.ts:91 |
multiChannel | boolean | Supports multiple audio channels | src/types/transcription.types.ts:93 |
punctuation | boolean | Adds punctuation automatically | src/types/transcription.types.ts:95 |
speakerDiarization | boolean | Can identify different speakers | src/types/transcription.types.ts:97 |
wordTimestamps | boolean | Provides word-level timestamps | src/types/transcription.types.ts:99 |
supportedLanguages | string[] | List of supported language codes | src/types/transcription.types.ts:101 |
TranscriptResult
Defined in: src/types/transcription.types.ts:107
Result from a transcription provider
Properties
| Property | Type | Defined in |
|---|---|---|
text | string | src/types/transcription.types.ts:108 |
isFinal | boolean | src/types/transcription.types.ts:109 |
confidence? | number | src/types/transcription.types.ts:110 |
language? | string | src/types/transcription.types.ts:111 |
words? | WordTimestamp[] | src/types/transcription.types.ts:112 |
AudioSource
Defined in: src/types/transcription.types.ts:118
Audio source abstraction for providers
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
stream | MediaStream | The media stream to transcribe | src/types/transcription.types.ts:120 |
id | string | Identifier for this audio source | src/types/transcription.types.ts:122 |
type | SpeakerType | Type of speaker | src/types/transcription.types.ts:124 |
ProviderOptions
Defined in: src/types/transcription.types.ts:130
Provider-specific configuration options
Extended by
Indexable
[key: string]: unknownAdditional provider-specific options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
apiKey? | string | API key (for cloud providers) | src/types/transcription.types.ts:132 |
language? | string | Language code | src/types/transcription.types.ts:134 |
interimResults? | boolean | Enable interim results | src/types/transcription.types.ts:136 |
endpoint? | string | Custom endpoint URL | src/types/transcription.types.ts:138 |
TranscriptionProvider
Defined in: src/types/transcription.types.ts:146
Interface that all transcription providers must implement
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
name | readonly | string | Provider identifier | src/types/transcription.types.ts:148 |
capabilities | readonly | ProviderCapabilities | Provider capabilities | src/types/transcription.types.ts:150 |
Methods
initialize()
initialize(options): Promise<void>;Defined in: src/types/transcription.types.ts:153
Initialize the provider with options
Parameters
| Parameter | Type |
|---|---|
options | ProviderOptions |
Returns
Promise<void>
dispose()
dispose(): void;Defined in: src/types/transcription.types.ts:155
Clean up provider resources
Returns
void
startStream()
startStream(audioSource): void;Defined in: src/types/transcription.types.ts:158
Start transcribing an audio source
Parameters
| Parameter | Type |
|---|---|
audioSource | AudioSource |
Returns
void
stopStream()
stopStream(): void;Defined in: src/types/transcription.types.ts:160
Stop transcribing
Returns
void
onInterim()
onInterim(callback): void;Defined in: src/types/transcription.types.ts:163
Register callback for interim results
Parameters
| Parameter | Type |
|---|---|
callback | (text, sourceId) => void |
Returns
void
onFinal()
onFinal(callback): void;Defined in: src/types/transcription.types.ts:165
Register callback for final results
Parameters
| Parameter | Type |
|---|---|
callback | (result, sourceId) => void |
Returns
void
onError()
onError(callback): void;Defined in: src/types/transcription.types.ts:167
Register callback for errors
Parameters
| Parameter | Type |
|---|---|
callback | (error) => void |
Returns
void
detectLanguage()?
optional detectLanguage(audio): Promise<string>;Defined in: src/types/transcription.types.ts:170
Detect language from audio sample (optional)
Parameters
| Parameter | Type |
|---|---|
audio | AudioBuffer |
Returns
Promise<string>
getSupportedLanguages()?
optional getSupportedLanguages(): string[];Defined in: src/types/transcription.types.ts:172
Get list of supported languages (optional)
Returns
string[]
KeywordRule
Defined in: src/types/transcription.types.ts:182
Keyword or phrase to detect in transcripts
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique identifier for this rule | src/types/transcription.types.ts:184 |
phrase | string | RegExp | Exact phrase or regex pattern to match | src/types/transcription.types.ts:186 |
action | string | Action identifier to trigger on match | src/types/transcription.types.ts:188 |
speakerFilter? | SpeakerType | Only match specific speakers | src/types/transcription.types.ts:190 |
caseSensitive? | boolean | Case-sensitive matching (default: false) | src/types/transcription.types.ts:192 |
KeywordMatch
Defined in: src/types/transcription.types.ts:198
Result of a keyword match
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
rule | KeywordRule | The rule that matched | src/types/transcription.types.ts:200 |
matchedText | string | The matched text | src/types/transcription.types.ts:202 |
entry | TranscriptEntry | The full transcript entry containing the match | src/types/transcription.types.ts:204 |
position | object | Position of match in the text | src/types/transcription.types.ts:206 |
position.start | number | - | src/types/transcription.types.ts:206 |
position.end | number | - | src/types/transcription.types.ts:206 |
RedactionConfig
Defined in: src/types/transcription.types.ts:229
Configuration for PII redaction
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
enabled | boolean | Enable PII redaction | src/types/transcription.types.ts:231 |
patterns | PIIType[] | Types of PII to detect | src/types/transcription.types.ts:233 |
replacement? | string | Replacement text for redacted content | src/types/transcription.types.ts:235 |
customPatterns? | RegExp[] | Custom regex patterns for 'custom' type | src/types/transcription.types.ts:237 |
onRedacted? | (type, original, entry) => void | Callback when PII is redacted | src/types/transcription.types.ts:239 |
RedactionResult
Defined in: src/types/transcription.types.ts:245
Result of PII redaction
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
original | string | Original text | src/types/transcription.types.ts:247 |
redacted | string | Redacted text | src/types/transcription.types.ts:249 |
detections | object[] | Detected PII instances | src/types/transcription.types.ts:251 |
ExportOptions
Defined in: src/types/transcription.types.ts:270
Options for transcript export
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
includeTimestamps? | boolean | Include timestamps | src/types/transcription.types.ts:272 |
includeSpeakers? | boolean | Include speaker names | src/types/transcription.types.ts:274 |
includeConfidence? | boolean | Include confidence scores | src/types/transcription.types.ts:276 |
speakerFilter? | SpeakerType | Filter by speaker type | src/types/transcription.types.ts:278 |
timeRange? | object | Filter by time range | src/types/transcription.types.ts:280 |
timeRange.start | number | - | src/types/transcription.types.ts:280 |
timeRange.end | number | - | src/types/transcription.types.ts:280 |
TranscriptionOptions
Defined in: src/types/transcription.types.ts:290
Options for useTranscription composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
provider? | string | Provider to use (default: 'web-speech') | src/types/transcription.types.ts:292 |
providerOptions? | ProviderOptions | Provider-specific options | src/types/transcription.types.ts:294 |
language? | string | Default language code | src/types/transcription.types.ts:296 |
autoDetectLanguage? | boolean | Enable auto language detection | src/types/transcription.types.ts:298 |
supportedLanguages? | string[] | Limit auto-detection to these languages | src/types/transcription.types.ts:300 |
localEnabled? | boolean | Enable local audio transcription | src/types/transcription.types.ts:302 |
remoteEnabled? | boolean | Enable remote audio transcription | src/types/transcription.types.ts:304 |
localName? | string | Display name for local participant | src/types/transcription.types.ts:306 |
remoteName? | string | Display name for remote participant | src/types/transcription.types.ts:308 |
keywords? | KeywordRule[] | Keyword detection rules | src/types/transcription.types.ts:310 |
redaction? | RedactionConfig | PII redaction configuration | src/types/transcription.types.ts:312 |
onTranscript? | (entry) => void | Callback when transcript entry is added | src/types/transcription.types.ts:314 |
onKeywordDetected? | (match) => void | Callback when keyword is detected | src/types/transcription.types.ts:316 |
onLanguageDetected? | (language, participantId) => void | Callback when language is detected | src/types/transcription.types.ts:318 |
onError? | (error) => void | Callback when error occurs | src/types/transcription.types.ts:320 |
UseTranscriptionReturn
Defined in: src/types/transcription.types.ts:326
Return type for useTranscription composable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
state | ComputedRef<TranscriptionState> | Current transcription state | src/types/transcription.types.ts:329 |
isTranscribing | ComputedRef<boolean> | Whether transcription is active | src/types/transcription.types.ts:331 |
transcript | Ref<TranscriptEntry[]> | Full transcript history | src/types/transcription.types.ts:333 |
currentUtterance | Ref<string> | Current interim text (not yet finalized) | src/types/transcription.types.ts:335 |
error | Ref<Error | null> | Last error that occurred | src/types/transcription.types.ts:337 |
participants | Ref<Map<string, ParticipantConfig>> | Map of participant configurations | src/types/transcription.types.ts:341 |
enableParticipant | (id) => void | Enable transcription for a participant | src/types/transcription.types.ts:343 |
disableParticipant | (id) => void | Disable transcription for a participant | src/types/transcription.types.ts:345 |
setParticipantLanguage | (id, language) => void | Set language for a participant | src/types/transcription.types.ts:347 |
setParticipantName | (id, name) => void | Set display name for a participant | src/types/transcription.types.ts:349 |
start | () => Promise<void> | Start transcription | src/types/transcription.types.ts:353 |
stop | () => void | Stop transcription | src/types/transcription.types.ts:355 |
clear | () => void | Clear transcript history | src/types/transcription.types.ts:357 |
localEnabled | Ref<boolean> | Enable/disable local audio transcription | src/types/transcription.types.ts:361 |
remoteEnabled | Ref<boolean> | Enable/disable remote audio transcription | src/types/transcription.types.ts:363 |
detectedLanguage | Ref<string | null> | Detected language (if auto-detect enabled) | src/types/transcription.types.ts:367 |
lockLanguage | (language) => void | Lock language (stop auto-detection) | src/types/transcription.types.ts:369 |
provider | ComputedRef<string> | Current provider name | src/types/transcription.types.ts:373 |
switchProvider | (name, options?) => Promise<void> | Switch to a different provider | src/types/transcription.types.ts:375 |
getCapabilities | () => ProviderCapabilities | null | Get provider capabilities | src/types/transcription.types.ts:377 |
addKeyword | (rule) => string | Add a keyword rule | src/types/transcription.types.ts:381 |
removeKeyword | (id) => void | Remove a keyword rule | src/types/transcription.types.ts:383 |
getKeywords | () => KeywordRule[] | Get all keyword rules | src/types/transcription.types.ts:385 |
exportTranscript | (format, options?) => string | Export transcript in specified format | src/types/transcription.types.ts:389 |
searchTranscript | (query, options?) => TranscriptEntry[] | Search transcript for text | src/types/transcription.types.ts:391 |
onTranscript | (callback) => () => void | Register callback for new transcript entries | src/types/transcription.types.ts:395 |
onKeywordDetected | (callback) => () => void | Register callback for keyword matches | src/types/transcription.types.ts:397 |
TransferOptions
Defined in: src/types/transfer.types.ts:39
Transfer options
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type | TransferType | Transfer type | src/types/transfer.types.ts:41 |
target | string | Target URI for transfer | src/types/transfer.types.ts:43 |
consultationCallId? | string | Consultation call ID (required for attended transfer) | src/types/transfer.types.ts:45 |
extraHeaders? | string[] | Custom SIP headers | src/types/transfer.types.ts:47 |
TransferEvent
Defined in: src/types/transfer.types.ts:53
Transfer event
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
type? | string | Event type | src/types/transfer.types.ts:55 |
transferId | string | Transfer ID | src/types/transfer.types.ts:57 |
state? | TransferState | Transfer state | src/types/transfer.types.ts:59 |
transferType? | TransferType | Transfer type | src/types/transfer.types.ts:61 |
target? | string | Target URI | src/types/transfer.types.ts:63 |
callId? | string | Call ID being transferred | src/types/transfer.types.ts:65 |
consultationCallId? | string | Consultation call ID (for attended transfer) | src/types/transfer.types.ts:67 |
timestamp | Date | Timestamp | src/types/transfer.types.ts:69 |
error? | string | Error message (if failed) | src/types/transfer.types.ts:71 |
TransferProgress
Defined in: src/types/transfer.types.ts:77
Transfer progress information
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Transfer ID | src/types/transfer.types.ts:79 |
state | TransferState | Current state | src/types/transfer.types.ts:81 |
type | TransferType | Transfer type | src/types/transfer.types.ts:83 |
target | string | Target URI | src/types/transfer.types.ts:85 |
progress? | number | Progress percentage (0-100) | src/types/transfer.types.ts:87 |
TransferResult
Defined in: src/types/transfer.types.ts:93
Transfer result
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
success | boolean | Whether transfer was successful | src/types/transfer.types.ts:95 |
transferId? | string | Transfer ID | src/types/transfer.types.ts:97 |
error? | string | Error message if failed | src/types/transfer.types.ts:99 |
state | TransferState | Transfer state | src/types/transfer.types.ts:101 |
ErrorContext
Defined in: src/utils/errorContext.ts:37
Error context structure
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
operation | string | Operation being performed when error occurred | src/utils/errorContext.ts:39 |
component | string | Component or module where error occurred | src/utils/errorContext.ts:41 |
severity | ErrorSeverity | Error severity level | src/utils/errorContext.ts:43 |
timestamp | Date | Timestamp when error occurred | src/utils/errorContext.ts:45 |
duration? | number | Duration of operation before error (ms) | src/utils/errorContext.ts:47 |
context? | Record<string, unknown> | Additional context data | src/utils/errorContext.ts:49 |
state? | Record<string, unknown> | Current state snapshot | src/utils/errorContext.ts:51 |
userId? | string | User ID or session identifier | src/utils/errorContext.ts:53 |
stack? | string | Stack trace (if available) | src/utils/errorContext.ts:55 |
ErrorLogEntry
Defined in: src/utils/errorContext.ts:61
Formatted error log entry
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
message | string | Error message | src/utils/errorContext.ts:63 |
context | ErrorContext | Error context | src/utils/errorContext.ts:65 |
error? | unknown | Original error object | src/utils/errorContext.ts:67 |
Type Aliases
InsetPosition
type InsetPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";Defined in: src/composables/useVideoInset.ts:6
Position options for the inset video
InsetSize
type InsetSize = "small" | "medium" | "large" | "custom";Defined in: src/composables/useVideoInset.ts:11
Size presets for the inset video
StorageType
type StorageType = "local" | "session" | "none";Defined in: src/providers/types.ts:85
Storage options for credentials
BlockReason
type BlockReason =
| "spam"
| "harassment"
| "telemarketer"
| "robocall"
| "unwanted"
| "scam"
| "manual"
| "imported";Defined in: src/types/blacklist.types.ts:13
Reason why a number was blocked
BlockAction
type BlockAction = "hangup" | "busy" | "congestion" | "voicemail" | "announcement";Defined in: src/types/blacklist.types.ts:26
Action to take when blocked call is received
QualityGrade
type QualityGrade = "A" | "B" | "C" | "D" | "F";Defined in: src/types/call-quality.types.ts:17
Quality grade assignment based on overall score
QualityTrendDirection
type QualityTrendDirection = "improving" | "stable" | "degrading";Defined in: src/types/call-quality.types.ts:70
Quality trend direction
NetworkQualityLevel
type NetworkQualityLevel = "excellent" | "good" | "fair" | "poor" | "critical" | "unknown";Defined in: src/types/call-quality.types.ts:159
Network quality level for visual indicators
SignalBars
type SignalBars = 1 | 2 | 3 | 4 | 5;Defined in: src/types/call-quality.types.ts:164
Signal bar count (1-5)
NetworkQualityIcon
type NetworkQualityIcon =
| "signal-excellent"
| "signal-good"
| "signal-fair"
| "signal-poor"
| "signal-critical"
| "signal-unknown";Defined in: src/types/call-quality.types.ts:169
Icon name for network quality
NetworkQualityColors
type NetworkQualityColors = Record<NetworkQualityLevel, string>;Defined in: src/types/call-quality.types.ts:214
Color scheme for network quality levels
BandwidthAction
type BandwidthAction = "upgrade" | "maintain" | "downgrade" | "critical";Defined in: src/types/call-quality.types.ts:302
Bandwidth adaptation action
RecommendationPriority
type RecommendationPriority = "low" | "medium" | "high" | "critical";Defined in: src/types/call-quality.types.ts:307
Priority level for recommendations
SuggestionType
type SuggestionType = "video" | "audio" | "network" | "codec";Defined in: src/types/call-quality.types.ts:312
Suggestion type for bandwidth adaptation
HoldDirection
type HoldDirection = "sendrecv" | "sendonly" | "recvonly" | "inactive";Defined in: src/types/call.types.ts:365
SDP direction values for hold state
CallbackPriority
type CallbackPriority = "low" | "normal" | "high" | "urgent";Defined in: src/types/callback.types.ts:20
Callback priority levels
RecoveryState
type RecoveryState = "stable" | "monitoring" | "recovering" | "failed";Defined in: src/types/connection-recovery.types.ts:25
Connection recovery state
RecoveryStrategy
type RecoveryStrategy = "ice-restart" | "reconnect" | "none";Defined in: src/types/connection-recovery.types.ts:34
Recovery strategy to use
EventPayload
type EventPayload<T> = T extends BaseEvent<infer P> ? P : never;Defined in: src/types/events.types.ts:80
Event payload generic type
Type Parameters
| Type Parameter |
|---|
T extends BaseEvent |
EventHandler()
type EventHandler<T> = (event) => void | Promise<void>;Defined in: src/types/events.types.ts:85
Event handler type
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
event | T |
Returns
void | Promise<void>
SafeEventHandler()
type SafeEventHandler<T> = (event) => void;Defined in: src/types/events.types.ts:90
Event handler with error boundary
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
event | T |
Returns
void
EventName
type EventName = typeof EventNames[keyof typeof EventNames];Defined in: src/types/events.types.ts:179
Event name type
WildcardPattern
type WildcardPattern = `${string}:*` | "*";Defined in: src/types/events.types.ts:184
Wildcard event pattern
GalleryLayoutMode
type GalleryLayoutMode = "grid" | "speaker" | "sidebar" | "spotlight";Defined in: src/types/gallery-layout.types.ts:20
Gallery layout mode
- grid: Standard grid layout with equal-sized tiles
- speaker: Focus on dominant speaker with smaller tiles for others
- sidebar: Main content with sidebar of participant tiles
- spotlight: Single participant in focus
AudioDevice
type AudioDevice = MediaDevice;Defined in: src/types/media.types.ts:36
Audio device (alias for MediaDevice for backward compatibility)
OAuth2ProviderType
type OAuth2ProviderType =
| "google"
| "microsoft"
| "github"
| "okta"
| "auth0"
| "keycloak"
| "custom";Defined in: src/types/oauth.types.ts:13
Supported OAuth2 providers
OAuth2GrantType
type OAuth2GrantType =
| "authorization_code"
| "authorization_code_pkce"
| "implicit"
| "client_credentials";Defined in: src/types/oauth.types.ts:25
OAuth2 grant types supported
SipPasswordStrategy
type SipPasswordStrategy =
| {
type: "access_token";
}
| {
type: "id_token";
}
| {
type: "hash";
algorithm: "sha256" | "sha512";
salt?: string;
}
| {
type: "api_generated";
endpoint: string;
method?: "GET" | "POST";
}
| {
type: "static";
password: string;
}
| {
type: "custom";
generator: (tokens, userInfo) => string | Promise<string>;
};Defined in: src/types/oauth.types.ts:230
Strategy for generating SIP passwords from OAuth2 tokens
OAuth2AuthState
type OAuth2AuthState =
| "idle"
| "redirecting"
| "exchanging_code"
| "fetching_user_info"
| "provisioning"
| "authenticated"
| "error"
| "token_refresh";Defined in: src/types/oauth.types.ts:270
OAuth2 authentication state
HookName
type HookName =
| typeof HOOK_NAMES[keyof typeof HOOK_NAMES]
| string;Defined in: src/types/plugin.types.ts:84
Hook name type
HookHandler()
type HookHandler<TData, TReturn> = (context, data?) => TReturn | Promise<TReturn>;Defined in: src/types/plugin.types.ts:93
Hook handler function
Receives context and optional data, can return a value or Promise. Returning false stops hook propagation.
Type Parameters
| Type Parameter | Default type |
|---|---|
TData | any |
TReturn | any |
Parameters
| Parameter | Type |
|---|---|
context | PluginContext |
data? | TData |
Returns
TReturn | Promise<TReturn>
RecordingIndicatorState
type RecordingIndicatorState = "inactive" | "recording" | "paused" | "stopped";Defined in: src/types/recording-indicator.types.ts:6
Recording indicator state enumeration
StorageKey
type StorageKey = typeof STORAGE_KEYS[keyof typeof STORAGE_KEYS];Defined in: src/types/storage.types.ts:153
Storage key type
SpeakerType
type SpeakerType = "local" | "remote";Defined in: src/types/transcription.types.ts:15
Identifies the source of transcribed speech
TranscriptionState
type TranscriptionState = "idle" | "starting" | "active" | "stopping" | "error";Defined in: src/types/transcription.types.ts:20
Current state of the transcription system
PIIType
type PIIType =
| "credit-card"
| "ssn"
| "phone-number"
| "email"
| "address"
| "name"
| "date-of-birth"
| "custom";Defined in: src/types/transcription.types.ts:216
Types of PII that can be detected and redacted
ExportFormat
type ExportFormat = "json" | "txt" | "srt" | "vtt" | "csv";Defined in: src/types/transcription.types.ts:265
Supported export formats
LogLevel
type LogLevel = typeof LOG_LEVELS[number];Defined in: src/utils/logger.ts:15
Log level type
LogHandler()
type LogHandler = (level, namespace, message, ...args) => void;Defined in: src/utils/logger.ts:80
Custom log handler function
Parameters
| Parameter | Type |
|---|---|
level | LogLevel |
namespace | string |
message | string |
...args | unknown[] |
Returns
void
Variables
REGISTRATION_CONSTANTS
const REGISTRATION_CONSTANTS: object;Defined in: src/composables/constants.ts:13
Registration configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
DEFAULT_EXPIRES | 600 | 600 | Default registration expiry time in seconds | src/composables/constants.ts:15 |
DEFAULT_MAX_RETRIES | 3 | 3 | Default maximum retry attempts | src/composables/constants.ts:18 |
REFRESH_PERCENTAGE | 0.9 | 0.9 | Registration refresh percentage (refresh at 90% of expiry time) | src/composables/constants.ts:21 |
EXPIRING_SOON_THRESHOLD | 30 | 30 | Seconds threshold for "expiring soon" warning | src/composables/constants.ts:24 |
BASE_RETRY_DELAY | 1000 | 1000 | Base retry delay in milliseconds | src/composables/constants.ts:27 |
MAX_RETRY_DELAY | 30000 | 30000 | Maximum retry delay in milliseconds (30 seconds) | src/composables/constants.ts:30 |
PRESENCE_CONSTANTS
const PRESENCE_CONSTANTS: object;Defined in: src/composables/constants.ts:36
Presence configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
DEFAULT_EXPIRES | 3600 | 3600 | Default presence publish expiry in seconds | src/composables/constants.ts:38 |
SUBSCRIPTION_REFRESH_PERCENTAGE | 0.9 | 0.9 | Subscription refresh percentage (refresh at 90% of expiry time) | src/composables/constants.ts:41 |
DEFAULT_SUBSCRIPTION_EXPIRES | 3600 | 3600 | Default subscription expiry in seconds | src/composables/constants.ts:44 |
MESSAGING_CONSTANTS
const MESSAGING_CONSTANTS: object;Defined in: src/composables/constants.ts:50
Messaging configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
COMPOSING_IDLE_TIMEOUT | 10000 | 10000 | Composing indicator idle timeout in milliseconds | src/composables/constants.ts:52 |
COMPOSING_TIMEOUT_SECONDS | 10 | 10 | Composing indicator timeout in seconds | src/composables/constants.ts:55 |
CONFERENCE_CONSTANTS
const CONFERENCE_CONSTANTS: object;Defined in: src/composables/constants.ts:61
Conference configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
DEFAULT_MAX_PARTICIPANTS | 10 | 10 | Default maximum participants in a conference | src/composables/constants.ts:63 |
AUDIO_LEVEL_INTERVAL | 100 | 100 | Audio level monitoring interval in milliseconds | src/composables/constants.ts:66 |
STATE_TRANSITION_DELAY | 2000 | 2000 | Conference state transition delay in milliseconds | src/composables/constants.ts:69 |
TRANSFER_CONSTANTS
const TRANSFER_CONSTANTS: object;Defined in: src/composables/constants.ts:75
Transfer configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
COMPLETION_DELAY | 2000 | 2000 | Transfer completion delay in milliseconds | src/composables/constants.ts:77 |
CANCELLATION_DELAY | 1000 | 1000 | Transfer cancellation delay in milliseconds | src/composables/constants.ts:80 |
HISTORY_CONSTANTS
const HISTORY_CONSTANTS: object;Defined in: src/composables/constants.ts:86
Call history configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
DEFAULT_LIMIT | 10 | 10 | Default call history limit | src/composables/constants.ts:88 |
DEFAULT_OFFSET | 0 | 0 | Default offset for pagination | src/composables/constants.ts:91 |
DEFAULT_SORT_ORDER | "desc" | - | Default sort order | src/composables/constants.ts:94 |
DEFAULT_SORT_BY | "startTime" | - | Default sort field | src/composables/constants.ts:97 |
TOP_FREQUENT_CONTACTS | 10 | 10 | Top N frequent contacts to return | src/composables/constants.ts:100 |
TIMEOUTS
const TIMEOUTS: object;Defined in: src/composables/constants.ts:106
Common timeout values (in milliseconds)
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
SHORT_DELAY | 1000 | 1000 | Short delay for UI updates | src/composables/constants.ts:108 |
MEDIUM_DELAY | 2000 | 2000 | Medium delay for operations | src/composables/constants.ts:111 |
LONG_DELAY | 5000 | 5000 | Long delay for cleanup | src/composables/constants.ts:114 |
CALL_CONSTANTS
const CALL_CONSTANTS: object;Defined in: src/composables/constants.ts:120
Call configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
MAX_CONCURRENT_CALLS | 5 | 5 | Maximum concurrent calls | src/composables/constants.ts:122 |
CALL_TIMEOUT | 30000 | 30000 | Call timeout in milliseconds | src/composables/constants.ts:125 |
RING_TIMEOUT | 60000 | 60000 | Ring timeout in milliseconds | src/composables/constants.ts:128 |
MEDIA_CONSTANTS
const MEDIA_CONSTANTS: object;Defined in: src/composables/constants.ts:134
Media configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
ENUMERATION_RETRY_DELAY | 1000 | 1000 | Device enumeration retry delay in milliseconds | src/composables/constants.ts:136 |
DEFAULT_TEST_DURATION | 2000 | 2000 | Device test duration in milliseconds | src/composables/constants.ts:139 |
AUDIO_LEVEL_THRESHOLD | 0.01 | 0.01 | Audio level threshold for device test (0-1) | src/composables/constants.ts:142 |
DTMF_CONSTANTS
const DTMF_CONSTANTS: object;Defined in: src/composables/constants.ts:148
DTMF configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
DEFAULT_DURATION | 100 | 100 | Default DTMF tone duration in milliseconds | src/composables/constants.ts:150 |
DEFAULT_INTER_TONE_GAP | 70 | 70 | Default inter-tone gap in milliseconds | src/composables/constants.ts:153 |
MIN_DURATION | 40 | 40 | Minimum allowed duration in milliseconds | src/composables/constants.ts:156 |
MAX_DURATION | 6000 | 6000 | Maximum allowed duration in milliseconds | src/composables/constants.ts:159 |
MAX_QUEUE_SIZE | 100 | 100 | Maximum DTMF queue size (prevents unbounded memory growth) | src/composables/constants.ts:162 |
RETRY_CONFIG
const RETRY_CONFIG: object;Defined in: src/composables/constants.ts:168
Retry configuration
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
calculateBackoff() | ( attempt, baseDelay, maxDelay) => number | - | Calculate exponential backoff delay | src/composables/constants.ts:170 |
BACKOFF_MULTIPLIER | 2 | 2 | Default exponential backoff multiplier | src/composables/constants.ts:176 |
version
const version: "1.0.0" = '1.0.0';Defined in: src/index.ts:520
VueSip library version.
metadata
const metadata: object;Defined in: src/index.ts:527
VueSip library metadata.
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
name | string | 'VueSip' | - | src/index.ts:528 |
version | string | - | VueSip library version. | src/index.ts:529 |
description | string | 'A headless Vue.js component library for SIP/VoIP applications' | - | src/index.ts:530 |
author | string | 'VueSip Team' | - | src/index.ts:531 |
license | string | 'MIT' | - | src/index.ts:532 |
repository | string | 'https://github.com/ironyh/VueSIP' | - | src/index.ts:533 |
homepage | string | 'https://vuesip.com' | - | src/index.ts:534 |
bugs | string | 'https://github.com/ironyh/VueSIP/issues' | - | src/index.ts:535 |
default
default: object;Defined in: src/index.ts:623
Default export for convenience.
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
version | string | - | VueSip library version. | src/index.ts:624 |
metadata | object | - | VueSip library metadata. | src/index.ts:625 |
metadata.name | string | 'VueSip' | - | src/index.ts:528 |
metadata.version | string | - | VueSip library version. | src/index.ts:529 |
metadata.description | string | 'A headless Vue.js component library for SIP/VoIP applications' | - | src/index.ts:530 |
metadata.author | string | 'VueSip Team' | - | src/index.ts:531 |
metadata.license | string | 'MIT' | - | src/index.ts:532 |
metadata.repository | string | 'https://github.com/ironyh/VueSIP' | - | src/index.ts:533 |
metadata.homepage | string | 'https://vuesip.com' | - | src/index.ts:534 |
metadata.bugs | string | 'https://github.com/ironyh/VueSIP/issues' | - | src/index.ts:535 |
createVueSip() | (options) => Plugin | - | Create VueSip Vue plugin. This plugin initializes VueSip with global configuration and makes it available throughout your Vue application. It's optional - you can use VueSip composables directly without installing the plugin. Examples Basic usage: import { createApp } from 'vue' import { createVueSip } from 'vuesip' const app = createApp(App) app.use(createVueSip({ debug: true, logLevel: 'info' })) With global configuration: app.use(createVueSip({ debug: import.meta.env.DEV, logLevel: 'debug', sipConfig: { uri: 'wss://sip.example.com', autoRegister: true }, mediaConfig: { audioEnabled: true, videoEnabled: false }, userPreferences: { autoAnswer: false, recordCalls: false } })) Remarks The plugin performs the following initialization: 1. Configures global logging level and debug mode 2. Initializes configuration store with provided config 3. Sets up global error handling (optional) 4. Logs initialization info | src/index.ts:626 |
install | (app, ...options) => any | undefined | - | - | src/index.ts:627 |
Example
import VueSip from 'vuesip'
app.use(VueSip.createVueSip())ConfigProvider
const ConfigProvider: DefineComponent<ExtractPropTypes<{
sipConfig: {
type: PropType<SipClientConfig>;
default: undefined;
};
mediaConfig: {
type: PropType<MediaConfiguration>;
default: undefined;
};
userPreferences: {
type: PropType<UserPreferences>;
default: undefined;
};
validateOnMount: {
type: BooleanConstructor;
default: boolean;
};
autoMerge: {
type: BooleanConstructor;
default: boolean;
};
}>, () =>
| VNode<RendererNode, RendererElement, {
[key: string]: any;
}>[]
| undefined, {
}, {
}, {
}, ComponentOptionsMixin, ComponentOptionsMixin, {
}, string, PublicProps, ToResolvedProps<ExtractPropTypes<{
sipConfig: {
type: PropType<SipClientConfig>;
default: undefined;
};
mediaConfig: {
type: PropType<MediaConfiguration>;
default: undefined;
};
userPreferences: {
type: PropType<UserPreferences>;
default: undefined;
};
validateOnMount: {
type: BooleanConstructor;
default: boolean;
};
autoMerge: {
type: BooleanConstructor;
default: boolean;
};
}>, {
}>, {
sipConfig: SipClientConfig;
mediaConfig: MediaConfiguration;
userPreferences: UserPreferences;
validateOnMount: boolean;
autoMerge: boolean;
}, {
}, {
}, {
}, string, ComponentProvideOptions, true, {
}, any>;Defined in: src/providers/ConfigProvider.ts:44
ConfigProvider Component
Provides configuration management functionality to all child components through Vue's provide/inject API.
MediaProvider
const MediaProvider: DefineComponent<ExtractPropTypes<{
mediaConfig: {
type: PropType<MediaConfiguration>;
default: undefined;
};
autoEnumerate: {
type: BooleanConstructor;
default: boolean;
};
autoRequestPermissions: {
type: BooleanConstructor;
default: boolean;
};
requestAudio: {
type: BooleanConstructor;
default: boolean;
};
requestVideo: {
type: BooleanConstructor;
default: boolean;
};
watchDeviceChanges: {
type: BooleanConstructor;
default: boolean;
};
autoSelectDefaults: {
type: BooleanConstructor;
default: boolean;
};
}>, () =>
| VNode<RendererNode, RendererElement, {
[key: string]: any;
}>[]
| undefined, {
}, {
}, {
}, ComponentOptionsMixin, ComponentOptionsMixin, {
ready: () => true;
devicesChanged: (_devices) => true;
permissionsGranted: (_audio, _video) => true;
permissionsDenied: (_audio, _video) => true;
error: (_error) => true;
}, string, PublicProps, ToResolvedProps<ExtractPropTypes<{
mediaConfig: {
type: PropType<MediaConfiguration>;
default: undefined;
};
autoEnumerate: {
type: BooleanConstructor;
default: boolean;
};
autoRequestPermissions: {
type: BooleanConstructor;
default: boolean;
};
requestAudio: {
type: BooleanConstructor;
default: boolean;
};
requestVideo: {
type: BooleanConstructor;
default: boolean;
};
watchDeviceChanges: {
type: BooleanConstructor;
default: boolean;
};
autoSelectDefaults: {
type: BooleanConstructor;
default: boolean;
};
}>, {
ready: () => true;
devicesChanged: (_devices) => true;
permissionsGranted: (_audio, _video) => true;
permissionsDenied: (_audio, _video) => true;
error: (_error) => true;
}>, {
mediaConfig: MediaConfiguration;
autoEnumerate: boolean;
autoRequestPermissions: boolean;
requestAudio: boolean;
requestVideo: boolean;
watchDeviceChanges: boolean;
autoSelectDefaults: boolean;
}, {
}, {
}, {
}, string, ComponentProvideOptions, true, {
}, any>;Defined in: src/providers/MediaProvider.ts:44
MediaProvider Component
Provides media device management functionality to all child components through Vue's provide/inject API.
OAuth2ProviderKey
const OAuth2ProviderKey: InjectionKey<OAuth2ProviderContext>;Defined in: src/providers/OAuth2Provider.ts:120
Injection key for OAuth2 provider context
OAuth2AuthStateKey
const OAuth2AuthStateKey: InjectionKey<Ref<OAuth2AuthState>>;Defined in: src/providers/OAuth2Provider.ts:125
Injection key for authentication state
OAuth2CredentialsKey
const OAuth2CredentialsKey: InjectionKey<Ref<ProvisionedSipCredentials | null>>;Defined in: src/providers/OAuth2Provider.ts:130
Injection key for SIP credentials
OAuth2Provider
const OAuth2Provider: DefineComponent<ExtractPropTypes<{
config: {
type: PropType<OAuth2ServiceConfig>;
required: true;
};
autoInitialize: {
type: BooleanConstructor;
default: boolean;
};
autoHandleCallback: {
type: BooleanConstructor;
default: boolean;
};
callbackPath: {
type: StringConstructor;
default: string;
};
postAuthRedirect: {
type: StringConstructor;
default: undefined;
};
}>, () => VNode<RendererNode, RendererElement, {
[key: string]: any;
}>, {
}, {
}, {
}, ComponentOptionsMixin, ComponentOptionsMixin, {
state-change: (_state, _previousState) => true;
authenticated: (_data) => true;
error: (_error) => true;
tokens-refreshed: (_tokens) => true;
logout: () => true;
initialized: (_isAuthenticated) => true;
}, string, PublicProps, ToResolvedProps<ExtractPropTypes<{
config: {
type: PropType<OAuth2ServiceConfig>;
required: true;
};
autoInitialize: {
type: BooleanConstructor;
default: boolean;
};
autoHandleCallback: {
type: BooleanConstructor;
default: boolean;
};
callbackPath: {
type: StringConstructor;
default: string;
};
postAuthRedirect: {
type: StringConstructor;
default: undefined;
};
}>, {
state-change: (_state, _previousState) => true;
authenticated: (_data) => true;
error: (_error) => true;
tokens-refreshed: (_tokens) => true;
logout: () => true;
initialized: (_isAuthenticated) => true;
}>, {
autoInitialize: boolean;
autoHandleCallback: boolean;
callbackPath: string;
postAuthRedirect: string;
}, {
}, {
}, {
}, string, ComponentProvideOptions, true, {
}, any>;Defined in: src/providers/OAuth2Provider.ts:152
OAuth2Provider component
SipClientProviderKey
const SipClientProviderKey: InjectionKey<SipClientProviderContext>;Defined in: src/providers/SipClientProvider.ts:99
Injection key for complete provider context
SipClientProvider
const SipClientProvider: DefineComponent<ExtractPropTypes<{
config: {
type: PropType<SipClientConfig>;
required: true;
};
autoConnect: {
type: BooleanConstructor;
default: boolean;
};
autoRegister: {
type: BooleanConstructor;
default: boolean;
};
autoCleanup: {
type: BooleanConstructor;
default: boolean;
};
watchConfig: {
type: BooleanConstructor;
default: boolean;
};
}>, () => VNode<RendererNode, RendererElement, {
[key: string]: any;
}>, {
}, {
}, {
}, ComponentOptionsMixin, ComponentOptionsMixin, {
ready: () => true;
connected: () => true;
disconnected: (_error?) => true;
registered: (_uri) => true;
unregistered: () => true;
error: (_error) => true;
}, string, PublicProps, ToResolvedProps<ExtractPropTypes<{
config: {
type: PropType<SipClientConfig>;
required: true;
};
autoConnect: {
type: BooleanConstructor;
default: boolean;
};
autoRegister: {
type: BooleanConstructor;
default: boolean;
};
autoCleanup: {
type: BooleanConstructor;
default: boolean;
};
watchConfig: {
type: BooleanConstructor;
default: boolean;
};
}>, {
ready: () => true;
connected: () => true;
disconnected: (_error?) => true;
registered: (_uri) => true;
unregistered: () => true;
error: (_error) => true;
}>, {
autoConnect: boolean;
autoRegister: boolean;
autoCleanup: boolean;
watchConfig: boolean;
}, {
}, {
}, {
}, string, ComponentProvideOptions, true, {
}, any>;Defined in: src/providers/SipClientProvider.ts:122
SipClientProvider component
Provides SIP client functionality to all child components via Vue's dependency injection system.
Example
import { useSipClientProvider } from 'vuesip'
// In child component
const { client, eventBus, isReady } = useSipClientProvider()
watchEffect(() => {
if (isReady.value) {
console.log('SIP client is ready!')
}
})adapters
const adapters: ProviderAdapter[];Defined in: src/providers/adapters/index.ts:22
Array of all available provider adapters
Use this array to register all adapters with the provider registry or to iterate over available complex providers.
twilioAdapter
const twilioAdapter: ProviderAdapter;Defined in: src/providers/adapters/twilio.ts:27
Twilio provider adapter
This is a placeholder adapter. Full Twilio integration requires:
- Installing @twilio/voice-sdk
- Server-side token generation endpoint
- TwiML application configuration
elks46Provider
const elks46Provider: ProviderConfig;Defined in: src/providers/configs/46elks.ts:17
46 elks provider configuration
Maps user credentials to SIP credentials for connecting to 46elks WebRTC service. Phone number format: Swedish format without + prefix (e.g., 46700000000) Secret: Retrieved from 46elks API: GET /a1/numbers/
builtInProviders
const builtInProviders: ProviderConfig[];Defined in: src/providers/configs/index.ts:33
Array of all built-in provider configurations. Own PBX is first as it's the default/generic option.
Order:
- own-pbx - Generic SIP (default, most flexible)
- 46elks - Swedish VoIP provider
- telnyx - Cloud communications platform
- voipms - Wholesale VoIP provider (requires gateway)
ownPbxProvider
const ownPbxProvider: ProviderConfig;Defined in: src/providers/configs/own-pbx.ts:21
Own PBX provider configuration
Supports generic SIP connections where the user provides:
- WebSocket URL for their PBX
- Full SIP URI (sip:extension@domain)
- Password for authentication
- Optional display name for caller ID
telnyxProvider
const telnyxProvider: ProviderConfig;Defined in: src/providers/configs/telnyx.ts:18
Telnyx provider configuration
Telnyx provides WebRTC SIP connections via their rtc.telnyx.com endpoint. Users need credentials from their SIP Connection in the Telnyx portal.
voipmsProvider
const voipmsProvider: ProviderConfig;Defined in: src/providers/configs/voipms.ts:20
VoIP.ms provider configuration
VoIP.ms is a popular wholesale VoIP provider that requires users to set up their own WebRTC gateway (such as Asterisk, FreeSWITCH, or a commercial WebRTC-to-SIP service) to enable browser-based calling.
callStore
const callStore: object;Defined in: src/stores/callStore.ts:98
Call Store
Manages active calls, incoming call queue, and call history with reactive state.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
get activeCalls | ReadonlyMap<string, { id: string; state: CallState; direction: CallDirection; localUri: | string | { uri: string; scheme: "sip" | "sips"; user: string; host: string; port?: number; displayName?: string; parameters?: { [key: string]: string; }; headers?: { [key: string]: string; }; toString: string; clone: SipUri; }; remoteUri: | string | { uri: string; scheme: "sip" | "sips"; user: string; host: string; port?: number; displayName?: string; parameters?: { [key: string]: string; }; headers?: { [key: string]: string; }; toString: string; clone: SipUri; }; remoteDisplayName?: string; localStream?: { }; remoteStream?: { }; isOnHold: boolean; isMuted: boolean; hasRemoteVideo: boolean; hasLocalVideo: boolean; timing: { startTime?: Date; answerTime?: Date; endTime?: Date; duration?: number; ringDuration?: number; }; terminationCause?: TerminationCause; data?: { [key: string]: Readonly<unknown>; }; hold?: () => void; unhold?: () => void; }> | Get readonly reference to active calls map | src/stores/callStore.ts:106 |
get incomingCallQueue | readonly string[] | Get readonly reference to incoming call queue | src/stores/callStore.ts:113 |
get callHistory | readonly object[] | Get readonly reference to call history | src/stores/callStore.ts:120 |
get activeCallsArray | object[] | Get all active calls as an array | src/stores/callStore.ts:127 |
get activeCallCount | number | Get number of active calls | src/stores/callStore.ts:134 |
get incomingCallCount | number | Get number of incoming calls | src/stores/callStore.ts:141 |
get isAtMaxCalls | boolean | Check if at max concurrent calls | src/stores/callStore.ts:148 |
get incomingCalls | CallSession[] | Get all incoming calls | src/stores/callStore.ts:155 |
get establishedCalls | object[] | Get all established (non-incoming) calls | src/stores/callStore.ts:162 |
get totalHistoryCalls | number | Get total history call count | src/stores/callStore.ts:169 |
get missedCallsCount | number | Get missed calls count | src/stores/callStore.ts:176 |
setMaxConcurrentCalls() | (max) => void | Set maximum concurrent calls | src/stores/callStore.ts:189 |
setMaxHistoryEntries() | (max) => void | Set maximum history entries | src/stores/callStore.ts:203 |
addCall() | (call) => boolean | Add a call to the active calls registry | src/stores/callStore.ts:228 |
updateCall() | (call) => void | Update a call in the active calls registry | src/stores/callStore.ts:262 |
removeCall() | (callId) => CallSession | undefined | Remove a call from the active calls registry | src/stores/callStore.ts:278 |
addActiveCall() | (call) => boolean | Add a call to active calls (alias for addCall) Provided for backward compatibility with composables | src/stores/callStore.ts:306 |
removeActiveCall() | (callId) => boolean | Remove a call from active calls (alias for removeCall) Provided for backward compatibility with composables | src/stores/callStore.ts:317 |
getCall() | (callId) => CallSession | undefined | Get a call by ID | src/stores/callStore.ts:328 |
findCalls() | (predicate) => CallSession[] | Find calls matching a predicate | src/stores/callStore.ts:338 |
hasCall() | (callId) => boolean | Check if a call exists | src/stores/callStore.ts:348 |
clearActiveCalls() | () => void | Clear all active calls (use with caution) | src/stores/callStore.ts:355 |
getNextIncomingCall() | () => CallSession | undefined | Get the next incoming call from the queue | src/stores/callStore.ts:371 |
removeFromIncomingQueue() | (callId) => void | Remove a call from the incoming queue (but keep in active calls) | src/stores/callStore.ts:381 |
addToHistory() | (entry) => void | Add a call to history | src/stores/callStore.ts:398 |
createHistoryEntry() | (call) => CallHistoryEntry | Create a history entry from a call session | src/stores/callStore.ts:416 |
getHistory() | (filter?) => CallHistoryEntry[] | Get call history with optional filtering | src/stores/callStore.ts:448 |
searchHistory() | (filter?) => HistorySearchResult | Search call history | src/stores/callStore.ts:537 |
deleteHistoryEntry() | (entryId) => boolean | Delete a specific history entry | src/stores/callStore.ts:558 |
clearHistory() | () => void | Clear all call history | src/stores/callStore.ts:573 |
clearHistoryByFilter() | (filter) => number | Clear history entries matching a filter | src/stores/callStore.ts:585 |
reset() | () => void | Reset the entire store to initial state | src/stores/callStore.ts:604 |
getStatistics() | () => object | Get store statistics | src/stores/callStore.ts:618 |
configStore
const configStore: object;Defined in: src/stores/configStore.ts:112
Configuration Store
Manages application configuration with validation and reactive state.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
get sipConfig | | { uri: string; sipUri: string; password: string; displayName?: string; authorizationUsername?: string; realm?: string; ha1?: string; wsOptions?: { protocols?: readonly string[]; connectionTimeout?: number; maxReconnectionAttempts?: number; reconnectionDelay?: number; }; registrationOptions?: { expires?: number; autoRegister?: boolean; registrationRetryInterval?: number; }; sessionOptions?: { sessionTimers?: boolean; sessionTimersRefreshMethod?: "INVITE" | "UPDATE"; maxConcurrentCalls?: number; callTimeout?: number; }; mediaConfiguration?: { audio?: | boolean | { [key: string]: unknown; } | { }; video?: | boolean | { [key: string]: unknown; } | { }; echoCancellation?: boolean; noiseSuppression?: boolean; autoGainControl?: boolean; audioCodec?: "opus" | "pcmu" | "pcma" | "g722"; videoCodec?: "vp8" | "vp9" | "h264"; dataChannel?: boolean; }; rtcConfiguration?: { stunServers?: readonly string[]; turnServers?: readonly object[]; iceTransportPolicy?: RTCIceTransportPolicy; bundlePolicy?: RTCBundlePolicy; rtcpMuxPolicy?: "require"; iceCandidatePoolSize?: number; }; userPreferences?: { audioInputDeviceId?: string; audioOutputDeviceId?: string; videoInputDeviceId?: string; enableAudio?: boolean; enableVideo?: boolean; autoAnswer?: boolean; autoAnswerDelay?: number; ringToneUrl?: string; ringBackToneUrl?: string; enableDtmfTones?: boolean; }; userAgent?: string; debug?: boolean; logger?: { debug: (...args) => void; info: (...args) => void; warn: (...args) => void; error: (...args) => void; }; } | null | Get SIP configuration (readonly) | src/stores/configStore.ts:120 |
get mediaConfig | object | Get media configuration (readonly) | src/stores/configStore.ts:127 |
get userPreferences | object | Get user preferences (readonly) | src/stores/configStore.ts:134 |
get lastValidation | | { valid: boolean; errors?: string[]; warnings?: string[]; } | null | Get last validation result | src/stores/configStore.ts:141 |
get configTimestamp | Date | null | Get configuration timestamp | src/stores/configStore.ts:148 |
get hasSipConfig | boolean | Check if has SIP configuration | src/stores/configStore.ts:155 |
get isConfigValid | boolean | Check if configuration is valid | src/stores/configStore.ts:162 |
get hasValidationErrors | boolean | Check if has validation errors | src/stores/configStore.ts:169 |
get hasValidationWarnings | boolean | Check if has validation warnings | src/stores/configStore.ts:176 |
get mergedMediaConstraints | MediaStreamConstraints | Get merged media constraints | src/stores/configStore.ts:183 |
setSipConfig() | (config, validate) => ValidationResult | Set SIP configuration | src/stores/configStore.ts:198 |
updateSipConfig() | (updates, validate) => ValidationResult | Update SIP configuration (partial update) | src/stores/configStore.ts:230 |
setMediaConfig() | (config, validate) => ValidationResult | Set media configuration | src/stores/configStore.ts:254 |
updateMediaConfig() | (updates, validate) => ValidationResult | Update media configuration (partial update) | src/stores/configStore.ts:285 |
setUserPreferences() | (preferences) => void | Set user preferences | src/stores/configStore.ts:298 |
updateUserPreferences() | (updates) => void | Update user preferences (partial update) | src/stores/configStore.ts:309 |
clearSipConfig() | () => void | Clear SIP configuration | src/stores/configStore.ts:318 |
validateSipConfig() | () => ValidationResult | Validate current SIP configuration | src/stores/configStore.ts:333 |
validateMediaConfig() | () => ValidationResult | Validate current media configuration | src/stores/configStore.ts:353 |
validateAll() | () => ValidationResult | Validate all configurations | src/stores/configStore.ts:362 |
getWebSocketUri() | () => string | null | Get WebSocket URI | src/stores/configStore.ts:392 |
getSipUri() | () => string | null | Get SIP URI | src/stores/configStore.ts:401 |
getDisplayName() | () => string | null | Get display name | src/stores/configStore.ts:410 |
getRegistrationExpires() | () => number | Get registration expires | src/stores/configStore.ts:419 |
getMaxConcurrentCalls() | () => number | Get max concurrent calls | src/stores/configStore.ts:428 |
isDebugMode() | () => boolean | Check if debug mode is enabled | src/stores/configStore.ts:437 |
isAutoRegisterEnabled() | () => boolean | Check if auto-register is enabled | src/stores/configStore.ts:446 |
isAutoAnswerEnabled() | () => boolean | Check if auto-answer is enabled | src/stores/configStore.ts:455 |
getAutoAnswerDelay() | () => number | Get auto-answer delay | src/stores/configStore.ts:464 |
exportConfig() | (includeCredentials) => string | Export configuration as JSON | src/stores/configStore.ts:478 |
importConfig() | (json, validate) => ValidationResult | Import configuration from JSON | src/stores/configStore.ts:504 |
reset() | () => void | Reset the store to initial state | src/stores/configStore.ts:542 |
getStatistics() | () => object | Get store statistics | src/stores/configStore.ts:566 |
deviceStore
const deviceStore: object;Defined in: src/stores/deviceStore.ts:149
Device Store
Manages media devices with reactive state and device change handling.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
get audioInputDevices | readonly object[] | Get audio input devices Returns readonly wrapper to prevent direct mutation, but preserves reactivity | src/stores/deviceStore.ts:158 |
get audioOutputDevices | readonly object[] | Get audio output devices | src/stores/deviceStore.ts:166 |
get videoInputDevices | readonly object[] | Get video input devices | src/stores/deviceStore.ts:173 |
get selectedAudioInputId | string | null | Get selected audio input device ID | src/stores/deviceStore.ts:180 |
get selectedAudioOutputId | string | null | Get selected audio output device ID | src/stores/deviceStore.ts:187 |
get selectedVideoInputId | string | null | Get selected video input device ID | src/stores/deviceStore.ts:194 |
get selectedAudioInputDevice | MediaDevice | undefined | Get selected audio input device | src/stores/deviceStore.ts:201 |
get selectedAudioOutputDevice | MediaDevice | undefined | Get selected audio output device | src/stores/deviceStore.ts:208 |
get selectedVideoInputDevice | MediaDevice | undefined | Get selected video input device | src/stores/deviceStore.ts:215 |
get audioPermission | PermissionStatus | Get audio permission status | src/stores/deviceStore.ts:222 |
get videoPermission | PermissionStatus | Get video permission status | src/stores/deviceStore.ts:229 |
get hasAudioPermission | boolean | Check if has audio permission | src/stores/deviceStore.ts:236 |
get hasVideoPermission | boolean | Check if has video permission | src/stores/deviceStore.ts:243 |
get hasAnyPermission | boolean | Check if has any permission | src/stores/deviceStore.ts:250 |
get isAudioPermissionDenied | boolean | Check if audio permission denied | src/stores/deviceStore.ts:257 |
get isVideoPermissionDenied | boolean | Check if video permission denied | src/stores/deviceStore.ts:264 |
get lastEnumerationTime | Date | null | Get last enumeration time | src/stores/deviceStore.ts:271 |
get hasAudioInputDevices | boolean | Check if has audio input devices | src/stores/deviceStore.ts:278 |
get hasAudioOutputDevices | boolean | Check if has audio output devices | src/stores/deviceStore.ts:285 |
get hasVideoInputDevices | boolean | Check if has video input devices | src/stores/deviceStore.ts:292 |
get totalDevices | number | Get total device count | src/stores/deviceStore.ts:299 |
setAudioInputDevices() | (devices) => void | Set audio input devices | src/stores/deviceStore.ts:312 |
setAudioOutputDevices() | (devices) => void | Set audio output devices | src/stores/deviceStore.ts:334 |
setVideoInputDevices() | (devices) => void | Set video input devices | src/stores/deviceStore.ts:356 |
updateDevices() | (devices) => void | Update all devices from MediaDeviceInfo array | src/stores/deviceStore.ts:378 |
selectAudioInput() | (deviceId) => boolean | Select audio input device | src/stores/deviceStore.ts:424 |
selectAudioOutput() | (deviceId) => boolean | Select audio output device | src/stores/deviceStore.ts:442 |
selectVideoInput() | (deviceId) => boolean | Select video input device | src/stores/deviceStore.ts:460 |
clearAudioInputSelection() | () => void | Clear audio input selection | src/stores/deviceStore.ts:475 |
clearAudioOutputSelection() | () => void | Clear audio output selection | src/stores/deviceStore.ts:483 |
clearVideoInputSelection() | () => void | Clear video input selection | src/stores/deviceStore.ts:491 |
setAudioPermission() | (status) => void | Set audio permission status | src/stores/deviceStore.ts:505 |
setVideoPermission() | (status) => void | Set video permission status | src/stores/deviceStore.ts:515 |
updatePermissions() | (audio, video) => void | Update permissions based on getUserMedia result | src/stores/deviceStore.ts:526 |
denyAudioPermission() | () => void | Mark audio permission as denied | src/stores/deviceStore.ts:539 |
denyVideoPermission() | () => void | Mark video permission as denied | src/stores/deviceStore.ts:547 |
setDeviceChangeListenerAttached() | () => void | Mark that device change listener is attached | src/stores/deviceStore.ts:559 |
setDeviceChangeListenerDetached() | () => void | Mark that device change listener is detached | src/stores/deviceStore.ts:567 |
hasDeviceChangeListener() | () => boolean | Check if device change listener is attached | src/stores/deviceStore.ts:575 |
findDeviceById() | (deviceId) => MediaDevice | undefined | Find a device by ID across all device types | src/stores/deviceStore.ts:589 |
isDeviceSelected() | (deviceId) => boolean | Check if a device is currently selected | src/stores/deviceStore.ts:603 |
reset() | () => void | Reset the store to initial state | src/stores/deviceStore.ts:614 |
getStatistics() | () => object | Get store statistics | src/stores/deviceStore.ts:633 |
setDevices() | (devices) => void | Set all devices at once (bulk update) Uses the individual setters to ensure auto-selection logic runs | src/stores/deviceStore.ts:655 |
storePersistence
const storePersistence: StorePersistenceManager;Defined in: src/stores/persistence.ts:461
registrationStore
const registrationStore: object;Defined in: src/stores/registrationStore.ts:112
Registration Store
Manages SIP registration state with auto-refresh capabilities.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
get state | RegistrationState | Get current registration state | src/stores/registrationStore.ts:120 |
get registeredUri | string | null | Get registered URI | src/stores/registrationStore.ts:127 |
get expires | number | Get registration expiry in seconds | src/stores/registrationStore.ts:134 |
get lastRegistrationTime | Date | null | Get last registration time | src/stores/registrationStore.ts:141 |
get expiryTime | Date | null | Get expiry time | src/stores/registrationStore.ts:148 |
get retryCount | number | Get retry count | src/stores/registrationStore.ts:155 |
get lastError | string | null | Get last error | src/stores/registrationStore.ts:162 |
get isRegistered | boolean | Check if registered | src/stores/registrationStore.ts:169 |
get isRegistering | boolean | Check if registering | src/stores/registrationStore.ts:176 |
get isUnregistering | boolean | Check if unregistering | src/stores/registrationStore.ts:183 |
get hasRegistrationFailed | boolean | Check if registration failed | src/stores/registrationStore.ts:190 |
get secondsUntilExpiry | number | Get seconds until expiry | src/stores/registrationStore.ts:197 |
get isExpiringSoon | boolean | Check if expiring soon | src/stores/registrationStore.ts:204 |
get hasExpired | boolean | Check if expired | src/stores/registrationStore.ts:211 |
setRegistering() | (uri) => void | Set registration state to Registering | src/stores/registrationStore.ts:224 |
setRegistered() | (uri, expires?) => void | Set registration state to Registered | src/stores/registrationStore.ts:237 |
setRegistrationFailed() | (error) => void | Set registration state to RegistrationFailed | src/stores/registrationStore.ts:260 |
setUnregistering() | () => void | Set registration state to Unregistering | src/stores/registrationStore.ts:275 |
setUnregistered() | () => void | Set registration state to Unregistered | src/stores/registrationStore.ts:287 |
setupAutoRefresh() | () => void | Setup auto-refresh timer Schedules a refresh at 90% of the expiry time to ensure registration doesn't expire. This follows best practices for SIP registration refresh. | src/stores/registrationStore.ts:308 |
clearAutoRefresh() | () => void | Clear auto-refresh timer | src/stores/registrationStore.ts:334 |
manualRefresh() | () => void | Manually trigger a refresh Forces an immediate registration refresh. This can be called by the SipClient or composable when needed. | src/stores/registrationStore.ts:362 |
setDefaultExpiry() | (expires) => void | Set default expiry time | src/stores/registrationStore.ts:377 |
resetRetryCount() | () => void | Reset retry count | src/stores/registrationStore.ts:393 |
incrementRetryCount() | () => number | Increment retry count | src/stores/registrationStore.ts:403 |
reset() | () => void | Reset the store to initial state | src/stores/registrationStore.ts:412 |
_triggerTimeUpdate() | () => void | Trigger time-based computed properties to re-evaluate (Internal method for testing with fake timers) | src/stores/registrationStore.ts:429 |
getStatistics() | () => object | Get store statistics | src/stores/registrationStore.ts:438 |
providerRegistry
const providerRegistry: ProviderRegistry;Defined in: src/transcription/providers/registry.ts:119
Global provider registry singleton
DEFAULT_QUALITY_WEIGHTS
const DEFAULT_QUALITY_WEIGHTS: QualityScoreWeights;Defined in: src/types/call-quality.types.ts:59
Default quality score weights
DEFAULT_NETWORK_COLORS
const DEFAULT_NETWORK_COLORS: NetworkQualityColors;Defined in: src/types/call-quality.types.ts:219
Default colors for network quality levels
DEFAULT_NETWORK_THRESHOLDS
const DEFAULT_NETWORK_THRESHOLDS: NetworkQualityThresholds;Defined in: src/types/call-quality.types.ts:243
Default network quality thresholds
VIDEO_RESOLUTIONS
const VIDEO_RESOLUTIONS: VideoResolution[];Defined in: src/types/call-quality.types.ts:358
Standard video resolutions
DEFAULT_BANDWIDTH_CONSTRAINTS
const DEFAULT_BANDWIDTH_CONSTRAINTS: Required<BandwidthConstraints>;Defined in: src/types/call-quality.types.ts:391
Default bandwidth constraints
EventNames
const EventNames: object;Defined in: src/types/events.types.ts:107
Event names constants
Type Declaration
| Name | Type | Default value | Defined in |
|---|---|---|---|
CONNECTED | "connected" | 'connected' | src/types/events.types.ts:109 |
DISCONNECTED | "disconnected" | 'disconnected' | src/types/events.types.ts:110 |
CONNECTING | "connecting" | 'connecting' | src/types/events.types.ts:111 |
CONNECTION_FAILED | "connection_failed" | 'connection_failed' | src/types/events.types.ts:112 |
RECONNECTING | "reconnecting" | 'reconnecting' | src/types/events.types.ts:113 |
REGISTERED | "registered" | 'registered' | src/types/events.types.ts:116 |
UNREGISTERED | "unregistered" | 'unregistered' | src/types/events.types.ts:117 |
REGISTERING | "registering" | 'registering' | src/types/events.types.ts:118 |
REGISTRATION_FAILED | "registration_failed" | 'registration_failed' | src/types/events.types.ts:119 |
CALL_INCOMING | "call:incoming" | 'call:incoming' | src/types/events.types.ts:122 |
CALL_OUTGOING | "call:outgoing" | 'call:outgoing' | src/types/events.types.ts:123 |
CALL_PROGRESS | "call:progress" | 'call:progress' | src/types/events.types.ts:124 |
CALL_RINGING | "call:ringing" | 'call:ringing' | src/types/events.types.ts:125 |
CALL_ACCEPTED | "call:accepted" | 'call:accepted' | src/types/events.types.ts:126 |
CALL_CONFIRMED | "call:confirmed" | 'call:confirmed' | src/types/events.types.ts:127 |
CALL_FAILED | "call:failed" | 'call:failed' | src/types/events.types.ts:128 |
CALL_ENDED | "call:ended" | 'call:ended' | src/types/events.types.ts:129 |
CALL_HOLD | "call:hold" | 'call:hold' | src/types/events.types.ts:130 |
CALL_UNHOLD | "call:unhold" | 'call:unhold' | src/types/events.types.ts:131 |
CALL_MUTED | "call:muted" | 'call:muted' | src/types/events.types.ts:132 |
CALL_UNMUTED | "call:unmuted" | 'call:unmuted' | src/types/events.types.ts:133 |
MEDIA_STREAM_ADDED | "media:stream:added" | 'media:stream:added' | src/types/events.types.ts:136 |
MEDIA_STREAM_REMOVED | "media:stream:removed" | 'media:stream:removed' | src/types/events.types.ts:137 |
MEDIA_TRACK_ADDED | "media:track:added" | 'media:track:added' | src/types/events.types.ts:138 |
MEDIA_TRACK_REMOVED | "media:track:removed" | 'media:track:removed' | src/types/events.types.ts:139 |
MEDIA_TRACK_MUTED | "media:track:muted" | 'media:track:muted' | src/types/events.types.ts:140 |
MEDIA_TRACK_UNMUTED | "media:track:unmuted" | 'media:track:unmuted' | src/types/events.types.ts:141 |
MEDIA_DEVICE_CHANGED | "media:device:changed" | 'media:device:changed' | src/types/events.types.ts:142 |
TRANSFER_INITIATED | "transfer:initiated" | 'transfer:initiated' | src/types/events.types.ts:145 |
TRANSFER_ACCEPTED | "transfer:accepted" | 'transfer:accepted' | src/types/events.types.ts:146 |
TRANSFER_FAILED | "transfer:failed" | 'transfer:failed' | src/types/events.types.ts:147 |
TRANSFER_COMPLETED | "transfer:completed" | 'transfer:completed' | src/types/events.types.ts:148 |
PRESENCE_UPDATED | "presence:updated" | 'presence:updated' | src/types/events.types.ts:151 |
PRESENCE_SUBSCRIBED | "presence:subscribed" | 'presence:subscribed' | src/types/events.types.ts:152 |
PRESENCE_UNSUBSCRIBED | "presence:unsubscribed" | 'presence:unsubscribed' | src/types/events.types.ts:153 |
MESSAGE_RECEIVED | "message:received" | 'message:received' | src/types/events.types.ts:156 |
MESSAGE_SENT | "message:sent" | 'message:sent' | src/types/events.types.ts:157 |
MESSAGE_FAILED | "message:failed" | 'message:failed' | src/types/events.types.ts:158 |
CONFERENCE_CREATED | "conference:created" | 'conference:created' | src/types/events.types.ts:161 |
CONFERENCE_JOINED | "conference:joined" | 'conference:joined' | src/types/events.types.ts:162 |
CONFERENCE_LEFT | "conference:left" | 'conference:left' | src/types/events.types.ts:163 |
CONFERENCE_PARTICIPANT_JOINED | "conference:participant:joined" | 'conference:participant:joined' | src/types/events.types.ts:164 |
CONFERENCE_PARTICIPANT_LEFT | "conference:participant:left" | 'conference:participant:left' | src/types/events.types.ts:165 |
CONFERENCE_ENDED | "conference:ended" | 'conference:ended' | src/types/events.types.ts:166 |
DTMF_SENT | "dtmf:sent" | 'dtmf:sent' | src/types/events.types.ts:169 |
DTMF_RECEIVED | "dtmf:received" | 'dtmf:received' | src/types/events.types.ts:170 |
ERROR | "error" | 'error' | src/types/events.types.ts:173 |
OAuth2ProviderTemplates
const OAuth2ProviderTemplates: Record<OAuth2ProviderType, Partial<OAuth2ProviderConfig>>;Defined in: src/types/oauth.types.ts:136
Pre-configured OAuth2 provider templates
HOOK_NAMES
const HOOK_NAMES: object;Defined in: src/types/plugin.types.ts:42
Standard hook names
These hooks are called at specific points in the application lifecycle.
Type Declaration
| Name | Type | Default value | Defined in |
|---|---|---|---|
BEFORE_INIT | "beforeInit" | 'beforeInit' | src/types/plugin.types.ts:44 |
AFTER_INIT | "afterInit" | 'afterInit' | src/types/plugin.types.ts:45 |
BEFORE_DESTROY | "beforeDestroy" | 'beforeDestroy' | src/types/plugin.types.ts:46 |
AFTER_DESTROY | "afterDestroy" | 'afterDestroy' | src/types/plugin.types.ts:47 |
BEFORE_CONNECT | "beforeConnect" | 'beforeConnect' | src/types/plugin.types.ts:50 |
AFTER_CONNECT | "afterConnect" | 'afterConnect' | src/types/plugin.types.ts:51 |
BEFORE_DISCONNECT | "beforeDisconnect" | 'beforeDisconnect' | src/types/plugin.types.ts:52 |
AFTER_DISCONNECT | "afterDisconnect" | 'afterDisconnect' | src/types/plugin.types.ts:53 |
BEFORE_REGISTER | "beforeRegister" | 'beforeRegister' | src/types/plugin.types.ts:56 |
AFTER_REGISTER | "afterRegister" | 'afterRegister' | src/types/plugin.types.ts:57 |
BEFORE_UNREGISTER | "beforeUnregister" | 'beforeUnregister' | src/types/plugin.types.ts:58 |
AFTER_UNREGISTER | "afterUnregister" | 'afterUnregister' | src/types/plugin.types.ts:59 |
BEFORE_CALL | "beforeCall" | 'beforeCall' | src/types/plugin.types.ts:62 |
AFTER_CALL_START | "afterCallStart" | 'afterCallStart' | src/types/plugin.types.ts:63 |
BEFORE_ANSWER | "beforeAnswer" | 'beforeAnswer' | src/types/plugin.types.ts:64 |
AFTER_ANSWER | "afterAnswer" | 'afterAnswer' | src/types/plugin.types.ts:65 |
BEFORE_HANGUP | "beforeHangup" | 'beforeHangup' | src/types/plugin.types.ts:66 |
AFTER_HANGUP | "afterHangup" | 'afterHangup' | src/types/plugin.types.ts:67 |
BEFORE_MEDIA_ACQUIRE | "beforeMediaAcquire" | 'beforeMediaAcquire' | src/types/plugin.types.ts:70 |
AFTER_MEDIA_ACQUIRE | "afterMediaAcquire" | 'afterMediaAcquire' | src/types/plugin.types.ts:71 |
BEFORE_MEDIA_RELEASE | "beforeMediaRelease" | 'beforeMediaRelease' | src/types/plugin.types.ts:72 |
AFTER_MEDIA_RELEASE | "afterMediaRelease" | 'afterMediaRelease' | src/types/plugin.types.ts:73 |
ON_ERROR | "onError" | 'onError' | src/types/plugin.types.ts:76 |
ON_CALL_ERROR | "onCallError" | 'onCallError' | src/types/plugin.types.ts:77 |
ON_CONNECTION_ERROR | "onConnectionError" | 'onConnectionError' | src/types/plugin.types.ts:78 |
DEFAULT_DIALOG_DISPLAY
const DEFAULT_DIALOG_DISPLAY: Record<DialogState, StateDisplayOptions>;Defined in: src/types/presence.types.ts:45
Default display options for each dialog state
CONFIG_PROVIDER_KEY
const CONFIG_PROVIDER_KEY: InjectionKey<ConfigProviderContext>;Defined in: src/types/provider.types.ts:97
Injection key for ConfigProvider
MEDIA_PROVIDER_KEY
const MEDIA_PROVIDER_KEY: InjectionKey<MediaProviderContext>;Defined in: src/types/provider.types.ts:273
Injection key for MediaProvider
STORAGE_KEYS
const STORAGE_KEYS: object;Defined in: src/types/storage.types.ts:125
Storage key constants
All storage keys use the namespace pattern: vuesip:{version}:{category}:
Type Declaration
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
SIP_CONFIG | "sip:config" | 'sip:config' | SIP configuration (encrypted) | src/types/storage.types.ts:127 |
SIP_CREDENTIALS | "sip:credentials" | 'sip:credentials' | SIP credentials (encrypted) | src/types/storage.types.ts:129 |
MEDIA_CONFIG | "media:config" | 'media:config' | Media configuration | src/types/storage.types.ts:131 |
USER_PREFERENCES | "user:preferences" | 'user:preferences' | User preferences | src/types/storage.types.ts:133 |
DEVICE_AUDIO_INPUT | "device:audio-input" | 'device:audio-input' | Selected audio input device | src/types/storage.types.ts:135 |
DEVICE_AUDIO_OUTPUT | "device:audio-output" | 'device:audio-output' | Selected audio output device | src/types/storage.types.ts:137 |
DEVICE_VIDEO_INPUT | "device:video-input" | 'device:video-input' | Selected video input device | src/types/storage.types.ts:139 |
DEVICE_PERMISSIONS | "device:permissions" | 'device:permissions' | Device permissions status | src/types/storage.types.ts:141 |
CALL_HISTORY | "call:history" | 'call:history' | Call history (IndexedDB) | src/types/storage.types.ts:143 |
REGISTRATION_STATE | "registration:state" | 'registration:state' | Registration state | src/types/storage.types.ts:145 |
REGISTRATION_LAST_TIME | "registration:last-time" | 'registration:last-time' | Last registration time | src/types/storage.types.ts:147 |
defaultLogger
const defaultLogger: Logger;Defined in: src/utils/logger.ts:396
Default logger instance (for global use)
Functions
useActiveSpeaker()
function useActiveSpeaker(participants, options): UseActiveSpeakerReturn;Defined in: src/composables/useActiveSpeaker.ts:85
Active Speaker Detection Composable
Monitors participant audio levels and determines the dominant speaker in a conference. Provides real-time detection with configurable threshold, debouncing to prevent rapid speaker switching, and speaker history tracking.
Features:
- Dominant speaker detection (highest audio level above threshold)
- Multiple active speakers tracking (all above threshold)
- Configurable audio level threshold
- Debounced speaker change callbacks
- Speaker history with peak levels
- Dynamic threshold adjustment
- Muted participant filtering
Parameters
| Parameter | Type | Description |
|---|---|---|
participants | Ref<Participant[]> | Reactive reference to conference participants array |
options | ActiveSpeakerOptions | Configuration options for active speaker detection |
Returns
Object containing active speaker state and control methods
Since
1.0.0
Examples
import { ref } from 'vue'
import { useActiveSpeaker } from './composables/useActiveSpeaker'
const participants = ref<Participant[]>([])
const { activeSpeaker, isSomeoneSpeaking } = useActiveSpeaker(participants)
// Watch for active speaker changes
watch(activeSpeaker, (speaker) => {
if (speaker) {
console.log(`${speaker.displayName} is speaking`)
}
})const { activeSpeaker, activeSpeakers, speakerHistory } = useActiveSpeaker(
participants,
{
threshold: 0.2,
debounceMs: 500,
historySize: 20,
excludeMuted: true,
onSpeakerChange: (current, previous) => {
console.log(`Speaker changed from ${previous?.displayName} to ${current?.displayName}`)
}
}
)useAmi()
function useAmi(): UseAmiReturn;Defined in: src/composables/useAmi.ts:96
AMI Composable
Provides reactive AMI functionality for Vue components.
Returns
Example
const { connect, isConnected, presenceStates, getPresenceState } = useAmi()
// Connect to amiws
await connect({ url: 'ws://pbx.example.com:8080' })
// Query presence
const state = await getPresenceState('1000')
console.log(state) // { extension: '1000', state: 'available', ... }
// Watch for changes
watch(presenceStates, (states) => {
console.log('Presence updated:', states)
})useAmiAgentLogin()
function useAmiAgentLogin(client, options): UseAmiAgentLoginReturn;Defined in: src/composables/useAmiAgentLogin.ts:214
AMI Agent Login Composable
Provides reactive agent session management functionality for Vue components. Supports queue login/logout, pause management, and shift tracking.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiAgentLoginOptions | Configuration options |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
session,
isLoggedIn,
login,
logout,
pause,
unpause,
} = useAmiAgentLogin(ami.getClient()!, {
agentId: 'agent1001',
interface: 'PJSIP/1001',
name: 'John Doe',
defaultQueues: ['sales', 'support'],
pauseReasons: ['Break', 'Lunch', 'Training'],
persistState: true,
})
// Login to queues
await login({ queues: ['sales', 'support'] })
// Pause agent
await pause({ reason: 'Lunch' })
// Logout
await logout()useAmiAgentStats()
function useAmiAgentStats(client, options): UseAmiAgentStatsReturn;Defined in: src/composables/useAmiAgentStats.ts:308
AMI Agent Statistics Composable
Track individual agent performance metrics with real-time updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Ref<AmiClient | null> | AMI client instance |
options | UseAmiAgentStatsOptions | Configuration options |
Returns
Example
const ami = useAmi()
const {
stats,
performanceLevel,
callsPerHour,
avgHandleTime,
startTracking,
stopTracking,
refresh,
} = useAmiAgentStats(ami.getClient(), {
agentId: '1001',
queues: ['sales', 'support'],
period: 'today',
realTimeUpdates: true,
onAlert: (alert) => console.log('Alert:', alert),
})
startTracking()useAmiBlacklist()
function useAmiBlacklist(client, options): UseAmiBlacklistReturn;Defined in: src/composables/useAmiBlacklist.ts:224
AMI Blacklist Composable
Provides reactive call blocking management for Vue components. Stores blacklist entries in AstDB for persistence.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance |
options | UseAmiBlacklistOptions | Configuration options |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
blocklist,
blockNumber,
unblockNumber,
isBlocked,
} = useAmiBlacklist(ami.getClient()!, {
onCallBlocked: (number) => console.log('Blocked call from', number),
})
// Block a spam caller
await blockNumber('18005551234', {
reason: 'spam',
action: 'hangup',
description: 'Persistent telemarketer',
})
// Check if number is blocked
if (isBlocked('18005551234')) {
console.log('This number is blocked')
}useAmiCDR()
function useAmiCDR(amiClientRef, options): UseAmiCDRReturn;Defined in: src/composables/useAmiCDR.ts:543
AMI CDR Composable
Provides reactive CDR processing for Vue components.
Parameters
| Parameter | Type | Description |
|---|---|---|
amiClientRef | | Ref<AmiClient | null, AmiClient | null> | ComputedRef<AmiClient | null> | Ref to AMI client instance |
options | UseAmiCDROptions | Configuration options |
Returns
useAmiCallback()
function useAmiCallback(client, options): UseAmiCallbackReturn;Defined in: src/composables/useAmiCallback.ts:118
AMI Callback Queue Composable
Provides reactive callback queue management for Vue components. Supports scheduling, execution, and persistence via AstDB.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiCallbackOptions | Configuration options |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
callbacks,
pendingCallbacks,
scheduleCallback,
executeCallback,
executeNext,
} = useAmiCallback(ami.getClient()!, {
defaultQueue: 'sales',
defaultMaxAttempts: 3,
autoExecute: true,
onCallbackCompleted: (cb) => console.log('Callback completed:', cb.callerNumber),
})
// Schedule a callback
await scheduleCallback({
callerNumber: '+1-555-123-4567',
callerName: 'John Doe',
reason: 'Sales inquiry',
priority: 'high',
})
// Execute next pending callback
await executeNext()useAmiCalls()
function useAmiCalls(client, options): UseAmiCallsReturn;Defined in: src/composables/useAmiCalls.ts:130
AMI Calls Composable
Provides reactive call management functionality for Vue components. Supports click-to-call, real-time call monitoring, and call control.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiCallsOptions | Configuration options with sensible defaults |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
calls,
callList,
clickToCall,
hangup,
} = useAmiCalls(ami.getClient()!, {
useEvents: true,
defaultContext: 'from-internal',
agentFirst: true,
onCallStart: (call) => console.log('Call started:', call.callerIdNum),
onCallEnd: (call) => console.log('Call ended:', call.uniqueId),
})
// Click-to-call: rings agent first, then dials destination
const result = await clickToCall('SIP/1000', '18005551234', {
callerId: 'Sales <1000>',
})
// Watch active calls
watch(callList, (activeCalls) => {
console.log('Active calls:', activeCalls.length)
})useAmiDatabase()
function useAmiDatabase(client, options): UseAmiDatabaseReturn;Defined in: src/composables/useAmiDatabase.ts:135
AMI Database Composable
Provides reactive contact/phonebook management via AstDB. Supports custom field definitions and grouping.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiDatabaseOptions | Configuration options with sensible defaults |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
contacts,
contactList,
contactsByGroup,
saveContact,
deleteContact,
search,
} = useAmiDatabase(ami.getClient()!, {
contactFamily: 'phonebook',
groups: ['Sales', 'Support', 'VIP'],
fields: [
{ key: 'name', label: 'Name', type: 'text', required: true },
{ key: 'number', label: 'Phone Number', type: 'tel', required: true },
{ key: 'email', label: 'Email', type: 'email' },
{ key: 'company', label: 'Company', type: 'text' },
],
onContactSaved: (contact) => console.log('Contact saved:', contact.name),
})
// Save a contact
await saveContact({
name: 'John Doe',
number: '+1234567890',
email: 'john@example.com',
group: 'Sales',
})
// Search contacts
const results = search('john')useAmiFeatureCodes()
function useAmiFeatureCodes(client, options): UseAmiFeatureCodesReturn;Defined in: src/composables/useAmiFeatureCodes.ts:138
AMI Feature Codes Composable
Provides reactive feature code management for Vue components. Supports DND, Call Forward, and custom feature codes.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiFeatureCodesOptions | Configuration options |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
dndStatus,
isDndEnabled,
toggleDnd,
enableCallForward,
disableCallForward,
} = useAmiFeatureCodes(ami.getClient()!, {
extension: '1001',
onDndChanged: (enabled) => console.log('DND:', enabled),
})
// Toggle DND
await toggleDnd()
// Enable call forward
await enableCallForward('5551234567')useAmiIVR()
function useAmiIVR(client, options): UseAmiIVRReturn;Defined in: src/composables/useAmiIVR.ts:151
AMI IVR Composable
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Ref<AmiClient | null> | Ref to AMI client instance |
options | UseAmiIVROptions | Configuration options |
Returns
IVR management interface
useAmiPaging()
function useAmiPaging(client, options): UseAmiPagingReturn;Defined in: src/composables/useAmiPaging.ts:99
AMI Paging Composable
Provides reactive paging/intercom functionality for Vue components. Supports single extension paging, group paging, and duplex intercom mode.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiPagingOptions | Configuration options with sensible defaults |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
status,
isPaging,
pageExtension,
pageGroup,
endPage,
} = useAmiPaging(ami.getClient()!, {
defaultMode: 'simplex',
defaultTimeout: 30,
onPageStart: (session) => console.log('Paging started:', session.target),
onPageEnd: (session) => console.log('Paging ended:', session.sessionId),
})
// Page a single extension
await pageExtension('1001')
// Page with duplex intercom (two-way audio)
await pageExtension('1002', { mode: 'duplex' })
// Page a group
await pageGroup('sales-floor')
// End active page
await endPage()useAmiParking()
function useAmiParking(amiClientRef, options): UseAmiParkingReturn;Defined in: src/composables/useAmiParking.ts:100
AMI Parking Composable
Provides reactive call parking functionality for Vue components.
Parameters
| Parameter | Type | Description |
|---|---|---|
amiClientRef | Ref<AmiClient | null> | Ref to AMI client instance |
options | UseAmiParkingOptions | Configuration options |
Returns
Example
const ami = useAmi()
const { parkedCalls, parkCall, retrieveCall, refreshParkingLot } = useAmiParking(
computed(() => ami.getClient())
)
// Park a call
const space = await parkCall('PJSIP/1001-00000001')
console.log(`Call parked at space ${space}`)
// Retrieve a parked call
await retrieveCall(701, 'PJSIP/1002-00000002')
// Watch parked calls
watch(parkedCalls, (calls) => {
console.log(`${calls.length} calls currently parked`)
})useAmiPeers()
function useAmiPeers(client, options): UseAmiPeersReturn;Defined in: src/composables/useAmiPeers.ts:121
AMI Peers Composable
Provides reactive peer/endpoint status for Vue components. Supports both legacy chan_sip and modern chan_pjsip.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiPeersOptions | Configuration options with sensible defaults |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
peers,
peerList,
onlinePeers,
statusSummary,
refresh,
isOnline,
} = useAmiPeers(ami.getClient()!, {
useEvents: true,
includeSip: true,
includePjsip: true,
peerFilter: (peer) => !peer.objectName.startsWith('trunk-'),
onPeerUpdate: (peer) => console.log('Peer updated:', peer.objectName, peer.status),
})
// Initial load
await refresh()
// Check if specific peer is online
if (isOnline('1000')) {
console.log('Extension 1000 is online')
}useAmiQueues()
function useAmiQueues(client, options): UseAmiQueuesReturn;Defined in: src/composables/useAmiQueues.ts:120
AMI Queues Composable
Provides reactive queue management functionality for Vue components. Supports real-time updates via AMI events or polling.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiQueuesOptions | Configuration options with sensible defaults |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
queues,
queueList,
refresh,
pauseMember,
getPauseReasons,
} = useAmiQueues(ami.getClient()!, {
useEvents: true,
queueFilter: (q) => q.name.startsWith('sales-'),
pauseReasons: ['Break', 'Lunch', 'Training', 'Meeting'],
onQueueUpdate: (queue) => console.log('Queue updated:', queue.name),
})
// Initial load
await refresh()
// Pause an agent
await pauseMember('sales-queue', 'SIP/1000', 'Lunch')useAmiRecording()
function useAmiRecording(clientRef, options): UseAmiRecordingReturn;Defined in: src/composables/useAmiRecording.ts:147
useAmiRecording composable for call recording management
Parameters
| Parameter | Type | Description |
|---|---|---|
clientRef | | Ref<AmiClient | null, AmiClient | null> | ComputedRef<AmiClient | null> | Reactive reference to AmiClient instance |
options | UseAmiRecordingOptions | Recording options |
Returns
Recording management interface
useAmiRingGroups()
function useAmiRingGroups(client, options): UseAmiRingGroupsReturn;Defined in: src/composables/useAmiRingGroups.ts:147
AMI Ring Groups Composable
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Ref<AmiClient | null> | Ref to AMI client instance |
options | UseAmiRingGroupsOptions | Configuration options |
Returns
Ring group management interface
useAmiSupervisor()
function useAmiSupervisor(client, options): UseAmiSupervisorReturn;Defined in: src/composables/useAmiSupervisor.ts:127
AMI Supervisor Composable
Provides supervisor functionality for call center monitoring. Uses ChanSpy application for monitoring/whisper/barge.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance (from useAmi().getClient()) |
options | UseAmiSupervisorOptions | Configuration options with sensible defaults |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
sessions,
monitor,
whisper,
barge,
endSession,
} = useAmiSupervisor(ami.getClient()!, {
supervisorContext: 'from-internal',
onSessionStart: (session) => console.log('Supervision started:', session.mode),
onSessionEnd: (session) => console.log('Supervision ended:', session.id),
})
// Silent monitor an agent's call
const session = await monitor('SIP/supervisor', 'SIP/agent-call')
// Whisper to agent (coach mode)
await whisper('SIP/supervisor', 'SIP/agent-call')
// Barge into call
await barge('SIP/supervisor', 'SIP/agent-call')
// End supervision
await endSession(session.id)useAmiTimeConditions()
function useAmiTimeConditions(client, options): UseAmiTimeConditionsReturn;Defined in: src/composables/useAmiTimeConditions.ts:250
AMI Time Conditions Composable
Provides reactive time-based routing management for Vue components. Stores time conditions in AstDB for persistence.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | AmiClient | null | AMI client instance |
options | UseAmiTimeConditionsOptions | Configuration options |
Returns
Example
const ami = useAmi()
await ami.connect({ url: 'ws://pbx.example.com:8080' })
const {
conditions,
statuses,
isOpen,
setOverride,
addHoliday,
} = useAmiTimeConditions(ami.getClient()!, {
onStateChange: (id, status) => console.log(`${id} is now ${status.state}`),
})
// Check if business is open
if (isOpen('main_hours')) {
console.log('We are open!')
}
// Force closed for the day
await setOverride('main_hours', 'force_closed')
// Add a holiday
await addHoliday('main_hours', {
name: 'Christmas Day',
date: '2024-12-25',
recurring: true,
})useAmiVoicemail()
function useAmiVoicemail(amiClientRef, options): UseAmiVoicemailReturn;Defined in: src/composables/useAmiVoicemail.ts:91
AMI Voicemail Composable
Provides reactive voicemail/MWI functionality for Vue components.
Parameters
| Parameter | Type | Description |
|---|---|---|
amiClientRef | Ref<AmiClient | null> | Ref to AMI client instance |
options | UseAmiVoicemailOptions | Configuration options |
Returns
Example
const ami = useAmi()
const { mwiStates, getMwiState, monitorMailbox, totalNewMessages } = useAmiVoicemail(
computed(() => ami.getClient())
)
// Monitor a mailbox
monitorMailbox('1000', 'default')
// Check MWI state
const mwi = await getMwiState('1000')
console.log(`${mwi.newMessages} new messages`)
// Watch for changes
watch(totalNewMessages, (count) => {
console.log(`Total new messages: ${count}`)
})useAudioDevices()
function useAudioDevices(): UseAudioDevicesReturn;Defined in: src/composables/useAudioDevices.ts:60
Returns
useBandwidthAdaptation()
function useBandwidthAdaptation(options): UseBandwidthAdaptationReturn;Defined in: src/composables/useBandwidthAdaptation.ts:152
Bandwidth adaptation composable
Parameters
| Parameter | Type | Description |
|---|---|---|
options | BandwidthAdaptationOptions | Configuration options |
Returns
Reactive bandwidth adaptation state and controls
useCallControls()
function useCallControls(sipClient): UseCallControlsReturn;Defined in: src/composables/useCallControls.ts:113
Call Controls Composable
Provides advanced call control features for SIP calls including blind transfer, attended transfer (with consultation), and call forwarding.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance |
Returns
Call control state and methods
Example
const {
blindTransfer,
initiateAttendedTransfer,
completeAttendedTransfer,
isTransferring
} = useCallControls(sipClient)
// Blind transfer
await blindTransfer('call-123', 'sip:transfer-target@domain.com')
// Attended transfer
const consultationCallId = await initiateAttendedTransfer('call-123', 'sip:consult@domain.com')
// ... talk to consultation target ...
await completeAttendedTransfer()useCallHistory()
function useCallHistory(): UseCallHistoryReturn;Defined in: src/composables/useCallHistory.ts:97
Call History Composable
Manages call history with reactive state, filtering, searching, and export. Automatically persists history to IndexedDB for long-term storage.
Returns
Call history state and methods
Example
const {
history,
filteredHistory,
searchHistory,
exportHistory,
getStatistics
} = useCallHistory()
// Search history
const results = searchHistory('john')
// Get statistics
const stats = getStatistics()
console.log(`Total calls: ${stats.totalCalls}`)
// Export to CSV
await exportHistory({ format: 'csv', filename: 'my-calls' })useCallHold()
function useCallHold(session): UseCallHoldReturn;Defined in: src/composables/useCallHold.ts:87
Call Hold Composable
Manages SIP call hold/resume with reactive state, supporting SDP manipulation for hold state. Integrates with CallSession core class and handles hold/unhold events.
Parameters
| Parameter | Type | Description |
|---|---|---|
session | Ref<CallSession | null> | Active call session reference |
Returns
Call hold state and methods
Example
const {
holdState,
isOnHold,
isLocalHold,
isRemoteHold,
holdCall,
resumeCall,
toggleHold
} = useCallHold(sessionRef)
// Place call on hold
await holdCall()
// Resume from hold
await resumeCall()
// Toggle hold state
await toggleHold()useCallQualityScore()
function useCallQualityScore(options): UseCallQualityScoreReturn;Defined in: src/composables/useCallQualityScore.ts:373
Composable for calculating comprehensive call quality scores
Parameters
| Parameter | Type | Description |
|---|---|---|
options | CallQualityScoreOptions | Configuration options |
Returns
Quality scoring interface
Example
const { score, trend, updateScore, reset } = useCallQualityScore({
weights: { packetLoss: 0.3 },
historySize: 20,
})
// Update with new stats
updateScore({
packetLoss: 0.5,
jitter: 15,
rtt: 50,
mos: 4.2,
})
// Check current score
console.log(score.value?.overall) // e.g., 85
console.log(score.value?.grade) // e.g., 'B'useCallSession()
function useCallSession(sipClient, mediaManager?): UseCallSessionReturn;Defined in: src/composables/useCallSession.ts:197
Call Session Composable
Manages SIP call sessions with reactive state, media handling, and call controls. Integrates with CallSession core class, MediaManager, and callStore.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance |
mediaManager? | Ref<MediaManager | null, MediaManager | null> | Media manager instance (optional, will create if not provided) |
Returns
Call session state and methods
Example
const {
state,
makeCall,
answer,
hangup,
hold,
unhold,
mute,
sendDTMF
} = useCallSession(sipClient, mediaManager)
// Make a call
await makeCall('sip:bob@domain.com', { audio: true, video: false })
// Answer incoming call
await answer()
// Put on hold
await hold()
// Send DTMF
await sendDTMF('1')
// Hangup
await hangup()useCallTransfer()
function useCallTransfer(session): UseCallTransferReturn;Defined in: src/composables/useCallTransfer.ts:111
Call Transfer Composable
Manages SIP call transfers with reactive state, supporting both blind and attended transfer modes. Integrates with CallSession core class and handles REFER method events.
Parameters
| Parameter | Type | Description |
|---|---|---|
session | Ref<CallSession | null> | Active call session reference |
Returns
Call transfer state and methods
Example
const {
transferState,
transferCall,
acceptTransfer,
rejectTransfer,
isTransferring
} = useCallTransfer(sessionRef)
// Blind transfer
await transferCall('sip:target@domain.com', {
type: TransferType.Blind,
target: 'sip:target@domain.com'
})
// Attended transfer
await transferCall('sip:target@domain.com', {
type: TransferType.Attended,
target: 'sip:target@domain.com',
consultationCallId: 'call-123'
})useConference()
function useConference(sipClient): UseConferenceReturn;Defined in: src/composables/useConference.ts:350
Conference Composable
Manages SIP conference calls with support for multiple participants, audio level monitoring, and advanced controls like muting, recording, and locking.
Features:
- Create and join conferences
- Add/remove participants dynamically
- Mute/unmute participants
- Lock/unlock conference (control participant access)
- Record conference sessions
- Monitor audio levels in real-time
- Event-driven participant updates
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | Reactive reference to the SIP client instance |
Returns
Object containing conference state and control methods
Throws
Various errors can be thrown by the returned methods. See individual method documentation.
Lifecycle and Cleanup
- The composable automatically cleans up on component unmount (via onUnmounted)
- Active conferences are ended automatically during cleanup
- Audio level monitoring is stopped during cleanup
- Event listeners are cleared during cleanup
- You can manually call endConference() before unmount if needed
Best Practices
- Always check
isActivebefore performing conference operations - Use the
onConferenceEventlistener to react to participant changes - Lock conferences when you want to prevent new participants
- Handle errors from all async methods appropriately
- Clean up event listeners when no longer needed (call the unsubscribe function)
- Consider the max participants limit when designing your UI
Common Pitfalls
- Don't create multiple conferences simultaneously - check
isActivefirst - Don't call
removeParticipantto leave - useendConferenceinstead - Remember that
participantCountincludes yourself (the local participant) - Conference state transitions are asynchronous - watch the
stateproperty - Muting yourself vs muting others uses different underlying mechanisms
Since
1.0.0
Examples
import { ref } from 'vue'
import { useConference } from './composables/useConference'
const sipClient = ref(mySipClient)
const {
createConference,
addParticipant,
participants,
participantCount,
endConference
} = useConference(sipClient)
// Create a new conference
const confId = await createConference({
maxParticipants: 10,
locked: false
})
console.log(`Created conference: ${confId}`)
// Add participants
await addParticipant('sip:alice@domain.com', 'Alice')
await addParticipant('sip:bob@domain.com', 'Bob')
// Monitor participants
console.log(`Active participants: ${participantCount.value}`)
// End conference when done
await endConference()const { joinConference, participants, isActive } = useConference(sipClient)
// Join existing conference
await joinConference('sip:conference123@server.com')
// Check if joined successfully
if (isActive.value) {
console.log(`Joined with ${participants.value.length} participants`)
}const {
addParticipant,
muteParticipant,
removeParticipant,
participants
} = useConference(sipClient)
// Add and manage a participant
const participantId = await addParticipant('sip:user@domain.com', 'User')
// Mute the participant
await muteParticipant(participantId)
// Remove participant if needed
await removeParticipant(participantId, 'Violating terms')const {
createConference,
lockConference,
startRecording,
stopRecording,
isLocked,
isRecording
} = useConference(sipClient)
await createConference()
// Lock conference to prevent new joins
await lockConference()
console.log(`Locked: ${isLocked.value}`)
// Start recording
await startRecording()
console.log(`Recording: ${isRecording.value}`)
// Stop recording when done
await stopRecording()const { onConferenceEvent, createConference } = useConference(sipClient)
// Register event listener
const unsubscribe = onConferenceEvent((event) => {
switch (event.type) {
case 'participant:joined':
console.log('New participant:', event.participant.displayName)
break
case 'participant:left':
console.log('Participant left:', event.participant.displayName)
break
case 'audio:level':
console.log('Audio levels:', event.levels)
break
}
})
await createConference()
// Clean up when done
unsubscribe()useConnectionRecovery()
function useConnectionRecovery(options): UseConnectionRecoveryReturn;Defined in: src/composables/useConnectionRecovery.ts:103
Composable for managing connection recovery with ICE restart
Parameters
| Parameter | Type | Description |
|---|---|---|
options | ConnectionRecoveryOptions | Configuration options |
Returns
Connection recovery state and methods
Example
const { state, isRecovering, recover, monitor } = useConnectionRecovery({
maxAttempts: 3,
onRecoverySuccess: () => console.log('Recovered!')
})
// Start monitoring a peer connection
monitor(peerConnection)useDTMF()
function useDTMF(session): UseDTMFReturn;Defined in: src/composables/useDTMF.ts:126
DTMF Composable
Manages DTMF tone sending for active call sessions with queue management, tone sequences, and flexible configuration.
Parameters
| Parameter | Type | Description |
|---|---|---|
session | Ref<CallSession | null> | Call session instance |
Returns
DTMF state and methods
Example
const {
sendTone,
sendToneSequence,
isSending,
queuedTones
} = useDTMF(session)
// Send single tone
await sendTone('1')
// Send sequence
await sendToneSequence('1234#', {
duration: 100,
interToneGap: 70,
onToneSent: (tone) => console.log(`Sent: ${tone}`)
})
// Queue tones
queueToneSequence('5678')
await processQueue()useDialog()
function useDialog(sipClient): UseDialogReturn;Defined in: src/composables/useDialog.ts:90
Dialog/BLF Composable
Manages SIP dialog subscriptions for monitoring extension states. Supports Asterisk/FreePBX BLF (Busy Lamp Field) functionality.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance |
Returns
Dialog state and methods
Example
const { subscribe, watchedExtensions, getDisplayOptions } = useDialog(sipClient)
// Subscribe to extension 6001
await subscribe('sip:6001@pbx.example.com')
// Check status with display options
watchedExtensions.value.forEach((status, uri) => {
const display = getDisplayOptions(status.state)
console.log(`${uri}: ${display.icon} ${display.label}`)
})useFreePBXPresence()
function useFreePBXPresence(initialConfig?): UseFreePBXPresenceReturn;Defined in: src/composables/useFreePBXPresence.ts:179
FreePBX Presence Composable
Provides reactive presence state management for FreePBX extensions with automatic return time tracking and countdown updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
initialConfig? | FreePBXPresenceBridgeConfig | Optional initial bridge configuration |
Returns
Presence state and methods
Example
const {
presenceList,
selectedPresence,
subscribe,
setReturnTime,
overdueExtensions,
} = useFreePBXPresence({
host: 'pbx.example.com',
apiToken: 'your-api-token',
})
// Subscribe to specific extensions
await subscribe(['101', '102', '103'])
// Or subscribe to all extensions
await subscribe('all')
// Set return time (30 minutes from now)
setReturnTime('101', 30)
// Or set specific time
setReturnTime('101', new Date('2024-01-15T14:30:00'))useGalleryLayout()
function useGalleryLayout(participantCount, options): UseGalleryLayoutReturn;Defined in: src/composables/useGalleryLayout.ts:135
Gallery Layout Composable
Calculates optimal grid dimensions for displaying conference participants based on participant count, container size, and layout mode.
Features:
- Optimal grid calculation (cols x rows) based on participant count
- Tile dimension calculation from container size
- Multiple layout modes (grid, speaker, sidebar, spotlight)
- Participant pinning support
- Active speaker focus support
- CSS grid style generation
Parameters
| Parameter | Type | Description |
|---|---|---|
participantCount | Ref<number> | Reactive reference to number of participants |
options | GalleryLayoutOptions | Configuration options |
Returns
Object containing layout state and control methods
Since
1.0.0
Examples
import { ref } from 'vue'
import { useGalleryLayout } from './composables/useGalleryLayout'
const participantCount = ref(6)
const { gridCols, gridRows, gridStyle } = useGalleryLayout(participantCount)
// gridCols.value = 3, gridRows.value = 2
// gridStyle.value = "display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;"const containerSize = ref({ width: 1920, height: 1080 })
const { tileDimensions, gridStyle } = useGalleryLayout(participantCount, {
containerSize,
gap: 16,
})
// tileDimensions.value = { width: 624, height: 351 }const activeSpeakerId = ref('speaker-1')
const { focusedParticipantId, pinParticipant } = useGalleryLayout(participantCount, {
activeSpeakerId,
})
// focusedParticipantId.value = 'speaker-1'
pinParticipant('pinned-user')
// focusedParticipantId.value = 'pinned-user' (pinned takes priority)useLocalRecording()
function useLocalRecording(options): UseLocalRecordingReturn;Defined in: src/composables/useLocalRecording.ts:47
Vue composable for client-side audio/video recording using MediaRecorder API
Parameters
| Parameter | Type | Description |
|---|---|---|
options | LocalRecordingOptions | Configuration options for recording |
Returns
Recording controls and reactive state
Example
<script setup>
import { useLocalRecording } from '@vuesip/composables'
const { state, isRecording, start, stop, download } = useLocalRecording({
mimeType: 'audio/webm',
autoDownload: true
})
async function startRecording() {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
start(stream)
}
</script>useMediaDevices()
function useMediaDevices(mediaManager?, options?): UseMediaDevicesReturn;Defined in: src/composables/useMediaDevices.ts:163
Media Devices Composable
Manages media devices with reactive state, device enumeration, selection, permission handling, and testing. Integrates with MediaManager and deviceStore.
Parameters
| Parameter | Type | Description |
|---|---|---|
mediaManager? | Ref<MediaManager | null, MediaManager | null> | Media manager instance (optional) |
options? | { autoEnumerate?: boolean; autoMonitor?: boolean; } | Options |
options.autoEnumerate? | boolean | Auto-enumerate on mount (default: true) |
options.autoMonitor? | boolean | Auto-monitor device changes (default: true) |
Returns
Media devices state and methods
Example
const {
audioInputDevices,
selectedAudioInputId,
enumerateDevices,
requestPermissions,
selectAudioInput,
testAudioInput
} = useMediaDevices(mediaManager)
// Request permissions
await requestPermissions(true, false)
// Enumerate devices
await enumerateDevices()
// Select device
if (audioInputDevices.value.length > 0) {
selectAudioInput(audioInputDevices.value[0].deviceId)
}
// Test device
const success = await testAudioInput()useMessaging()
function useMessaging(sipClient): UseMessagingReturn;Defined in: src/composables/useMessaging.ts:110
Messaging Composable
Manages SIP MESSAGE functionality for instant messaging with delivery notifications, read receipts, and composing indicators.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance |
Returns
Messaging state and methods
Example
const { sendMessage, messages, unreadCount } = useMessaging(sipClient)
// Send a message
const messageId = await sendMessage('sip:alice@domain.com', 'Hello!')
// Check unread count
console.log(`Unread messages: ${unreadCount.value}`)
// Mark as read
markAllAsRead('sip:alice@domain.com')useMultiLine()
function useMultiLine(config?): UseMultiLineReturn;Defined in: src/composables/useMultiLine.ts:93
Create multi-line composable
Parameters
| Parameter | Type | Description |
|---|---|---|
config? | Partial<MultiLineConfig> | Optional multi-line configuration |
Returns
Multi-line state and methods
Example
const {
lines,
activeLine,
switchToLine,
holdLine,
resumeLine,
assignCallToLine
} = useMultiLine({ maxLines: 4 })
// Switch to line 2
await switchToLine(2)
// Hold current line
await holdLine(activeLine.value?.id)
// Assign incoming call to available line
const lineId = await assignCallToLine(incomingSession)useNetworkQualityIndicator()
function useNetworkQualityIndicator(options): UseNetworkQualityIndicatorReturn;Defined in: src/composables/useNetworkQualityIndicator.ts:181
Network quality indicator composable
Parameters
| Parameter | Type | Description |
|---|---|---|
options | NetworkQualityIndicatorOptions | Configuration options |
Returns
UseNetworkQualityIndicatorReturn
Reactive network quality indicator state and controls
useOAuth2()
function useOAuth2(options): UseOAuth2ComposableReturn;Defined in: src/composables/useOAuth2.ts:100
Vue composable for OAuth2 authentication
Parameters
| Parameter | Type |
|---|---|
options | UseOAuth2Options |
Returns
createGoogleOAuth2Config()
function createGoogleOAuth2Config(params): OAuth2ServiceConfig;Defined in: src/composables/useOAuth2.ts:176
Create OAuth2 configuration for Google
Parameters
| Parameter | Type |
|---|---|
params | { clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; scopes?: string[]; } |
params.clientId | string |
params.redirectUri | string |
params.sipDomain | string |
params.wsServerUri | string |
params.scopes? | string[] |
Returns
createMicrosoftOAuth2Config()
function createMicrosoftOAuth2Config(params): OAuth2ServiceConfig;Defined in: src/composables/useOAuth2.ts:211
Create OAuth2 configuration for Microsoft/Azure AD
Parameters
| Parameter | Type |
|---|---|
params | { clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; tenantId?: string; scopes?: string[]; } |
params.clientId | string |
params.redirectUri | string |
params.sipDomain | string |
params.wsServerUri | string |
params.tenantId? | string |
params.scopes? | string[] |
Returns
createGitHubOAuth2Config()
function createGitHubOAuth2Config(params): OAuth2ServiceConfig;Defined in: src/composables/useOAuth2.ts:246
Create OAuth2 configuration for GitHub
Parameters
| Parameter | Type |
|---|---|
params | { clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; scopes?: string[]; } |
params.clientId | string |
params.redirectUri | string |
params.sipDomain | string |
params.wsServerUri | string |
params.scopes? | string[] |
Returns
createOktaOAuth2Config()
function createOktaOAuth2Config(params): OAuth2ServiceConfig;Defined in: src/composables/useOAuth2.ts:287
Create OAuth2 configuration for Okta
Parameters
| Parameter | Type |
|---|---|
params | { clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; oktaDomain: string; scopes?: string[]; } |
params.clientId | string |
params.redirectUri | string |
params.sipDomain | string |
params.wsServerUri | string |
params.oktaDomain | string |
params.scopes? | string[] |
Returns
createAuth0OAuth2Config()
function createAuth0OAuth2Config(params): OAuth2ServiceConfig;Defined in: src/composables/useOAuth2.ts:323
Create OAuth2 configuration for Auth0
Parameters
| Parameter | Type |
|---|---|
params | { clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; auth0Domain: string; audience?: string; scopes?: string[]; } |
params.clientId | string |
params.redirectUri | string |
params.sipDomain | string |
params.wsServerUri | string |
params.auth0Domain | string |
params.audience? | string |
params.scopes? | string[] |
Returns
createKeycloakOAuth2Config()
function createKeycloakOAuth2Config(params): OAuth2ServiceConfig;Defined in: src/composables/useOAuth2.ts:366
Create OAuth2 configuration for Keycloak
Parameters
| Parameter | Type |
|---|---|
params | { clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; keycloakUrl: string; realm: string; scopes?: string[]; } |
params.clientId | string |
params.redirectUri | string |
params.sipDomain | string |
params.wsServerUri | string |
params.keycloakUrl | string |
params.realm | string |
params.scopes? | string[] |
Returns
useParticipantControls()
function useParticipantControls(participant, options): UseParticipantControlsReturn;Defined in: src/composables/useParticipantControls.ts:49
Participant controls composable
Provides control actions for a conference participant including mute, kick, pin, and volume controls with permission checking.
Parameters
| Parameter | Type | Description |
|---|---|---|
participant | | Ref<Participant, Participant> | ComputedRef<Participant> | The participant to control (ref or computed ref) |
options | ParticipantControlsOptions | Control options and callbacks |
Returns
Control state and methods
Example
const { toggleMute, canKick, kickParticipant } = useParticipantControls(
participant,
{
isModerator: ref(true),
onMute: (p) => conference.muteParticipant(p.id),
onKick: (p) => conference.removeParticipant(p.id),
}
)
// Toggle mute state
if (canMute.value) {
toggleMute()
}
// Kick participant (only works if moderator)
if (canKick.value) {
kickParticipant()
}usePictureInPicture()
function usePictureInPicture(videoRef, options): UsePictureInPictureReturn;Defined in: src/composables/usePictureInPicture.ts:84
Composable for managing Picture-in-Picture mode for video elements
Parameters
| Parameter | Type | Description |
|---|---|---|
videoRef | Ref<HTMLVideoElement | null> | Ref to the HTMLVideoElement to use for PiP |
options | PictureInPictureOptions | Configuration options |
Returns
PiP controls and state
Description
The Picture-in-Picture (PiP) composable allows you to display video content in a floating window that stays on top of other applications. This is particularly useful for video calls, allowing users to monitor the call while working in other apps.
Example
import { ref } from 'vue'
import { usePictureInPicture } from 'vuesip'
const videoRef = ref<HTMLVideoElement | null>(null)
const {
isPiPSupported,
isPiPActive,
pipWindow,
enterPiP,
exitPiP,
togglePiP,
error
} = usePictureInPicture(videoRef)
// Check support before showing PiP controls
if (isPiPSupported.value) {
await enterPiP()
}usePresence()
function usePresence(sipClient): UsePresenceReturn;Defined in: src/composables/usePresence.ts:90
Presence Composable
Manages SIP presence functionality using SUBSCRIBE/NOTIFY/PUBLISH methods. Allows setting own status and watching other users' status.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance |
Returns
Presence state and methods
Example
const { setStatus, subscribe, watchedUsers } = usePresence(sipClient)
// Set own status
await setStatus(PresenceState.Available, {
statusMessage: 'Working on project'
})
// Watch another user
await subscribe('sip:alice@domain.com')
// Check their status
watchedUsers.value.forEach((status, uri) => {
console.log(`${uri}: ${status.state}`)
})useRecordingIndicator()
function useRecordingIndicator(options): UseRecordingIndicatorReturn;Defined in: src/composables/useRecordingIndicator.ts:79
Vue composable for recording status indicators
Provides visual UI indicators for recording status including:
- Blinking animation when recording
- Duration tracking and formatting
- Color-coded status (red = recording, yellow = paused, gray = inactive)
- Customizable blink interval and colors
Parameters
| Parameter | Type | Description |
|---|---|---|
options | RecordingIndicatorOptions | Configuration options |
Returns
Recording indicator controls and reactive state
Example
<script setup>
import { useRecordingIndicator } from '@vuesip/composables'
const {
state,
isRecording,
duration,
formattedDuration,
indicatorStyle,
setRecordingState
} = useRecordingIndicator()
// Start recording
setRecordingState('recording')
</script>
<template>
<div :style="indicatorStyle" class="w-4 h-4 rounded-full" />
<span>{{ formattedDuration }}</span>
</template>useSessionPersistence()
function useSessionPersistence(options): UseSessionPersistenceReturn;Defined in: src/composables/useSessionPersistence.ts:87
Composable for managing call session persistence
Parameters
| Parameter | Type | Description |
|---|---|---|
options | SessionPersistenceOptions | Configuration options |
Returns
Session persistence state and methods
Example
const {
saveSession,
loadSession,
clearSession,
hasSavedSession,
isLoading,
error,
savedSessionInfo
} = useSessionPersistence({
maxAge: 300000, // 5 minutes
autoRestore: false,
onRestoreSuccess: (state) => console.log('Restored:', state.sessionId),
onRestoreError: (err) => console.error('Restore failed:', err)
})
// Save session state
await saveSession({
sessionId: session.id,
remoteUri: remoteParty.uri,
callDirection: 'outbound',
holdState: false,
muteState: { audio: false, video: false },
timestamp: Date.now()
})
// Check for saved session on page load
const savedSession = await loadSession()
if (savedSession) {
// Attempt to reconnect
}useSipAutoAnswer()
function useSipAutoAnswer(options): UseSipAutoAnswerReturn;Defined in: src/composables/useSipAutoAnswer.ts:227
Vue composable for automatic call answering
Parameters
| Parameter | Type | Description |
|---|---|---|
options | UseSipAutoAnswerOptions | Configuration options |
Returns
Auto-answer state and methods
Example
import { useSipAutoAnswer } from 'vuesip'
const {
settings,
isEnabled,
enable,
disable,
setMode,
shouldAutoAnswer,
addToWhitelist
} = useSipAutoAnswer({
onAutoAnswer: (event) => {
console.log('Auto-answered call from', event.caller)
}
})
// Enable auto-answer for all calls
setMode('all')
enable()
// Or enable only for whitelisted numbers
setMode('whitelist')
addToWhitelist({ pattern: '+1555*', name: 'Office', enabled: true })useSipClient()
function useSipClient(initialConfig?, options?): UseSipClientReturn;Defined in: src/composables/useSipClient.ts:161
SIP Client Composable
Provides reactive access to SIP client functionality including connection management, registration, and configuration updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
initialConfig? | SipClientConfig | Optional initial SIP client configuration |
options? | { eventBus?: EventBus; autoConnect?: boolean; autoCleanup?: boolean; reconnectDelay?: number; connectionTimeout?: number; } | Optional composable options |
options.eventBus? | EventBus | Shared event bus instance |
options.autoConnect? | boolean | Auto-connect on mount |
options.autoCleanup? | boolean | Auto-cleanup on unmount |
options.reconnectDelay? | number | Reconnect delay in milliseconds (default: 1000) |
options.connectionTimeout? | number | Connection timeout in milliseconds (default: 30000) |
Returns
Composable interface with reactive state and methods
Example
const {
isConnected,
isRegistered,
connect,
disconnect,
register
} = useSipClient(config)
// Connect and register
await connect()useSipDtmf()
function useSipDtmf(currentSession): UseSipDtmfReturn;Defined in: src/composables/useSipDtmf.ts:28
Composable for sending DTMF tones during an active call
Parameters
| Parameter | Type | Description |
|---|---|---|
currentSession | Ref<any> | Reference to the current JsSIP RTCSession (typed as any due to lack of JsSIP types) |
Returns
Object with sendDtmf and sendDtmfSequence methods
useSipE911()
function useSipE911(
client,
eventBus?,
options?): UseSipE911Return;Defined in: src/composables/useSipE911.ts:179
E911 Emergency Call Handling Composable
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Ref<SipClient | null> | Ref to SIP client instance |
eventBus? | EventBus | null | Optional EventBus for subscribing to SIP events |
options? | UseSipE911Options | Configuration options |
Returns
E911 management interface
useSipRegistration()
function useSipRegistration(sipClient, options): UseSipRegistrationReturn;Defined in: src/composables/useSipRegistration.ts:132
SIP Registration Composable
Manages SIP registration lifecycle with reactive state, automatic refresh, and retry logic. Integrates with registrationStore and SipClient.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance |
options | RegistrationOptions | Registration options |
Returns
Registration state and methods
Example
const { isRegistered, register, unregister } = useSipRegistration(sipClient, {
expires: 600,
maxRetries: 3,
autoRefresh: true
})
// Register
await register()
// Check status
if (isRegistered.value) {
console.log('Successfully registered')
}
// Unregister
await unregister()useSipSecondLine()
function useSipSecondLine(
sipClient,
mediaManager?,
options?): UseSipSecondLineReturn;Defined in: src/composables/useSipSecondLine.ts:150
useSipSecondLine Composable
Manages multiple SIP call lines with support for concurrent calls, line switching, and advanced call control features.
Parameters
| Parameter | Type | Description |
|---|---|---|
sipClient | Ref<SipClient | null> | SIP client instance ref |
mediaManager? | Ref<MediaManager | null, MediaManager | null> | Media manager instance ref (optional) |
options? | UseSipSecondLineOptions | Configuration options |
Returns
Multi-line state and methods
Example
const {
lines,
selectedLine,
makeCall,
answerCall,
hangupCall,
holdLine,
swapLines,
} = useSipSecondLine(sipClient, mediaManager, {
lineCount: 4,
autoHoldOnNewCall: true,
})
// Make call on auto-selected line
const lineNum = await makeCall('sip:bob@domain.com')
// Answer incoming on line 2
await answerCall(2)
// Hold line 2, then swap to line 1
await holdLine(2)
await swapLines(1, 2)useSipWebRTCStats()
function useSipWebRTCStats(sessionRef, options): UseSipWebRTCStatsReturn;Defined in: src/composables/useSipWebRTCStats.ts:118
WebRTC Statistics Composable
Collects and analyzes WebRTC statistics from an active call session.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionRef | Ref<CallSession | null> | Ref to CallSession instance |
options | UseSipWebRTCStatsOptions | Configuration options |
Returns
Example
const callSession = useCallSession(sipClient)
const {
stats,
quality,
mosScore,
start,
stop,
onAlert
} = useSipWebRTCStats(callSession.getCurrentSession())
// Start collecting when call is active
watch(() => callSession.callState.value, (state) => {
if (state === 'active') start()
})
// Listen for quality alerts
onAlert((alert) => {
if (alert.severity === 'critical') {
console.warn('Call quality issue:', alert.message)
}
})
// Watch quality level
watch(quality, (q) => {
console.log(`Call quality: ${q}`)
})useTranscription()
function useTranscription(options): UseTranscriptionReturn;Defined in: src/composables/useTranscription.ts:65
Composable for real-time voice transcription
Parameters
| Parameter | Type | Description |
|---|---|---|
options | TranscriptionOptions | Transcription configuration options |
Returns
Transcription state and controls
Example
const {
isTranscribing,
transcript,
start,
stop,
exportTranscript,
} = useTranscription({
provider: 'web-speech',
language: 'en-US',
keywords: [{ phrase: 'help', action: 'assist' }],
onKeywordDetected: (match) => showAssistCard(match.rule.action),
})
// Start transcribing
await start()
// Later, export the transcript
const srt = exportTranscript('srt')useVideoInset()
function useVideoInset(options): UseVideoInsetReturn;Defined in: src/composables/useVideoInset.ts:185
Composable for managing picture-in-picture style video inset layouts
Parameters
| Parameter | Type | Description |
|---|---|---|
options | VideoInsetOptions | Configuration options |
Returns
Video inset controls and state
Description
The Video Inset composable provides a local camera overlay on a remote video stream, commonly used in video calls to show both participants. This creates the classic "picture-in-picture" inset layout within your application.
Features:
- Position control (four corners)
- Size presets (small, medium, large) or custom dimensions
- Video swap (switch which video is main vs inset)
- Optional dragging support
- Preference persistence
Example
<template>
<div class="video-container">
<video ref="mainVideo" :srcObject="isSwapped ? localStream : remoteStream" />
<div v-if="isVisible" :style="insetStyles" class="inset-video">
<video ref="insetVideo" :srcObject="isSwapped ? remoteStream : localStream" />
<button @click="swapVideos">Swap</button>
<button @click="cyclePosition">Move</button>
</div>
</div>
</template>
<script setup>
import { useVideoInset } from 'vuesip'
const {
isVisible,
isSwapped,
insetStyles,
swapVideos,
cyclePosition,
toggle
} = useVideoInset()
</script>createAmiClient()
function createAmiClient(config): AmiClient;Defined in: src/core/AmiClient.ts:1295
Create AMI client instance
Parameters
| Parameter | Type |
|---|---|
config | AmiConfig |
Returns
createVueSip()
function createVueSip(options): Plugin;Defined in: src/index.ts:450
Create VueSip Vue plugin.
This plugin initializes VueSip with global configuration and makes it available throughout your Vue application. It's optional - you can use VueSip composables directly without installing the plugin.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | VueSipOptions | Plugin configuration options |
Returns
Plugin
Vue plugin object
Examples
Basic usage:
import { createApp } from 'vue'
import { createVueSip } from 'vuesip'
const app = createApp(App)
app.use(createVueSip({
debug: true,
logLevel: 'info'
}))With global configuration:
app.use(createVueSip({
debug: import.meta.env.DEV,
logLevel: 'debug',
sipConfig: {
uri: 'wss://sip.example.com',
autoRegister: true
},
mediaConfig: {
audioEnabled: true,
videoEnabled: false
},
userPreferences: {
autoAnswer: false,
recordCalls: false
}
}))Remarks
The plugin performs the following initialization:
- Configures global logging level and debug mode
- Initializes configuration store with provided config
- Sets up global error handling (optional)
- Logs initialization info
createAnalyticsPlugin()
function createAnalyticsPlugin(): AnalyticsPlugin;Defined in: src/plugins/AnalyticsPlugin.ts:2333
Create a new AnalyticsPlugin instance
Factory function that creates and returns a new instance of the AnalyticsPlugin. This is the recommended way to create plugin instances for use with VueSip's plugin system.
Returns
A new AnalyticsPlugin instance with:
- Freshly generated session ID (using crypto.randomUUID())
- Default configuration (can be overridden during installation)
- Empty event queue
- No batch timer (started during installation if batching enabled)
- No registered event listeners (registered during installation)
Remarks
Factory Pattern
This function follows the factory pattern used throughout VueSip plugins:
- Provides consistent interface for plugin creation
- Hides constructor complexity from consumers
- Allows for future initialization logic without API changes
- Makes plugin instantiation explicit and clear
Session ID Generation
Each created instance gets a unique session ID:
- Generated in the constructor during instance creation
- Uses crypto.randomUUID() for cryptographic randomness (if available)
- Falls back to timestamp + random string for compatibility
- Unique per instance (reinstantiation creates new session ID)
- Included in all events tracked by this instance
Instance Independence
Each instance is completely independent:
- Has its own event queue
- Has its own batch timer
- Has its own session ID
- Can be configured differently
- Multiple instances can coexist (though typically only one is needed)
Usage Pattern
The typical usage pattern is:
- Create instance using this factory function
- Register with PluginManager
- PluginManager calls install() with configuration
- Plugin becomes operational and tracks events
Examples
import { createAnalyticsPlugin } from './plugins/AnalyticsPlugin'
const analyticsPlugin = createAnalyticsPlugin()
// Plugin instance created, ready to registerimport { createAnalyticsPlugin } from './plugins/AnalyticsPlugin'
import { PluginManager } from './plugins/PluginManager'
const pluginManager = new PluginManager(eventBus, '1.0.0')
const analyticsPlugin = createAnalyticsPlugin()
await pluginManager.register(analyticsPlugin, {
enabled: true,
endpoint: 'https://analytics.example.com/events',
batchEvents: true,
batchSize: 10
})
// Plugin installed and tracking events// Create two separate analytics instances (unusual but possible)
const productionAnalytics = createAnalyticsPlugin()
const debugAnalytics = createAnalyticsPlugin()
// Each has different configuration and session ID
await pluginManager.register(productionAnalytics, {
endpoint: 'https://analytics.example.com/events',
trackEvents: ['call:*']
})
await pluginManager.register(debugAnalytics, {
endpoint: 'https://debug-analytics.example.com/events',
trackEvents: ['*'] // Track everything for debugging
})createRecordingPlugin()
function createRecordingPlugin(): RecordingPlugin;Defined in: src/plugins/RecordingPlugin.ts:3091
Create recording plugin instance
Returns
Recording plugin
useConfigProvider()
function useConfigProvider(): ConfigProviderContext;Defined in: src/providers/ConfigProvider.ts:317
Type-safe inject helper for ConfigProvider
Returns
Throws
If used outside of ConfigProvider
Example
import { useConfigProvider } from 'vuesip'
const config = useConfigProvider()
console.log(config.sipConfig)useMediaProvider()
function useMediaProvider(): MediaProviderContext;Defined in: src/providers/MediaProvider.ts:482
Type-safe inject helper for MediaProvider
Returns
Throws
If used outside of MediaProvider
Example
import { useMediaProvider } from 'vuesip'
const media = useMediaProvider()
console.log(media.audioInputDevices)useOAuth2Provider()
function useOAuth2Provider(): OAuth2ProviderContext;Defined in: src/providers/OAuth2Provider.ts:412
Composable for consuming OAuth2Provider context
Must be used inside a component that is a child of OAuth2Provider.
Returns
Throws
If used outside of OAuth2Provider
Example
<script setup>
import { useOAuth2Provider } from 'vuesip'
const { isAuthenticated, sipCredentials, login, logout } = useOAuth2Provider()
watchEffect(() => {
if (isAuthenticated.value) {
console.log('Logged in:', sipCredentials.value?.sipUri)
}
})
</script>useOAuth2Credentials()
function useOAuth2Credentials(): Ref<ProvisionedSipCredentials | null>;Defined in: src/providers/OAuth2Provider.ts:427
Inject just the SIP credentials (for use in nested components)
Returns
Ref<ProvisionedSipCredentials | null>
useSipClientProvider()
function useSipClientProvider(): SipClientProviderContext;Defined in: src/providers/SipClientProvider.ts:570
Composable for consuming SipClientProvider context
Must be used inside a component that is a child of SipClientProvider.
Returns
Throws
If used outside of SipClientProvider
Example
<script setup>
import { useSipClientProvider } from 'vuesip'
const { client, eventBus, isReady, connectionState } = useSipClientProvider()
watchEffect(() => {
console.log('Connection state:', connectionState.value)
})
</script>createCredentialStorage()
function createCredentialStorage(type, options): CredentialStorage;Defined in: src/providers/credentialStorage.ts:34
Create a credential storage instance
Parameters
| Parameter | Type | Description |
|---|---|---|
type | StorageType | Storage type ('local', 'session', or 'none') |
options | StorageOptions | Storage configuration options |
Returns
Credential storage interface
registerProvider()
function registerProvider(config, options): void;Defined in: src/providers/providerRegistry.ts:25
Register a provider configuration
Parameters
| Parameter | Type | Description |
|---|---|---|
config | ProviderConfig | Provider configuration to register |
options | ProviderRegisterOptions | Registration options |
Returns
void
Throws
Error if provider ID already exists and force is not true
getProvider()
function getProvider(id): ProviderConfig | undefined;Defined in: src/providers/providerRegistry.ts:37
Get a provider by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Provider ID to lookup |
Returns
ProviderConfig | undefined
Provider configuration or undefined if not found
getAllProviders()
function getAllProviders(): ProviderConfig[];Defined in: src/providers/providerRegistry.ts:45
Get all registered providers
Returns
Array of all registered provider configurations
removeProvider()
function removeProvider(id): boolean;Defined in: src/providers/providerRegistry.ts:54
Remove a provider by ID
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Provider ID to remove |
Returns
boolean
true if provider was removed, false if it didn't exist
resetRegistry()
function resetRegistry(): void;Defined in: src/providers/providerRegistry.ts:62
Reset the registry (clear all providers) Primarily used for testing
Returns
void
useProviderSelector()
function useProviderSelector(options): UseProviderSelectorReturn;Defined in: src/providers/useProviderSelector.ts:86
Provider selector composable
Provides reactive state and methods for managing SIP provider selection, credential handling, validation, and storage persistence.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | ProviderSelectorOptions | Configuration options |
Returns
Provider selector state and methods
Example
<script setup>
import { useProviderSelector } from 'vuesip'
const {
providers,
selectedProvider,
credentials,
isConfigured,
selectProvider,
updateCredential,
saveCredentials,
clearCredentials,
getSipConfig,
} = useProviderSelector({
storage: 'local',
defaultProvider: 'own-pbx'
})
// Select a provider
selectProvider('46elks')
// Update credentials
updateCredential('username', 'myuser')
updateCredential('password', 'secret')
// Get SIP config when configured
if (isConfigured.value) {
const sipConfig = getSipConfig()
// Use sipConfig with useSipClient
}
</script>generatePKCE()
function generatePKCE(): Promise<PKCEParams>;Defined in: src/services/OAuth2Service.ts:60
Generate PKCE parameters (code verifier and challenge)
Returns
Promise<PKCEParams>
generateState()
function generateState(): string;Defined in: src/services/OAuth2Service.ts:73
Generate a random state parameter for CSRF protection
Returns
string
createPersistence()
function createPersistence<T>(options): PersistenceManager<T>;Defined in: src/storage/persistence.ts:213
Create a persistence manager for a store
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
options | PersistenceOptions<T> | Persistence options |
Returns
Persistence manager instance
Example
const persistence = createPersistence({
adapter: new LocalStorageAdapter(),
key: STORAGE_KEYS.USER_PREFERENCES,
getState: () => state.userPreferences,
setState: (prefs) => state.userPreferences = prefs,
watchSource: () => state.userPreferences
})
// Manual operations
await persistence.save()
await persistence.load()
await persistence.clear()
// Cleanup when done
persistence.destroy()initializeStorePersistence()
function initializeStorePersistence(config?): Promise<void>;Defined in: src/stores/persistence.ts:481
Initialize store persistence
Parameters
| Parameter | Type | Description |
|---|---|---|
config? | PersistenceConfig | Persistence configuration |
Returns
Promise<void>
Example
// Initialize with default settings
await initializeStorePersistence()
// Initialize with custom settings
await initializeStorePersistence({
storage: { prefix: 'myapp', version: '2' },
encryptionPassword: 'secure-password',
debounce: 500
})saveAllStores()
function saveAllStores(): Promise<void>;Defined in: src/stores/persistence.ts:488
Save all store states manually
Returns
Promise<void>
loadAllStores()
function loadAllStores(): Promise<void>;Defined in: src/stores/persistence.ts:495
Load all store states manually
Returns
Promise<void>
clearAllStores()
function clearAllStores(): Promise<void>;Defined in: src/stores/persistence.ts:502
Clear all persisted store data
Returns
Promise<void>
destroyStorePersistence()
function destroyStorePersistence(): void;Defined in: src/stores/persistence.ts:509
Destroy store persistence
Returns
void
getStorageQuota()
function getStorageQuota(): Promise<StorageQuotaInfo>;Defined in: src/stores/persistence.ts:516
Get storage quota information
Returns
Promise<StorageQuotaInfo>
getStorageUsageSummary()
function getStorageUsageSummary(): Promise<{
overall: StorageQuotaInfo;
localStorage: {
available: boolean;
estimatedUsage: number;
};
sessionStorage: {
available: boolean;
};
indexedDB: {
available: boolean;
};
}>;Defined in: src/stores/persistence.ts:523
Get comprehensive storage usage summary
Returns
Promise<{ overall: StorageQuotaInfo; localStorage: { available: boolean; estimatedUsage: number; }; sessionStorage: { available: boolean; }; indexedDB: { available: boolean; }; }>
checkStorageWarning()
function checkStorageWarning(threshold): Promise<boolean>;Defined in: src/stores/persistence.ts:532
Check if storage usage is above warning threshold
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
threshold | number | 80 | Warning threshold percentage (default: 80) |
Returns
Promise<boolean>
clearOldCallHistory()
function clearOldCallHistory(targetReduction): Promise<number>;Defined in: src/stores/persistence.ts:541
Clear old call history to free up storage space
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
targetReduction | number | 20 | Percentage of entries to remove (default: 20) |
Returns
Promise<number>
createAbortError()
function createAbortError(message): DOMException;Defined in: src/utils/abortController.ts:11
Create a standard abort error
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
message | string | 'Operation aborted' | Error message |
Returns
DOMException
DOMException with 'AbortError' name
isAbortError()
function isAbortError(error): error is DOMException;Defined in: src/utils/abortController.ts:20
Check if an error is an abort error
Parameters
| Parameter | Type | Description |
|---|---|---|
error | unknown | Error to check |
Returns
error is DOMException
True if error is an AbortError
abortableSleep()
function abortableSleep(ms, signal?): Promise<void>;Defined in: src/utils/abortController.ts:41
Sleep for a duration with abort support
Parameters
| Parameter | Type | Description |
|---|---|---|
ms | number | Milliseconds to sleep |
signal? | AbortSignal | Optional abort signal |
Returns
Promise<void>
Promise that resolves after the duration or rejects if aborted
Example
const controller = new AbortController()
try {
await abortableSleep(1000, controller.signal)
} catch (error) {
if (isAbortError(error)) {
console.log('Sleep was aborted')
}
}throwIfAborted()
function throwIfAborted(signal?): void;Defined in: src/utils/abortController.ts:68
Throw if signal is aborted
Parameters
| Parameter | Type | Description |
|---|---|---|
signal? | AbortSignal | Optional abort signal |
Returns
void
Throws
DOMException if signal is aborted
isCryptoAvailable()
function isCryptoAvailable(): boolean;Defined in: src/utils/encryption.ts:59
Check if Web Crypto API is available
Returns
boolean
True if crypto is available
encrypt()
function encrypt<T>(
data,
password,
options): Promise<EncryptedData>;Defined in: src/utils/encryption.ts:168
Encrypt data using AES-GCM
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
data | T | Data to encrypt (will be JSON.stringified) |
password | string | Password for encryption |
options | Partial<EncryptionOptions> | Encryption options |
Returns
Promise<EncryptedData>
Encrypted data structure
Throws
Error if encryption fails or crypto is not available
decrypt()
function decrypt<T>(encryptedData, password): Promise<T>;Defined in: src/utils/encryption.ts:225
Decrypt data using AES-GCM
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type | Description |
|---|---|---|
encryptedData | EncryptedData | Encrypted data structure |
password | string | Password for decryption |
Returns
Promise<T>
Decrypted data
Throws
Error if decryption fails or crypto is not available
generateEncryptionKey()
function generateEncryptionKey(length): string;Defined in: src/utils/encryption.ts:273
Generate a random encryption key This can be used as a password for encryption/decryption. Store this securely (e.g., in memory or secure storage).
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
length | number | 32 | Key length in bytes (default: 32) |
Returns
string
Random key as base64 string
Throws
Error if crypto is not available
hashPassword()
function hashPassword(password): Promise<string>;Defined in: src/utils/encryption.ts:290
Hash a password using SHA-256 Useful for creating consistent encryption keys from user passwords.
Parameters
| Parameter | Type | Description |
|---|---|---|
password | string | Password to hash |
Returns
Promise<string>
Hashed password as hex string
Throws
Error if crypto is not available
createErrorContext()
function createErrorContext(
operation,
component,
severity,
options): ErrorContext;Defined in: src/utils/errorContext.ts:88
Create a structured error context
Parameters
| Parameter | Type | Description |
|---|---|---|
operation | string | Operation being performed |
component | string | Component or module name |
severity | ErrorSeverity | Error severity level |
options | { context?: Record<string, unknown>; state?: Record<string, unknown>; duration?: number; userId?: string; includeStack?: boolean; } | Additional context options |
options.context? | Record<string, unknown> | - |
options.state? | Record<string, unknown> | - |
options.duration? | number | - |
options.userId? | string | - |
options.includeStack? | boolean | - |
Returns
Structured error context
Example
const ctx = createErrorContext('makeCall', 'useCallSession', ErrorSeverity.HIGH, {
context: { target: 'sip:user@domain.com' },
state: { connectionState: 'connected', hasSession: false },
duration: 1234
})formatError()
function formatError(
message,
error,
context): ErrorLogEntry;Defined in: src/utils/errorContext.ts:136
Format an error with context for logging
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Error message |
error | unknown | Original error object |
context | ErrorContext | Error context |
Returns
Formatted error log entry
Example
const ctx = createErrorContext('makeCall', 'useCallSession', ErrorSeverity.HIGH, {
context: { target: 'sip:user@domain.com' },
state: { isConnected: true }
})
const entry = formatError('Failed to initiate call', error, ctx)
log.error(entry.message, entry.context, entry.error)createOperationTimer()
function createOperationTimer(): object;Defined in: src/utils/errorContext.ts:161
Create an operation timer for tracking duration
Returns
object
Object with elapsed() function
| Name | Type | Defined in |
|---|---|---|
elapsed() | () => number | src/utils/errorContext.ts:161 |
Example
const timer = createOperationTimer()
// ... perform operation ...
const duration = timer.elapsed()
// Use duration in error contextsanitizeContext()
function sanitizeContext(data, seen): Record<string, unknown>;Defined in: src/utils/errorContext.ts:193
Sanitize sensitive data from context
Removes or masks sensitive fields like passwords, tokens, etc. Handles circular references and nested arrays.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | Record<string, unknown> | Data to sanitize |
seen | WeakSet<object> | WeakSet to track visited objects (for circular reference detection) |
Returns
Record<string, unknown>
Sanitized data
Example
const sanitized = sanitizeContext({
username: 'alice',
password: 'secret123',
apiKey: 'key-12345',
users: [{ name: 'bob', password: 'secret456' }]
})
// { username: 'alice', password: '[REDACTED]', apiKey: '[REDACTED]', users: [{ name: 'bob', password: '[REDACTED]' }] }extractErrorInfo()
function extractErrorInfo(error): object;Defined in: src/utils/errorContext.ts:251
Extract relevant error information from various error types
Parameters
| Parameter | Type | Description |
|---|---|---|
error | unknown | Error object (can be Error, DOMException, or unknown) |
Returns
object
Extracted error information
| Name | Type | Defined in |
|---|---|---|
name | string | src/utils/errorContext.ts:252 |
message | string | src/utils/errorContext.ts:253 |
code? | string | number | src/utils/errorContext.ts:254 |
stack? | string | src/utils/errorContext.ts:255 |
Example
const info = extractErrorInfo(error)
// { name: 'TypeError', message: 'Cannot read...', code: undefined, stack: '...' }logErrorWithContext()
function logErrorWithContext(
logger,
message,
error,
operation,
component,
severity,
options): void;Defined in: src/utils/errorContext.ts:322
Log an error with full context
Convenience function that creates context, formats error, and returns a structured log entry ready for logging.
Parameters
| Parameter | Type | Description |
|---|---|---|
logger | { error: (message, ...args) => void; } | Logger instance (must have error method) |
logger.error | (message, ...args) => void | - |
message | string | Error message |
error | unknown | Original error |
operation | string | Operation being performed |
component | string | Component name |
severity | ErrorSeverity | Error severity |
options | { context?: Record<string, unknown>; state?: Record<string, unknown>; duration?: number; userId?: string; includeStack?: boolean; } | Additional context options |
options.context? | Record<string, unknown> | - |
options.state? | Record<string, unknown> | - |
options.duration? | number | - |
options.userId? | string | - |
options.includeStack? | boolean | - |
Returns
void
Example
logErrorWithContext(
log,
'Failed to make call',
error,
'makeCall',
'useCallSession',
ErrorSeverity.HIGH,
{
context: { target: 'sip:user@domain.com' },
state: { isConnected: true },
duration: 1234
}
)formatDuration()
function formatDuration(seconds): string;Defined in: src/utils/formatters.ts:25
Formats a duration in seconds to HH:MM:SS format
Parameters
| Parameter | Type | Description |
|---|---|---|
seconds | number | Duration in seconds |
Returns
string
Formatted duration string
Example
formatDuration(65) // "00:01:05"
formatDuration(3665) // "01:01:05"formatDurationShort()
function formatDurationShort(seconds): string;Defined in: src/utils/formatters.ts:52
Formats a duration in seconds to a short human-readable format
Parameters
| Parameter | Type | Description |
|---|---|---|
seconds | number | Duration in seconds |
Returns
string
Short formatted duration (e.g., "5m 30s", "1h 5m")
Example
formatDurationShort(65) // "1m 5s"
formatDurationShort(3665) // "1h 1m"
formatDurationShort(30) // "30s"formatSipUri()
function formatSipUri(uri, includeScheme): string;Defined in: src/utils/formatters.ts:92
Formats a SIP URI for display
Extracts and formats the display name and user@domain from a SIP URI
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
uri | string | undefined | SIP URI to format |
includeScheme | boolean | false | Whether to include sip: or sips: prefix |
Returns
string
Formatted SIP URI
Example
formatSipUri('sip:alice@example.com') // "alice@example.com"
formatSipUri('sip:alice@example.com', true) // "sip:alice@example.com"
formatSipUri('sips:bob@example.com:5061') // "bob@example.com"parseSipUri()
function parseSipUri(uri): Partial<SipUri> | null;Defined in: src/utils/formatters.ts:129
Parses a SIP URI into its components
Parameters
| Parameter | Type | Description |
|---|---|---|
uri | string | SIP URI to parse |
Returns
Partial<SipUri> | null
Parsed SIP URI object or null if invalid
Example
const parsed = parseSipUri('sips:alice@example.com:5061')
// {
// scheme: 'sips',
// user: 'alice',
// host: 'example.com',
// port: 5061
// }extractDisplayName()
function extractDisplayName(uri): string | null | undefined;Defined in: src/utils/formatters.ts:165
Extracts the display name from a SIP URI
SIP URIs can have a display name before the URI: "Alice Smith" sip:alice@example.com
Parameters
| Parameter | Type | Description |
|---|---|---|
uri | string | SIP URI with optional display name |
Returns
string | null | undefined
Display name or null if not present
Example
extractDisplayName('"Alice Smith" <sip:alice@example.com>') // "Alice Smith"
extractDisplayName('sip:alice@example.com') // nullformatPhoneNumber()
function formatPhoneNumber(number): string;Defined in: src/utils/formatters.ts:199
Formats a phone number for display
Takes an E.164 phone number and formats it for display
Parameters
| Parameter | Type | Description |
|---|---|---|
number | string | E.164 phone number (+country code + number) |
Returns
string
Formatted phone number
Example
formatPhoneNumber('+14155551234') // "+1 (415) 555-1234"
formatPhoneNumber('+442071234567') // "+44 20 7123 4567"formatCallTime()
function formatCallTime(date, now): string;Defined in: src/utils/formatters.ts:249
Formats a date for call history display
Shows relative time for recent calls, absolute date for older calls
Parameters
| Parameter | Type | Description |
|---|---|---|
date | Date | Date to format |
now | Date | Current date (for testing) |
Returns
string
Formatted date string
Example
formatCallTime(new Date()) // "Just now"
formatCallTime(new Date(Date.now() - 60000)) // "1 minute ago"
formatCallTime(new Date(Date.now() - 3600000)) // "1 hour ago"
formatCallTime(new Date('2024-01-01')) // "Jan 1, 2024"formatDateTime()
function formatDateTime(date): string;Defined in: src/utils/formatters.ts:301
Formats a date and time for detailed call history
Parameters
| Parameter | Type | Description |
|---|---|---|
date | Date | Date to format |
Returns
string
Formatted date and time string
Example
formatDateTime(new Date('2024-01-15T14:30:00'))
// "Jan 15, 2024 at 2:30 PM"formatIsoTimestamp()
function formatIsoTimestamp(date): string;Defined in: src/utils/formatters.ts:336
Formats a timestamp to ISO 8601 format
Parameters
| Parameter | Type | Description |
|---|---|---|
date | Date | Date to format |
Returns
string
ISO 8601 formatted string
Example
formatIsoTimestamp(new Date('2024-01-15T14:30:00'))
// "2024-01-15T14:30:00.000Z"formatBytes()
function formatBytes(bytes, decimals): string;Defined in: src/utils/formatters.ts:358
Formats bytes to human-readable size
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
bytes | number | undefined | Number of bytes |
decimals | number | 1 | Number of decimal places |
Returns
string
Formatted size string
Example
formatBytes(1024) // "1 KB"
formatBytes(1536) // "1.5 KB"
formatBytes(1048576) // "1 MB"formatBitrate()
function formatBitrate(bitsPerSecond, decimals): string;Defined in: src/utils/formatters.ts:387
Formats a bitrate to human-readable format
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
bitsPerSecond | number | undefined | Bitrate in bits per second |
decimals | number | 1 | Number of decimal places |
Returns
string
Formatted bitrate string
Example
formatBitrate(128000) // "128 kbps"
formatBitrate(1536000) // "1.5 Mbps"truncate()
function truncate(
str,
maxLength,
ellipsis): string;Defined in: src/utils/formatters.ts:417
Truncates a string to a maximum length with ellipsis
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
str | string | undefined | String to truncate |
maxLength | number | undefined | Maximum length |
ellipsis | string | '...' | Ellipsis string to append |
Returns
string
Truncated string
Example
truncate('This is a long string', 10) // "This is a..."
truncate('Short', 10) // "Short"formatCallStatus()
function formatCallStatus(status): string;Defined in: src/utils/formatters.ts:441
Formats a call status for display
Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Call status |
Returns
string
Human-readable status
Example
formatCallStatus('completed') // "Completed"
formatCallStatus('missed') // "Missed"formatCallDirection()
function formatCallDirection(direction): string;Defined in: src/utils/formatters.ts:466
Formats a call direction for display
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | string | Call direction |
Returns
string
Human-readable direction
Example
formatCallDirection('incoming') // "Incoming"
formatCallDirection('outgoing') // "Outgoing"createLogger()
function createLogger(namespace): Logger;Defined in: src/utils/logger.ts:297
Creates a new logger instance
Parameters
| Parameter | Type | Description |
|---|---|---|
namespace | string | Logger namespace |
Returns
Logger instance
Example
import { createLogger } from './utils/logger'
const logger = createLogger('MyComponent')
logger.info('Component initialized')configureLogger()
function configureLogger(config): void;Defined in: src/utils/logger.ts:317
Configures the global logger
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Partial<LoggerConfig> | Logger configuration |
Returns
void
Example
import { configureLogger } from './utils/logger'
configureLogger({
level: 'debug',
enabled: true,
showTimestamp: true
})getLoggerConfig()
function getLoggerConfig(): Readonly<LoggerConfig>;Defined in: src/utils/logger.ts:329
Gets the current logger configuration
Returns
Readonly<LoggerConfig>
Current logger configuration
enableLogging()
function enableLogging(): void;Defined in: src/utils/logger.ts:336
Enables logging
Returns
void
disableLogging()
function disableLogging(): void;Defined in: src/utils/logger.ts:343
Disables logging
Returns
void
setLogLevel()
function setLogLevel(level): void;Defined in: src/utils/logger.ts:358
Sets the minimum log level
Parameters
| Parameter | Type | Description |
|---|---|---|
level | "error" | "debug" | "info" | "warn" | Minimum log level |
Returns
void
Example
setLogLevel('debug') // Show all logs
setLogLevel('error') // Show only errorsgetLogLevel()
function getLogLevel(): "error" | "debug" | "info" | "warn";Defined in: src/utils/logger.ts:367
Gets the current log level
Returns
"error" | "debug" | "info" | "warn"
Current log level
setLogHandler()
function setLogHandler(handler): void;Defined in: src/utils/logger.ts:389
Sets a custom log handler
Useful for testing or custom log output (e.g., sending to a server)
Parameters
| Parameter | Type | Description |
|---|---|---|
handler | LogHandler | undefined | Custom log handler function |
Returns
void
Example
setLogHandler((level, namespace, message, ...args) => {
// Send to server
fetch('/api/logs', {
method: 'POST',
body: JSON.stringify({ level, namespace, message, args })
})
})validateSipUri()
function validateSipUri(uri): SimpleValidationResult;Defined in: src/utils/validators.ts:47
Validates a SIP URI
Checks if the URI follows the format: sip:user@domain or sips:user@domain Optionally includes port, parameters, and headers.
Parameters
| Parameter | Type | Description |
|---|---|---|
uri | string | The SIP URI to validate |
Returns
SimpleValidationResult
Validation result with normalized URI
Example
const result = validateSipUri('sip:alice@example.com')
if (result.valid) {
console.log('Normalized URI:', result.normalized)
}validatePhoneNumber()
function validatePhoneNumber(number): SimpleValidationResult;Defined in: src/utils/validators.ts:147
Validates a phone number
Checks if the number is in E.164 format: +[country code][number] E.164 format: + followed by country code and subscriber number (max 15 digits)
Parameters
| Parameter | Type | Description |
|---|---|---|
number | string | The phone number to validate |
Returns
SimpleValidationResult
Validation result with normalized number
Example
const result = validatePhoneNumber('+14155551234')
if (result.valid) {
console.log('Valid E.164 number:', result.normalized)
}validateSipConfig()
function validateSipConfig(config): ValidationResult;Defined in: src/utils/validators.ts:201
Validates a SIP client configuration
Checks all required fields and validates their formats.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Partial<SipClientConfig> | The SIP client configuration to validate |
Returns
Validation result
Example
const config: SipClientConfig = {
uri: 'wss://sip.example.com:7443',
sipUri: 'sip:alice@example.com',
password: 'secret'
}
const result = validateSipConfig(config)validateMediaConfig()
function validateMediaConfig(config): ValidationResult;Defined in: src/utils/validators.ts:333
Validates a media configuration
Checks media constraints and device settings.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Partial<MediaConfiguration> | The media configuration to validate |
Returns
Validation result
Example
const config: MediaConfiguration = {
audio: true,
video: false,
echoCancellation: true,
noiseSuppression: true
}
const result = validateMediaConfig(config)validateWebSocketUrl()
function validateWebSocketUrl(url): SimpleValidationResult;Defined in: src/utils/validators.ts:409
Validates a WebSocket URL
Checks if the URL is a valid WebSocket URL (ws:// or wss://)
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | The WebSocket URL to validate |
Returns
SimpleValidationResult
Validation result
Example
const result = validateWebSocketUrl('wss://sip.example.com:7443')validateDtmfTone()
function validateDtmfTone(tone): SimpleValidationResult;Defined in: src/utils/validators.ts:483
Validates a DTMF tone
Checks if the tone is a valid DTMF character (0-9, *, #, A-D)
Parameters
| Parameter | Type | Description |
|---|---|---|
tone | string | The DTMF tone to validate |
Returns
SimpleValidationResult
Validation result
Example
const result = validateDtmfTone('1')validateDtmfSequence()
function validateDtmfSequence(sequence): SimpleValidationResult;Defined in: src/utils/validators.ts:548
Validates a DTMF tone sequence
Checks if all tones in the sequence are valid
Parameters
| Parameter | Type | Description |
|---|---|---|
sequence | string | The DTMF sequence to validate |
Returns
SimpleValidationResult
Validation result
Example
const result = validateDtmfSequence('1234*#')