Skip to content

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

typescript
// 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')
html
<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>
html
<template>
  <!-- Using providers for global state -->
  <SipClientProvider :config="sipConfig">
    <MediaProvider :auto-enumerate="true">
      <YourApp />
    </MediaProvider>
  </SipClientProvider>
</template>

Remarks

Documentation

For developers maintaining this library, see the /docs/developer/typedoc-setup.md | TypeDoc Setup Guide for information about generating and maintaining API documentation.

Modules

ModuleDescription
<internal>-

Enumerations

AmiErrorCode

Defined in: src/core/AmiClient.ts:44

AMI Error codes for categorizing errors

Enumeration Members

Enumeration MemberValueDefined 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 MemberValueDescriptionDefined in
Idle"idle"No active callsrc/types/call.types.ts:13
Calling"calling"Outgoing call initiatedsrc/types/call.types.ts:15
Ringing"ringing"Incoming call ringingsrc/types/call.types.ts:17
Answering"answering"Call is being answeredsrc/types/call.types.ts:19
EarlyMedia"early_media"Call is in early media statesrc/types/call.types.ts:21
Active"active"Call is activesrc/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 terminatingsrc/types/call.types.ts:29
Terminated"terminated"Call has endedsrc/types/call.types.ts:31
Failed"failed"Call failedsrc/types/call.types.ts:33

CallDirection

Defined in: src/types/call.types.ts:39

Call direction

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Outgoing"outgoing"Outgoing callsrc/types/call.types.ts:41
Incoming"incoming"Incoming callsrc/types/call.types.ts:43

TerminationCause

Defined in: src/types/call.types.ts:49

Call termination cause

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Canceled"canceled"Call was canceledsrc/types/call.types.ts:51
Rejected"rejected"Call was rejectedsrc/types/call.types.ts:53
NoAnswer"no_answer"Call was not answeredsrc/types/call.types.ts:55
Unavailable"unavailable"Call was unavailablesrc/types/call.types.ts:57
Busy"busy"Call was busysrc/types/call.types.ts:59
Bye"bye"Normal call clearingsrc/types/call.types.ts:61
RequestTimeout"request_timeout"Request timeoutsrc/types/call.types.ts:63
WebRtcError"webrtc_error"WebRTC errorsrc/types/call.types.ts:65
InternalError"internal_error"Internal errorsrc/types/call.types.ts:67
NetworkError"network_error"Network errorsrc/types/call.types.ts:69
Other"other"Other reasonsrc/types/call.types.ts:71

HoldState

Defined in: src/types/call.types.ts:349

Hold state enumeration

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Active"active"Call is active (not on hold)src/types/call.types.ts:351
Holding"holding"Local hold in progresssrc/types/call.types.ts:353
Held"held"Call is on hold (local)src/types/call.types.ts:355
Resuming"resuming"Resume in progresssrc/types/call.types.ts:357
RemoteHeld"remote_held"Remote party has placed call on holdsrc/types/call.types.ts:359

ConferenceState

Defined in: src/types/conference.types.ts:9

Conference state enumeration

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Idle"idle"Conference not startedsrc/types/conference.types.ts:11
Creating"creating"Conference is being createdsrc/types/conference.types.ts:13
Active"active"Conference is activesrc/types/conference.types.ts:15
OnHold"on_hold"Conference is on holdsrc/types/conference.types.ts:17
Ending"ending"Conference is endingsrc/types/conference.types.ts:19
Ended"ended"Conference has endedsrc/types/conference.types.ts:21
Failed"failed"Conference failedsrc/types/conference.types.ts:23

ParticipantState

Defined in: src/types/conference.types.ts:29

Participant state

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Connecting"connecting"Participant is connectingsrc/types/conference.types.ts:31
Connected"connected"Participant is connectedsrc/types/conference.types.ts:33
OnHold"on_hold"Participant is on holdsrc/types/conference.types.ts:35
Muted"muted"Participant is mutedsrc/types/conference.types.ts:37
Disconnected"disconnected"Participant is disconnectedsrc/types/conference.types.ts:39

HistoryExportFormat

Defined in: src/types/history.types.ts:83

History export format

Enumeration Members

Enumeration MemberValueDescriptionDefined in
JSON"json"JSON formatsrc/types/history.types.ts:85
CSV"csv"CSV formatsrc/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 MemberValueDefined 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 MemberValueDescriptionDefined in
Granted"granted"Permission grantedsrc/types/media.types.ts:43
Denied"denied"Permission deniedsrc/types/media.types.ts:45
Prompt"prompt"Permission promptsrc/types/media.types.ts:47
NotRequested"not_requested"Permission not requestedsrc/types/media.types.ts:49

RecordingState

Defined in: src/types/media.types.ts:169

Recording state

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Inactive"inactive"Not recordingsrc/types/media.types.ts:171
Recording"recording"Recording in progresssrc/types/media.types.ts:173
Paused"paused"Recording pausedsrc/types/media.types.ts:175
Stopped"stopped"Recording stoppedsrc/types/media.types.ts:177
Error"error"Recording errorsrc/types/media.types.ts:179

MessageStatus

Defined in: src/types/messaging.types.ts:9

Message status enumeration

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Pending"pending"Message is pendingsrc/types/messaging.types.ts:11
Sending"sending"Message is being sentsrc/types/messaging.types.ts:13
Sent"sent"Message was sent successfullysrc/types/messaging.types.ts:15
Delivered"delivered"Message was deliveredsrc/types/messaging.types.ts:17
Read"read"Message was readsrc/types/messaging.types.ts:19
Failed"failed"Message failed to sendsrc/types/messaging.types.ts:21

MessageDirection

Defined in: src/types/messaging.types.ts:27

Message direction

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Incoming"incoming"Incoming messagesrc/types/messaging.types.ts:29
Outgoing"outgoing"Outgoing messagesrc/types/messaging.types.ts:31

MessageContentType

Defined in: src/types/messaging.types.ts:37

Message content type

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Text"text/plain"Plain textsrc/types/messaging.types.ts:39
HTML"text/html"HTML contentsrc/types/messaging.types.ts:41
JSON"application/json"JSON datasrc/types/messaging.types.ts:43
Custom"custom"Custom content typesrc/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 MemberValueDescriptionDefined in
Highest1000Runs firstsrc/types/plugin.types.ts:26
High500Runs before normalsrc/types/plugin.types.ts:28
Normal0Default prioritysrc/types/plugin.types.ts:30
Low-500Runs after normalsrc/types/plugin.types.ts:32
Lowest-1000Runs lastsrc/types/plugin.types.ts:34

PluginState

Defined in: src/types/plugin.types.ts:258

Plugin registration state

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Registered"registered"Plugin is registered but not installedsrc/types/plugin.types.ts:260
Installing"installing"Plugin is being installedsrc/types/plugin.types.ts:262
Installed"installed"Plugin is installed and activesrc/types/plugin.types.ts:264
Uninstalling"uninstalling"Plugin is being uninstalledsrc/types/plugin.types.ts:266
Failed"failed"Plugin installation failedsrc/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 MemberValueDescriptionDefined in
Idle"idle"Extension is idle/availablesrc/types/presence.types.ts:11
Ringing"ringing"Extension is ringingsrc/types/presence.types.ts:13
Trying"trying"Extension is trying to connectsrc/types/presence.types.ts:15
InCall"in-call"Extension is in a callsrc/types/presence.types.ts:17
OnHold"on-hold"Extension is on holdsrc/types/presence.types.ts:19
Confirmed"confirmed"Extension is confirmed in a dialogsrc/types/presence.types.ts:21
Unavailable"unavailable"Extension is unavailablesrc/types/presence.types.ts:23
Unknown"unknown"Unknown statesrc/types/presence.types.ts:25

PresenceState

Defined in: src/types/presence.types.ts:193

Presence state enumeration

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Available"available"User is online and availablesrc/types/presence.types.ts:195
Away"away"User is awaysrc/types/presence.types.ts:197
Busy"busy"User is busy / do not disturbsrc/types/presence.types.ts:199
Offline"offline"User is offlinesrc/types/presence.types.ts:201
Custom"custom"Custom statussrc/types/presence.types.ts:203

RegistrationState

Defined in: src/types/sip.types.ts:36

Registration state for the SIP client

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Unregistered"unregistered"Not registeredsrc/types/sip.types.ts:38
Registering"registering"Registration in progresssrc/types/sip.types.ts:40
Registered"registered"Successfully registeredsrc/types/sip.types.ts:42
RegistrationFailed"registration_failed"Registration failedsrc/types/sip.types.ts:44
Unregistering"unregistering"Unregistration in progresssrc/types/sip.types.ts:46

ConnectionState

Defined in: src/types/sip.types.ts:52

Connection state for the WebSocket transport

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Disconnected"disconnected"Disconnected from serversrc/types/sip.types.ts:54
Connecting"connecting"Connecting to serversrc/types/sip.types.ts:56
Connected"connected"Connected to serversrc/types/sip.types.ts:58
ConnectionFailed"connection_failed"Connection failedsrc/types/sip.types.ts:60
Error"error"Connection errorsrc/types/sip.types.ts:62
Reconnecting"reconnecting"Reconnecting to serversrc/types/sip.types.ts:64

SipMethod

Defined in: src/types/sip.types.ts:70

SIP methods as defined in RFC 3261

Enumeration Members

Enumeration MemberValueDefined 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

Enumeration MemberValueDefined in
Trying100src/types/sip.types.ts:92
Ringing180src/types/sip.types.ts:93
CallIsBeingForwarded181src/types/sip.types.ts:94
Queued182src/types/sip.types.ts:95
SessionProgress183src/types/sip.types.ts:96
OK200src/types/sip.types.ts:99
Accepted202src/types/sip.types.ts:100
MultipleChoices300src/types/sip.types.ts:103
MovedPermanently301src/types/sip.types.ts:104
MovedTemporarily302src/types/sip.types.ts:105
UseProxy305src/types/sip.types.ts:106
AlternativeService380src/types/sip.types.ts:107
BadRequest400src/types/sip.types.ts:110
Unauthorized401src/types/sip.types.ts:111
PaymentRequired402src/types/sip.types.ts:112
Forbidden403src/types/sip.types.ts:113
NotFound404src/types/sip.types.ts:114
MethodNotAllowed405src/types/sip.types.ts:115
NotAcceptable406src/types/sip.types.ts:116
ProxyAuthenticationRequired407src/types/sip.types.ts:117
RequestTimeout408src/types/sip.types.ts:118
Gone410src/types/sip.types.ts:119
RequestEntityTooLarge413src/types/sip.types.ts:120
RequestURITooLong414src/types/sip.types.ts:121
UnsupportedMediaType415src/types/sip.types.ts:122
UnsupportedURIScheme416src/types/sip.types.ts:123
BadExtension420src/types/sip.types.ts:124
ExtensionRequired421src/types/sip.types.ts:125
IntervalTooBrief423src/types/sip.types.ts:126
TemporarilyUnavailable480src/types/sip.types.ts:127
CallTransactionDoesNotExist481src/types/sip.types.ts:128
LoopDetected482src/types/sip.types.ts:129
TooManyHops483src/types/sip.types.ts:130
AddressIncomplete484src/types/sip.types.ts:131
Ambiguous485src/types/sip.types.ts:132
BusyHere486src/types/sip.types.ts:133
RequestTerminated487src/types/sip.types.ts:134
NotAcceptableHere488src/types/sip.types.ts:135
RequestPending491src/types/sip.types.ts:136
Undecipherable493src/types/sip.types.ts:137
ServerInternalError500src/types/sip.types.ts:140
NotImplemented501src/types/sip.types.ts:141
BadGateway502src/types/sip.types.ts:142
ServiceUnavailable503src/types/sip.types.ts:143
ServerTimeout504src/types/sip.types.ts:144
VersionNotSupported505src/types/sip.types.ts:145
MessageTooLarge513src/types/sip.types.ts:146
BusyEverywhere600src/types/sip.types.ts:149
Decline603src/types/sip.types.ts:150
DoesNotExistAnywhere604src/types/sip.types.ts:151
NotAcceptableAnywhere606src/types/sip.types.ts:152

TransferState

Defined in: src/types/transfer.types.ts:9

Transfer state enumeration

Enumeration Members

Enumeration MemberValueDescriptionDefined in
Idle"idle"No active transfersrc/types/transfer.types.ts:11
Initiated"initiated"Transfer initiatedsrc/types/transfer.types.ts:13
InProgress"in_progress"Transfer in progresssrc/types/transfer.types.ts:15
Accepted"accepted"Transfer acceptedsrc/types/transfer.types.ts:17
Completed"completed"Transfer completedsrc/types/transfer.types.ts:19
Failed"failed"Transfer failedsrc/types/transfer.types.ts:21
Canceled"canceled"Transfer canceledsrc/types/transfer.types.ts:23

TransferType

Defined in: src/types/transfer.types.ts:29

Transfer type

Enumeration Members

Enumeration MemberValueDescriptionDefined 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 MemberValueDefined 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
ts
new AmiError(
   message, 
   code, 
   details?): AmiError;

Defined in: src/core/AmiClient.ts:62

Parameters
ParameterType
messagestring
codeAmiErrorCode
details?Record<string, unknown>
Returns

AmiError

Overrides
ts
Error.constructor

Properties

PropertyTypeDefined in
codeAmiErrorCodesrc/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

typescript
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
ts
new AmiClient(config): AmiClient;

Defined in: src/core/AmiClient.ts:117

Parameters
ParameterType
configAmiConfig
Returns

AmiClient

Accessors

isConnected
Get Signature
ts
get isConnected(): boolean;

Defined in: src/core/AmiClient.ts:285

Check if connected

Returns

boolean

Methods

connect()
ts
connect(): Promise<void>;

Defined in: src/core/AmiClient.ts:134

Connect to amiws WebSocket proxy

Returns

Promise<void>

disconnect()
ts
disconnect(): void;

Defined in: src/core/AmiClient.ts:244

Disconnect from amiws

Returns

void

getState()
ts
getState(): AmiConnectionState;

Defined in: src/core/AmiClient.ts:278

Get current connection state

Returns

AmiConnectionState

sendAction()
ts
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 ParameterDefault type
T extends AmiResponseDataAmiResponseData
Parameters
ParameterTypeDefault value
actionAmiActionundefined
timeoutnumber10000
Returns

Promise<AmiMessage<T>>

getPresenceState()
ts
getPresenceState(extension, provider): Promise<{
  state: string;
  subtype?: string;
  message?: string;
}>;

Defined in: src/core/AmiClient.ts:346

Get presence state for an extension

Parameters
ParameterTypeDefault valueDescription
extensionstringundefinedExtension number (e.g., '1000')
providerstring'CustomPresence'Presence provider (default: 'CustomPresence')
Returns

Promise<{ state: string; subtype?: string; message?: string; }>

Presence state info

setPresenceState()
ts
setPresenceState(
   extension, 
   state, 
options?): Promise<void>;

Defined in: src/core/AmiClient.ts:373

Set presence state for an extension (requires appropriate AMI permissions)

Parameters
ParameterTypeDescription
extensionstringExtension number
statestringNew presence state
options?{ subtype?: string; message?: string; }Additional options (subtype, message)
options.subtype?string-
options.message?string-
Returns

Promise<void>

getExtensionStatus()
ts
getExtensionStatus(extension, context): Promise<{
  status: number;
  statusText: string;
}>;

Defined in: src/core/AmiClient.ts:397

Get extension status (device state)

Parameters
ParameterTypeDefault valueDescription
extensionstringundefinedExtension number
contextstring'ext-local'Dialplan context (default: 'ext-local')
Returns

Promise<{ status: number; statusText: string; }>

subscribePresence()
ts
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
ParameterTypeDescription
extensionstringExtension number
Returns

Promise<void>

rawCommand()
ts
rawCommand(command): Promise<AmiMessage<AmiResponseData>>;

Defined in: src/core/AmiClient.ts:435

Send a raw AMI command (for advanced usage)

Parameters
ParameterType
commandstring
Returns

Promise<AmiMessage<AmiResponseData>>

getQueueStatus()
ts
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
ParameterTypeDefault valueDescription
queue?stringundefinedOptional queue name to filter (undefined = all queues)
timeout?number30000Timeout in ms (default: 30000)
Returns

Promise<QueueInfo[]>

getQueueSummary()
ts
getQueueSummary(queue?, timeout?): Promise<QueueSummary[]>;

Defined in: src/core/AmiClient.ts:545

Get queue summary (quick overview)

Parameters
ParameterTypeDefault valueDescription
queue?stringundefinedOptional queue name
timeout?number10000-
Returns

Promise<QueueSummary[]>

queueAdd()
ts
queueAdd(
   queue, 
   iface, 
options?): Promise<void>;

Defined in: src/core/AmiClient.ts:593

Add a member to a queue

Parameters
ParameterType
queuestring
ifacestring
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()
ts
queueRemove(queue, iface): Promise<void>;

Defined in: src/core/AmiClient.ts:621

Remove a member from a queue

Parameters
ParameterType
queuestring
ifacestring
Returns

Promise<void>

queuePause()
ts
queuePause(
   queue, 
   iface, 
   paused, 
reason?): Promise<void>;

Defined in: src/core/AmiClient.ts:636

Pause/unpause a queue member

Parameters
ParameterType
queuestring
ifacestring
pausedboolean
reason?string
Returns

Promise<void>

queuePenalty()
ts
queuePenalty(
   queue, 
   iface, 
penalty): Promise<void>;

Defined in: src/core/AmiClient.ts:653

Set penalty for queue member

Parameters
ParameterType
queuestring
ifacestring
penaltynumber
Returns

Promise<void>

getChannels()
ts
getChannels(timeout): Promise<ChannelInfo[]>;

Defined in: src/core/AmiClient.ts:673

Get all active channels

Parameters
ParameterTypeDefault value
timeoutnumber30000
Returns

Promise<ChannelInfo[]>

originate()
ts
originate(options): Promise<OriginateResult>;

Defined in: src/core/AmiClient.ts:711

Originate a call

Parameters
ParameterTypeDescription
optionsOriginateOptionsOriginate options
Returns

Promise<OriginateResult>

hangupChannel()
ts
hangupChannel(channel, cause?): Promise<void>;

Defined in: src/core/AmiClient.ts:763

Hangup a channel

Parameters
ParameterType
channelstring
cause?number
Returns

Promise<void>

redirectChannel()
ts
redirectChannel(
   channel, 
   context, 
   exten, 
priority): Promise<void>;

Defined in: src/core/AmiClient.ts:778

Redirect a channel (transfer)

Parameters
ParameterTypeDefault value
channelstringundefined
contextstringundefined
extenstringundefined
prioritynumber1
Returns

Promise<void>

getSipPeers()
ts
getSipPeers(timeout): Promise<PeerInfo[]>;

Defined in: src/core/AmiClient.ts:804

Get SIP peers

Parameters
ParameterTypeDefault value
timeoutnumber30000
Returns

Promise<PeerInfo[]>

getPjsipEndpoints()
ts
getPjsipEndpoints(timeout): Promise<PeerInfo[]>;

Defined in: src/core/AmiClient.ts:840

Get PJSIP endpoints

Parameters
ParameterTypeDefault value
timeoutnumber30000
Returns

Promise<PeerInfo[]>

getAllPeers()
ts
getAllPeers(): Promise<PeerInfo[]>;

Defined in: src/core/AmiClient.ts:891

Get all peers (both SIP and PJSIP)

Returns

Promise<PeerInfo[]>

dbGet()
ts
dbGet(family, key): Promise<string | null>;

Defined in: src/core/AmiClient.ts:914

Get a value from AstDB

Parameters
ParameterType
familystring
keystring
Returns

Promise<string | null>

dbPut()
ts
dbPut(
   family, 
   key, 
value): Promise<void>;

Defined in: src/core/AmiClient.ts:934

Put a value into AstDB

Parameters
ParameterType
familystring
keystring
valuestring
Returns

Promise<void>

dbDel()
ts
dbDel(family, key): Promise<void>;

Defined in: src/core/AmiClient.ts:950

Delete a value from AstDB

Parameters
ParameterType
familystring
keystring
Returns

Promise<void>

dbDelTree()
ts
dbDelTree(family, key?): Promise<void>;

Defined in: src/core/AmiClient.ts:965

Delete a tree from AstDB

Parameters
ParameterType
familystring
key?string
Returns

Promise<void>

dbGetKeys()
ts
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
ParameterTypeDefault value
_familystringundefined
_prefixstring''
Returns

Promise<string[]>

on()
ts
on<K>(event, listener): void;

Defined in: src/core/AmiClient.ts:1001

Register event listener

Type Parameters
Type Parameter
K extends keyof AmiClientEvents
Parameters
ParameterType
eventK
listenerAmiClientEvents[K]
Returns

void

off()
ts
off<K>(event, listener): void;

Defined in: src/core/AmiClient.ts:1014

Remove event listener

Type Parameters
Type Parameter
K extends keyof AmiClientEvents
Parameters
ParameterType
eventK
listenerAmiClientEvents[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

ts
const session = new CallSession(options)
await session.answer()
await session.hangup()

Extends

Constructors

Constructor
ts
new CallSession(options): CallSession;

Defined in: src/core/CallSession.ts:137

Parameters
ParameterType
optionsCallSessionOptions
Returns

CallSession

Overrides

EventEmitter.constructor

Properties

PropertyModifierTypeInherited fromDefined in
listenersprotectedMap<string, Set<EventHandler<unknown>>>EventEmitter.listenerssrc/utils/EventEmitter.ts:16

Accessors

id
Get Signature
ts
get id(): string;

Defined in: src/core/CallSession.ts:167

Returns

string

state
Get Signature
ts
get state(): CallState;

Defined in: src/core/CallSession.ts:171

Returns

CallState

direction
Get Signature
ts
get direction(): CallDirection;

Defined in: src/core/CallSession.ts:175

Returns

CallDirection

eventBus
Get Signature
ts
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

EventBus

localUri
Get Signature
ts
get localUri(): string;

Defined in: src/core/CallSession.ts:187

Returns

string

remoteUri
Get Signature
ts
get remoteUri(): string;

Defined in: src/core/CallSession.ts:191

Returns

string

remoteDisplayName
Get Signature
ts
get remoteDisplayName(): string | undefined;

Defined in: src/core/CallSession.ts:195

Returns

string | undefined

localStream
Get Signature
ts
get localStream(): MediaStream | undefined;

Defined in: src/core/CallSession.ts:199

Returns

MediaStream | undefined

remoteStream
Get Signature
ts
get remoteStream(): MediaStream | undefined;

Defined in: src/core/CallSession.ts:203

Returns

MediaStream | undefined

isOnHold
Get Signature
ts
get isOnHold(): boolean;

Defined in: src/core/CallSession.ts:207

Returns

boolean

isMuted
Get Signature
ts
get isMuted(): boolean;

Defined in: src/core/CallSession.ts:211

Returns

boolean

hasRemoteVideo
Get Signature
ts
get hasRemoteVideo(): boolean;

Defined in: src/core/CallSession.ts:215

Returns

boolean

hasLocalVideo
Get Signature
ts
get hasLocalVideo(): boolean;

Defined in: src/core/CallSession.ts:219

Returns

boolean

timing
Get Signature
ts
get timing(): Readonly<CallTimingInfo>;

Defined in: src/core/CallSession.ts:223

Returns

Readonly<CallTimingInfo>

terminationCause
Get Signature
ts
get terminationCause(): TerminationCause | undefined;

Defined in: src/core/CallSession.ts:227

Returns

TerminationCause | undefined

data
Get Signature
ts
get data(): Record<string, any>;

Defined in: src/core/CallSession.ts:231

Returns

Record<string, any>

connection
Get Signature
ts
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()
ts
toInterface(): CallSession;

Defined in: src/core/CallSession.ts:246

Get the current call session as an interface

Returns

CallSession

answer()
ts
answer(options?): Promise<void>;

Defined in: src/core/CallSession.ts:278

Answer an incoming call

Implements incoming call flow:

  1. Validate call state
  2. Get local media stream
  3. Create answer SDP
  4. Send 200 OK with SDP
  5. Wait for ACK
  6. Establish media flow
  7. Transition to active state
Parameters
ParameterType
options?AnswerOptions
Returns

Promise<void>

reject()
ts
reject(statusCode): Promise<void>;

Defined in: src/core/CallSession.ts:337

Reject an incoming call

Parameters
ParameterTypeDefault valueDescription
statusCodenumber603SIP status code (default: 603 Decline) - 486: Busy Here - 603: Decline - 480: Temporarily Unavailable
Returns

Promise<void>

hangup()
ts
hangup(): Promise<void>;

Defined in: src/core/CallSession.ts:395

Terminate the call

Implements call termination flow:

  1. Validate call state
  2. Send BYE request (or CANCEL for early states)
  3. Stop media streams
  4. Close peer connection
  5. Update call state
  6. Emit termination event
  7. Clean up resources
Returns

Promise<void>

terminate()
ts
terminate(): Promise<void>;

Defined in: src/core/CallSession.ts:427

Terminate the call (alias for hangup)

Returns

Promise<void>

hold()
ts
hold(): Promise<void>;

Defined in: src/core/CallSession.ts:434

Put call on hold

Returns

Promise<void>

unhold()
ts
unhold(): Promise<void>;

Defined in: src/core/CallSession.ts:479

Resume call from hold

Returns

Promise<void>

mute()
ts
mute(): void;

Defined in: src/core/CallSession.ts:520

Mute local audio

Returns

void

unmute()
ts
unmute(): void;

Defined in: src/core/CallSession.ts:543

Unmute local audio

Returns

void

disableVideo()
ts
disableVideo(): void;

Defined in: src/core/CallSession.ts:566

Disable local video

Returns

void

enableVideo()
ts
enableVideo(): void;

Defined in: src/core/CallSession.ts:583

Enable local video

Returns

void

sendDTMF()
ts
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
ParameterTypeDescription
tonestringSingle tone (0-9, *, #, A-D) or sequence of tones (e.g., "123#")
options?DTMFOptionsDTMF options for duration, gap, and transport
Returns

void

clearDTMFQueue()
ts
clearDTMFQueue(): void;

Defined in: src/core/CallSession.ts:679

Clear DTMF queue

Returns

void

transfer()
ts
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
ParameterTypeDescription
targetUristringTarget SIP URI to transfer to
extraHeaders?string[]Optional SIP headers
Returns

Promise<void>

attendedTransfer()
ts
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
ParameterTypeDescription
targetUristringTarget SIP URI
replaceCallIdstringCall ID of the consultation call to replace
Returns

Promise<void>

getStats()
ts
getStats(): Promise<CallStatistics>;

Defined in: src/core/CallSession.ts:770

Get call statistics

Returns

Promise<CallStatistics>

destroy()
ts
destroy(): void;

Defined in: src/core/CallSession.ts:1209

Destroy the call session

Returns

void

on()
ts
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
ParameterTypeDescription
eventKEvent name
handlerEventHandler<CallSessionEvents[K]>Event handler function
Returns

Unsubscribe function

ts
(): void;
Returns

void

Inherited from

EventEmitter.on

once()
ts
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
ParameterTypeDescription
eventKEvent name
handlerEventHandler<CallSessionEvents[K]>Event handler function
Returns

Unsubscribe function

ts
(): void;
Returns

void

Inherited from

EventEmitter.once

off()
ts
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
ParameterTypeDescription
eventKEvent name
handler?EventHandler<CallSessionEvents[K]>Event handler function to remove (optional - removes all if not specified)
Returns

void

Inherited from

EventEmitter.off

emit()
ts
emit<K>(event, data): void;

Defined in: src/utils/EventEmitter.ts:93

Emit an event

Type Parameters
Type Parameter
K extends keyof CallSessionEvents
Parameters
ParameterTypeDescription
eventKEvent name
dataCallSessionEvents[K]Event data
Returns

void

Inherited from

EventEmitter.emit

removeAllListeners()
ts
removeAllListeners(): void;

Defined in: src/utils/EventEmitter.ts:112

Remove all event listeners

Returns

void

Inherited from

EventEmitter.removeAllListeners

listenerCount()
ts
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
ParameterTypeDescription
eventKEvent name
Returns

number

Number of listeners

Inherited from

EventEmitter.listenerCount

eventNames()
ts
eventNames(): string[];

Defined in: src/utils/EventEmitter.ts:133

Get all event names that have listeners

Returns

string[]

Array of event names

Inherited from

EventEmitter.eventNames


EventBus

Defined in: src/core/EventBus.ts:29

Type-safe Event Bus for managing application events

Constructors

Constructor
ts
new EventBus(): EventBus;
Returns

EventBus

Methods

on()
ts
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
ParameterType
eventWildcardPattern | K
handlerEventHandler<EventMap[K]>
optionsEventListenerOptions
Returns

string

once()
ts
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
ParameterType
eventWildcardPattern | K
handlerEventHandler<EventMap[K]>
Returns

string

off()
ts
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
ParameterType
eventWildcardPattern | K
handlerOrId| string | EventHandler<EventMap[K]>
Returns

boolean

removeById()
ts
removeById(id): boolean;

Defined in: src/core/EventBus.ts:152

Remove an event listener by ID (across all events)

Parameters
ParameterType
idstring
Returns

boolean

emit()
ts
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
ParameterType
eventK
dataEventMap[K]
Returns

Promise<void>

emitSync()
ts
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
ParameterType
eventK
dataEventMap[K]
Returns

void

removeAllListeners()
ts
removeAllListeners(event?): void;

Defined in: src/core/EventBus.ts:250

Remove all listeners for an event or all events

Parameters
ParameterType
event?string | number
Returns

void

waitFor()
ts
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
ParameterType
eventK
timeout?number
Returns

Promise<EventMap[K]>

listenerCount()
ts
listenerCount(event): number;

Defined in: src/core/EventBus.ts:325

Get the number of listeners for an event

Parameters
ParameterType
eventstring | number
Returns

number

eventNames()
ts
eventNames(): string[];

Defined in: src/core/EventBus.ts:334

Get all event names that have listeners

Returns

string[]

hasListeners()
ts
hasListeners(event): boolean;

Defined in: src/core/EventBus.ts:341

Check if there are any listeners for an event

Parameters
ParameterType
eventstring | number
Returns

boolean

setBufferingEnabled()
ts
setBufferingEnabled(enabled): void;

Defined in: src/core/EventBus.ts:348

Enable or disable event buffering

Parameters
ParameterType
enabledboolean
Returns

void

destroy()
ts
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

ts
const mediaManager = new MediaManager({ eventBus })
await mediaManager.enumerateDevices()
const stream = await mediaManager.getUserMedia({ audio: true, video: false })

Constructors

Constructor
ts
new MediaManager(options): MediaManager;

Defined in: src/core/MediaManager.ts:174

Parameters
ParameterType
optionsMediaManagerOptions
Returns

MediaManager

Methods

createPeerConnection()
ts
createPeerConnection(): RTCPeerConnection;

Defined in: src/core/MediaManager.ts:194

Create RTCPeerConnection

Returns

RTCPeerConnection

getPeerConnection()
ts
getPeerConnection(): RTCPeerConnection;

Defined in: src/core/MediaManager.ts:216

Get existing peer connection or create new one

Returns

RTCPeerConnection

closePeerConnection()
ts
closePeerConnection(): void;

Defined in: src/core/MediaManager.ts:226

Close peer connection

Returns

void

createOffer()
ts
createOffer(options?): Promise<RTCSessionDescriptionInit>;

Defined in: src/core/MediaManager.ts:415

Create SDP offer

Parameters
ParameterType
options?RTCOfferOptions
Returns

Promise<RTCSessionDescriptionInit>

createAnswer()
ts
createAnswer(options?): Promise<RTCSessionDescriptionInit>;

Defined in: src/core/MediaManager.ts:436

Create SDP answer

Parameters
ParameterType
options?RTCAnswerOptions
Returns

Promise<RTCSessionDescriptionInit>

setLocalDescription()
ts
setLocalDescription(description): Promise<void>;

Defined in: src/core/MediaManager.ts:457

Set local description

Parameters
ParameterType
descriptionRTCSessionDescriptionInit
Returns

Promise<void>

setRemoteDescription()
ts
setRemoteDescription(description): Promise<void>;

Defined in: src/core/MediaManager.ts:479

Set remote description

Parameters
ParameterType
descriptionRTCSessionDescriptionInit
Returns

Promise<void>

addIceCandidate()
ts
addIceCandidate(candidate): Promise<void>;

Defined in: src/core/MediaManager.ts:498

Add ICE candidate

Parameters
ParameterType
candidateRTCIceCandidateInit
Returns

Promise<void>

waitForIceGathering()
ts
waitForIceGathering(): Promise<void>;

Defined in: src/core/MediaManager.ts:537

Wait for ICE gathering to complete

Returns

Promise<void>

getUserMedia()
ts
getUserMedia(constraints?): Promise<MediaStream>;

Defined in: src/core/MediaManager.ts:565

Get user media (local stream)

Parameters
ParameterType
constraints?ExtendedMediaStreamConstraints
Returns

Promise<MediaStream>

addLocalStream()
ts
addLocalStream(stream): RTCRtpSender[];

Defined in: src/core/MediaManager.ts:653

Add local stream to peer connection

Parameters
ParameterType
streamMediaStream
Returns

RTCRtpSender[]

removeLocalStream()
ts
removeLocalStream(): void;

Defined in: src/core/MediaManager.ts:688

Remove local stream from peer connection

Returns

void

stopLocalStream()
ts
stopLocalStream(): void;

Defined in: src/core/MediaManager.ts:710

Stop local stream

Returns

void

getLocalStream()
ts
getLocalStream(): MediaStream | undefined;

Defined in: src/core/MediaManager.ts:732

Get local stream

Returns

MediaStream | undefined

getRemoteStream()
ts
getRemoteStream(): MediaStream | undefined;

Defined in: src/core/MediaManager.ts:739

Get remote stream

Returns

MediaStream | undefined

sendDTMF()
ts
sendDTMF(
   tone, 
   duration?, 
   gap?): void;

Defined in: src/core/MediaManager.ts:750

Send DTMF tone

Parameters
ParameterType
tonestring
duration?number
gap?number
Returns

void

isDTMFAvailable()
ts
isDTMFAvailable(): boolean;

Defined in: src/core/MediaManager.ts:769

Check if DTMF is available

Returns

boolean

enumerateDevices()
ts
enumerateDevices(forceRefresh): Promise<MediaDevice[]>;

Defined in: src/core/MediaManager.ts:781

Enumerate media devices

Parameters
ParameterTypeDefault valueDescription
forceRefreshbooleanfalseForce refresh from native API, bypassing cache
Returns

Promise<MediaDevice[]>

getDevicesByKind()
ts
getDevicesByKind(kind): MediaDevice[];

Defined in: src/core/MediaManager.ts:829

Get devices by kind

Parameters
ParameterType
kindMediaDeviceKind
Returns

MediaDevice[]

getAudioInputDevices()
ts
getAudioInputDevices(): MediaDevice[];

Defined in: src/core/MediaManager.ts:836

Get audio input devices

Returns

MediaDevice[]

getAudioOutputDevices()
ts
getAudioOutputDevices(): MediaDevice[];

Defined in: src/core/MediaManager.ts:843

Get audio output devices

Returns

MediaDevice[]

getVideoInputDevices()
ts
getVideoInputDevices(): MediaDevice[];

Defined in: src/core/MediaManager.ts:850

Get video input devices

Returns

MediaDevice[]

selectAudioInput()
ts
selectAudioInput(deviceId): void;

Defined in: src/core/MediaManager.ts:857

Select audio input device

Parameters
ParameterType
deviceIdstring
Returns

void

selectAudioOutput()
ts
selectAudioOutput(deviceId): void;

Defined in: src/core/MediaManager.ts:865

Select audio output device

Parameters
ParameterType
deviceIdstring
Returns

void

selectVideoInput()
ts
selectVideoInput(deviceId): void;

Defined in: src/core/MediaManager.ts:873

Select video input device

Parameters
ParameterType
deviceIdstring
Returns

void

getSelectedAudioInput()
ts
getSelectedAudioInput(): string | undefined;

Defined in: src/core/MediaManager.ts:881

Get selected audio input device

Returns

string | undefined

getSelectedAudioOutput()
ts
getSelectedAudioOutput(): string | undefined;

Defined in: src/core/MediaManager.ts:888

Get selected audio output device

Returns

string | undefined

getSelectedVideoInput()
ts
getSelectedVideoInput(): string | undefined;

Defined in: src/core/MediaManager.ts:895

Get selected video input device

Returns

string | undefined

requestPermissions()
ts
requestPermissions(audio, video): Promise<MediaPermissions>;

Defined in: src/core/MediaManager.ts:902

Request media permissions

Parameters
ParameterTypeDefault value
audiobooleantrue
videobooleanfalse
Returns

Promise<MediaPermissions>

getPermissions()
ts
getPermissions(): MediaPermissions;

Defined in: src/core/MediaManager.ts:951

Get current permissions

Returns

MediaPermissions

startDeviceChangeMonitoring()
ts
startDeviceChangeMonitoring(): void;

Defined in: src/core/MediaManager.ts:958

Start monitoring device changes

Returns

void

stopDeviceChangeMonitoring()
ts
stopDeviceChangeMonitoring(): void;

Defined in: src/core/MediaManager.ts:1006

Stop monitoring device changes

Returns

void

testAudioInput()
ts
testAudioInput(deviceId): Promise<DeviceTestResult>;

Defined in: src/core/MediaManager.ts:1018

Test audio input device

Parameters
ParameterType
deviceIdstring
Returns

Promise<DeviceTestResult>

testVideoInput()
ts
testVideoInput(deviceId): Promise<DeviceTestResult>;

Defined in: src/core/MediaManager.ts:1046

Test video input device

Parameters
ParameterType
deviceIdstring
Returns

Promise<DeviceTestResult>

getStatistics()
ts
getStatistics(): Promise<MediaStatistics>;

Defined in: src/core/MediaManager.ts:1113

Get WebRTC statistics

Returns

Promise<MediaStatistics>

destroy()
ts
destroy(): void;

Defined in: src/core/MediaManager.ts:1399

Cleanup and release resources

Returns

void

setDevices()
ts
setDevices(devices): void;

Defined in: src/core/MediaManager.ts:1423

Set available devices (manually update device list)

Parameters
ParameterTypeDescription
devicesMediaDeviceInfo[]Devices to set
Returns

void

testDevice()
ts
testDevice(deviceId): Promise<{
  success: boolean;
  audioLevel?: number;
}>;

Defined in: src/core/MediaManager.ts:1456

Test a specific device (audio or video)

Parameters
ParameterTypeDescription
deviceIdstringDevice 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

ts
const sipClient = new SipClient(config, eventBus)
await sipClient.start()
await sipClient.register()

Constructors

Constructor
ts
new SipClient(config, eventBus): SipClient;

Defined in: src/core/SipClient.ts:165

Parameters
ParameterType
configSipClientConfig
eventBusEventBus
Returns

SipClient

Accessors

eventBus
Get Signature
ts
get eventBus(): EventBus;

Defined in: src/core/SipClient.ts:147

Get the event bus instance for subscribing to SIP events

Returns

EventBus

connectionState
Get Signature
ts
get connectionState(): ConnectionState;

Defined in: src/core/SipClient.ts:186

Get current connection state

Returns

ConnectionState

registrationState
Get Signature
ts
get registrationState(): RegistrationState;

Defined in: src/core/SipClient.ts:193

Get current registration state

Returns

RegistrationState

isConnected
Get Signature
ts
get isConnected(): boolean;

Defined in: src/core/SipClient.ts:200

Check if connected to SIP server

Returns

boolean

isRegistered
Get Signature
ts
get isRegistered(): boolean;

Defined in: src/core/SipClient.ts:218

Check if registered with SIP server

Returns

boolean

userAgent
Get Signature
ts
get userAgent(): UA | null;

Defined in: src/core/SipClient.ts:232

Get the JsSIP UA instance

Returns

UA | null

Methods

getState()
ts
getState(): Readonly<SipClientState>;

Defined in: src/core/SipClient.ts:239

Get current client state

Returns

Readonly<SipClientState>

getConfig()
ts
getConfig(): Readonly<SipClientConfig>;

Defined in: src/core/SipClient.ts:247

Get current configuration

Returns

Readonly<SipClientConfig>

The SIP client configuration

validateConfig()
ts
validateConfig(): ValidationResult;

Defined in: src/core/SipClient.ts:254

Validate configuration

Returns

ValidationResult

start()
ts
start(): Promise<void>;

Defined in: src/core/SipClient.ts:261

Start the SIP client (initialize UA and connect)

Returns

Promise<void>

stop()
ts
stop(): Promise<void>;

Defined in: src/core/SipClient.ts:425

Stop the SIP client (unregister and disconnect)

Returns

Promise<void>

register()
ts
register(): Promise<void>;

Defined in: src/core/SipClient.ts:495

Register with SIP server

Returns

Promise<void>

unregister()
ts
unregister(): Promise<void>;

Defined in: src/core/SipClient.ts:614

Unregister from SIP server

Returns

Promise<void>

sendMessage()
ts
sendMessage(
   target, 
   content, 
   options?): void;

Defined in: src/core/SipClient.ts:1054

Send custom SIP message (MESSAGE method)

Parameters
ParameterType
targetstring
contentstring
options?JsSIPSendMessageOptions
Returns

void

updateConfig()
ts
updateConfig(config): void;

Defined in: src/core/SipClient.ts:1070

Update client configuration (requires restart)

Parameters
ParameterType
configPartial<SipClientConfig>
Returns

void

getCredentials()
ts
getCredentials(): AuthenticationCredentials;

Defined in: src/core/SipClient.ts:1082

Get authentication credentials

Returns

AuthenticationCredentials

createConference()
ts
createConference(conferenceId, options?): Promise<void>;

Defined in: src/core/SipClient.ts:1102

Create a conference

Parameters
ParameterType
conferenceIdstring
options?ConferenceOptions
Returns

Promise<void>

joinConference()
ts
joinConference(conferenceUri, options?): Promise<void>;

Defined in: src/core/SipClient.ts:1162

Join a conference

Parameters
ParameterType
conferenceUristring
options?ConferenceOptions
Returns

Promise<void>

inviteToConference()
ts
inviteToConference(conferenceId, participantUri): Promise<void>;

Defined in: src/core/SipClient.ts:1255

Invite participant to conference

Parameters
ParameterType
conferenceIdstring
participantUristring
Returns

Promise<void>

removeFromConference()
ts
removeFromConference(conferenceId, participantId): Promise<void>;

Defined in: src/core/SipClient.ts:1346

Remove participant from conference

Parameters
ParameterType
conferenceIdstring
participantIdstring
Returns

Promise<void>

muteParticipant()
ts
muteParticipant(conferenceId, participantId): Promise<void>;

Defined in: src/core/SipClient.ts:1387

Mute conference participant

Parameters
ParameterType
conferenceIdstring
participantIdstring
Returns

Promise<void>

unmuteParticipant()
ts
unmuteParticipant(conferenceId, participantId): Promise<void>;

Defined in: src/core/SipClient.ts:1425

Unmute conference participant

Parameters
ParameterType
conferenceIdstring
participantIdstring
Returns

Promise<void>

endConference()
ts
endConference(conferenceId): Promise<void>;

Defined in: src/core/SipClient.ts:1463

End a conference

Parameters
ParameterType
conferenceIdstring
Returns

Promise<void>

startConferenceRecording()
ts
startConferenceRecording(conferenceId): Promise<void>;

Defined in: src/core/SipClient.ts:1519

Start conference recording

Parameters
ParameterType
conferenceIdstring
Returns

Promise<void>

stopConferenceRecording()
ts
stopConferenceRecording(conferenceId): Promise<void>;

Defined in: src/core/SipClient.ts:1544

Stop conference recording

Parameters
ParameterType
conferenceIdstring
Returns

Promise<void>

getConferenceAudioLevels()?
ts
optional getConferenceAudioLevels(conferenceId): Map<string, number> | undefined;

Defined in: src/core/SipClient.ts:1568

Get conference audio levels

Parameters
ParameterType
conferenceIdstring
Returns

Map<string, number> | undefined

muteAudio()
ts
muteAudio(): Promise<void>;

Defined in: src/core/SipClient.ts:1601

Mute audio on all active calls

Returns

Promise<void>

unmuteAudio()
ts
unmuteAudio(): Promise<void>;

Defined in: src/core/SipClient.ts:1645

Unmute audio on all active calls

Returns

Promise<void>

disableVideo()
ts
disableVideo(): Promise<void>;

Defined in: src/core/SipClient.ts:1689

Disable video on all active calls

Returns

Promise<void>

enableVideo()
ts
enableVideo(): Promise<void>;

Defined in: src/core/SipClient.ts:1733

Enable video on all active calls

Returns

Promise<void>

destroy()
ts
destroy(): void;

Defined in: src/core/SipClient.ts:1777

Clean up resources

Returns

void

forceEmitConnected()
ts
forceEmitConnected(transport?): void;

Defined in: src/core/SipClient.ts:1820

Manually force connected event emission (test helper)

Parameters
ParameterType
transport?string
Returns

void

forceEmitDisconnected()
ts
forceEmitDisconnected(error?): void;

Defined in: src/core/SipClient.ts:1827

Manually force disconnected event emission (test helper)

Parameters
ParameterType
error?unknown
Returns

void

onIncomingMessage()
ts
onIncomingMessage(handler): void;

Defined in: src/core/SipClient.ts:1839

Set incoming message handler

Parameters
ParameterTypeDescription
handler(from, content, contentType?) => voidMessage handler function
Returns

void

offIncomingMessage()
ts
offIncomingMessage(handler): void;

Defined in: src/core/SipClient.ts:1848

Remove incoming message handler

Parameters
ParameterTypeDescription
handler(from, content, contentType?) => voidMessage handler function to remove
Returns

void

onComposingIndicator()
ts
onComposingIndicator(handler): void;

Defined in: src/core/SipClient.ts:1860

Set composing indicator handler

Parameters
ParameterTypeDescription
handler(from, isComposing) => voidComposing indicator handler function
Returns

void

offComposingIndicator()
ts
offComposingIndicator(handler): void;

Defined in: src/core/SipClient.ts:1869

Remove composing indicator handler

Parameters
ParameterTypeDescription
handler(from, isComposing) => voidComposing indicator handler function to remove
Returns

void

publishPresence()
ts
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
ParameterTypeDescription
presencePresencePublishOptionsPresence data (state, note, activity)
Returns

Promise<void>

Throws

Error if not connected or PUBLISH fails

subscribePresence()
ts
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
ParameterTypeDescription
uristringTarget SIP URI to watch (e.g., 'sip:6001@pbx.com')
options?PresenceSubscriptionOptionsSubscription options (expires, extraHeaders)
Returns

Promise<void>

Throws

Error if not connected or SUBSCRIBE fails

unsubscribePresence()
ts
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
ParameterTypeDescription
uristringTarget SIP URI to stop watching
Returns

Promise<void>

Throws

Error if not connected or UNSUBSCRIBE fails

getActiveCall()
ts
getActiveCall(callId): CallSession | undefined;

Defined in: src/core/SipClient.ts:2164

Get an active call session by ID

Parameters
ParameterTypeDescription
callIdstringCall ID to retrieve
Returns

CallSession | undefined

Call session or undefined if not found

makeCall()
ts
makeCall(target, options?): Promise<string>;

Defined in: src/core/SipClient.ts:2174

Make an outgoing call

Parameters
ParameterTypeDescription
targetstringTarget SIP URI
options?CallOptionsCall options
Returns

Promise<string>

Promise resolving to call ID

call()
ts
call(target, options?): Promise<CallSession>;

Defined in: src/core/SipClient.ts:2186

Make an outgoing call and return CallSession instance

Parameters
ParameterTypeDescription
targetstringTarget SIP URI
options?CallOptionsCall options
Returns

Promise<CallSession>

Promise resolving to CallSession instance

onMessage()
ts
onMessage(handler): void;

Defined in: src/core/SipClient.ts:2998

Alias for onIncomingMessage() - for API compatibility

Parameters
ParameterType
handler(from, content, contentType?) => void
Returns

void

onComposing()
ts
onComposing(handler): void;

Defined in: src/core/SipClient.ts:3005

Alias for onComposingIndicator() - for API compatibility

Parameters
ParameterType
handler(from, isComposing) => void
Returns

void

getActiveCalls()
ts
getActiveCalls(): CallSession[];

Defined in: src/core/SipClient.ts:3013

Get all active call sessions

Returns

CallSession[]

Array of active CallSession instances

getCall()
ts
getCall(callId): CallSession | undefined;

Defined in: src/core/SipClient.ts:3022

Get a specific call session by ID

Parameters
ParameterTypeDescription
callIdstringThe call ID to retrieve
Returns

CallSession | undefined

The CallSession instance or undefined if not found

muteCall()
ts
muteCall(): Promise<void>;

Defined in: src/core/SipClient.ts:3029

Alias for muteAudio() - mutes audio for all calls

Returns

Promise<void>

unmuteCall()
ts
unmuteCall(): Promise<void>;

Defined in: src/core/SipClient.ts:3036

Alias for unmuteAudio() - unmutes audio for all calls

Returns

Promise<void>

answerCall()
ts
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
ParameterTypeDescription
callId?stringOptional call ID, uses first ringing call if not specified
Returns

Promise<void>

hangupCall()
ts
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
ParameterTypeDescription
callId?stringOptional call ID, hangups first call if not specified
Returns

Promise<void>

holdCall()
ts
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
ParameterTypeDescription
callId?stringOptional call ID, holds first call if not specified
Returns

Promise<void>

unholdCall()
ts
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
ParameterTypeDescription
callId?stringOptional call ID, unholds first call if not specified
Returns

Promise<void>

transferCall()
ts
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
ParameterTypeDescription
targetstringSIP URI to transfer to
callId?stringOptional call ID, transfers first call if not specified
Returns

Promise<void>

sendDTMF()
ts
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
ParameterTypeDescription
tonestringDTMF tone to send
callId?stringOptional 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
ts
new TransportManager(config): TransportManager;

Defined in: src/core/TransportManager.ts:86

Parameters
ParameterType
configTransportConfig
Returns

TransportManager

Accessors

state
Get Signature
ts
get state(): ConnectionState;

Defined in: src/core/TransportManager.ts:103

Get current connection state

Returns

ConnectionState

isConnected
Get Signature
ts
get isConnected(): boolean;

Defined in: src/core/TransportManager.ts:110

Check if currently connected

Returns

boolean

Methods

on()
ts
on(event, handler): void;

Defined in: src/core/TransportManager.ts:117

Add event listener

Parameters
ParameterType
eventTransportEvent
handlerTransportEventHandler
Returns

void

off()
ts
off(event, handler): void;

Defined in: src/core/TransportManager.ts:130

Remove event listener

Parameters
ParameterType
eventTransportEvent
handlerTransportEventHandler
Returns

void

removeAllListeners()
ts
removeAllListeners(event?): void;

Defined in: src/core/TransportManager.ts:140

Remove all event listeners for a specific event type

Parameters
ParameterType
event?TransportEvent
Returns

void

connect()
ts
connect(): Promise<void>;

Defined in: src/core/TransportManager.ts:199

Connect to WebSocket server

Returns

Promise<void>

disconnect()
ts
disconnect(): void;

Defined in: src/core/TransportManager.ts:262

Disconnect from WebSocket server

Returns

void

send()
ts
send(data): void;

Defined in: src/core/TransportManager.ts:280

Send data through WebSocket

Parameters
ParameterType
datastring | Blob | ArrayBuffer | ArrayBufferView
Returns

void

reconnect()
ts
reconnect(): Promise<void>;

Defined in: src/core/TransportManager.ts:396

Manually trigger reconnection

Returns

Promise<void>

resetReconnectionAttempts()
ts
resetReconnectionAttempts(): void;

Defined in: src/core/TransportManager.ts:405

Reset reconnection counter

Returns

void

getReconnectionAttempts()
ts
getReconnectionAttempts(): number;

Defined in: src/core/TransportManager.ts:412

Get current reconnection attempt count

Returns

number

destroy()
ts
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
    • sendInterval expires
  • All queued events sent together in single HTTP request
  • Concurrent flush operations prevented with isFlushing flag
  • 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
ts
new AnalyticsPlugin(): AnalyticsPlugin;

Defined in: src/plugins/AnalyticsPlugin.ts:499

Returns

AnalyticsPlugin

Properties

PropertyTypeDefault valueDescriptionDefined in
metadataobjectundefinedPlugin metadatasrc/plugins/AnalyticsPlugin.ts:461
metadata.namestring'analytics'-src/plugins/AnalyticsPlugin.ts:462
metadata.versionstring'1.0.0'-src/plugins/AnalyticsPlugin.ts:463
metadata.descriptionstring'Analytics and event tracking plugin'-src/plugins/AnalyticsPlugin.ts:464
metadata.authorstring'VueSip'-src/plugins/AnalyticsPlugin.ts:465
metadata.licensestring'MIT'-src/plugins/AnalyticsPlugin.ts:466
defaultConfigRequired<AnalyticsPluginConfig>DEFAULT_CONFIGDefault configurationsrc/plugins/AnalyticsPlugin.ts:470

Methods

install()
ts
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
ParameterTypeDescription
contextPluginContextThe plugin context provided by VueSip's plugin manager, containing the event bus and other runtime information needed for plugin integration
config?AnalyticsPluginConfigOptional 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

  1. Checks if plugin is already installed to prevent duplicate installation
  2. Merges provided config with DEFAULT_CONFIG
  3. Validates that endpoint is configured (logs warning if missing)
  4. Registers event listeners for SIP, call, and media events
  5. Starts batch timer if batchEvents is true
  6. Marks plugin as installed with isInstalled flag
  7. 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 sendInterval milliseconds
  • Timer calls flushEvents() on each tick to send queued events
  • Timer is stored in batchTimer for 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
  • cleanupFunctions array 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
typescript
const plugin = createAnalyticsPlugin()
await plugin.install(context, {
  endpoint: 'https://analytics.example.com/events'
})
// Plugin ready with default batching and all events tracked
typescript
const 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
})
typescript
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
})
typescript
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')
typescript
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

Plugin.install

uninstall()
ts
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
ParameterTypeDescription
_contextPluginContextThe 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

  1. Flushes any remaining events in the queue to avoid data loss
  2. Stops the batch timer (if running) and clears the timer reference
  3. Removes all registered event listeners from the event bus
  4. Clears the cleanupFunctions array
  5. Resets the isInstalled flag 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 cleanupFunctions array
  • 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:

  • isInstalled flag 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
typescript
// Uninstall the plugin during shutdown
await analyticsPlugin.uninstall(context)
console.log('Analytics plugin uninstalled')
// Plugin can be reinstalled if needed
typescript
// 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
typescript
// 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

Plugin.uninstall

updateConfig()
ts
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
ParameterTypeDescription
_contextPluginContextThe plugin context (unused but required by Plugin interface)
configAnalyticsPluginConfigPartial 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

  1. Saves old configuration for comparison
  2. Merges new config with existing config (shallow merge)
  3. Checks for batch timer interval changes
  4. Restarts batch timer if interval changed and batching enabled
  5. Handles batching mode toggle (enabled ↔ disabled)
  6. Logs configuration update

Configuration Merging

Configuration is merged using object spread:

typescript
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
typescript
// Reduce batching for lower latency
await analyticsPlugin.updateConfig(context, {
  batchSize: 5,
  sendInterval: 10000  // Send every 10 seconds
})
// Timer restarts with new interval
typescript
// 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
typescript
// 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
typescript
// 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
typescript
// 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

Plugin.updateConfig

setUserId()
ts
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
ParameterTypeDescription
userIdstringThe 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 userId property
  • Persists until explicitly changed or plugin is destroyed
  • Only included in events when includeUserInfo: true in configuration
  • Added to the userId field 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 events
  • includeUserInfo: true: User ID included in all future events
  • Toggle includeUserInfo at 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
typescript
// 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
typescript
// Hash user email for privacy-conscious tracking
const hashedEmail = await hashString(user.email)
analyticsPlugin.setUserId(hashedEmail)
// Events include hashed ID, not raw email
typescript
// User logs out
analyticsPlugin.setUserId('')
// Or disable user tracking entirely
await pluginManager.updateConfig('analytics', {
  includeUserInfo: false
})
typescript
// 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
  })
}
typescript
// 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 boundaries

HookManager

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():

  1. Generate unique hook ID (hook-{counter})
  2. Create HookRegistration object with handler, options, plugin name, and ID
  3. Apply default values to options (priority: Normal, once: false, condition: () => true)
  4. Retrieve or create hook array for the hook name
  5. Add registration to array
  6. Sort array by priority (highest first)
  7. Store sorted array back in the map
  8. Log registration with details
  9. 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

Constructors

Constructor
ts
new HookManager(): HookManager;
Returns

HookManager

Methods

setContext()
ts
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
ParameterTypeDescription
contextPluginContextThe 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 events
  • sipClient: 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 instances
  • hooks: Hook registration and execution interface
  • logger: Logger instance for debug output
  • version: 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
typescript
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
typescript
// Later, when SipClient is initialized
const updatedContext = {
  ...context,
  sipClient: newSipClient
}
hookManager.setContext(updatedContext)
// All hooks now have access to sipClient
register()
ts
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 ParameterDefault type
TDataunknown
TReturnunknown
Parameters
ParameterTypeDefault valueDescription
namestringundefinedThe name of the hook to register the handler for. This corresponds to lifecycle events in VueSip (e.g., 'beforeCall', 'callStarted', 'callEnded').
handlerHookHandler<TData, TReturn>undefinedThe 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
optionsHookOptions{}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)
pluginNamestring'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:

  1. ID Generation: Generate unique hook ID using incrementing counter
  2. Registration Creation: Create HookRegistration object with handler, options, plugin name, and ID
  3. Default Options: Apply default values to missing options (priority: Normal, once: false, condition: () => true)
  4. Array Retrieval: Get existing hook array for this hook name, or create new empty array
  5. Array Addition: Add new registration to the array
  6. Priority Sorting: Sort array by priority (highest numeric value first)
  7. Map Update: Store sorted array back in the hooks map
  8. Logging: Log registration details (hook name, ID, plugin name, priority)
  9. 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:

  1. Higher priority handlers always execute before lower priority handlers
  2. Within same priority level, handlers execute in registration order (first registered, first executed)
  3. Order is deterministic and predictable
  4. 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:

typescript
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
typescript
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)
typescript
// 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'
)
typescript
// 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'
)
typescript
// 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'
)
typescript
// 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 priority
unregister()
ts
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
ParameterTypeDescription
hookIdstringThe 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:

  1. Iteration: Loop through all hook names in the hooks map
  2. Search: For each hook name, search its array for matching hook ID
  3. Removal: If found, remove the hook from the array using splice()
  4. Cleanup: If array becomes empty after removal, delete the hook name from map
  5. Logging: Log the unregistration event with hook ID
  6. 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 successfully
  • false: 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
typescript
// 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
typescript
// 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'
)
typescript
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()
ts
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
ParameterTypeDescription
pluginNamestringThe 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:

  1. Initialize Counter: Set removed count to 0
  2. Iterate Hooks: Loop through all hook names in the hooks map
  3. Filter Arrays: For each hook name, filter out hooks matching the plugin name
  4. Count Removed: Calculate how many hooks were removed (original length - filtered length)
  5. Update Map: If filtered array is empty, delete hook name from map; otherwise update with filtered array
  6. Accumulate: Add removed count to total
  7. Logging: If any hooks were removed, log the total count with plugin name
  8. 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
typescript
// 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) // 0
typescript
async 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}`)
  }
}
typescript
// 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)
typescript
// 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()
ts
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 ParameterDefault type
TDataunknown
TReturnunknown
Parameters
ParameterTypeDescription
namestringThe name of the hook to execute. This corresponds to lifecycle events in VueSip (e.g., 'beforeCall', 'callStarted', 'callEnded', 'messageReceived').
data?TDataOptional 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:

  1. Lookup: Retrieve all handlers registered for the hook name from the hooks map
  2. Empty Check: If no handlers found, return empty array immediately
  3. Context Check: If context is not set, log warning and return empty array
  4. Logging: Log execution start with hook name and handler count
  5. Initialize: Create empty results array and toRemove array for once handlers
  6. 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)
  1. Cleanup: Remove all hook IDs in toRemove array via unregister()
  2. 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 handlers
  • TReturn: The type of value returned by hook handlers
Examples
typescript
// 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)
typescript
// 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
typescript
// 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
typescript
// 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)
typescript
// 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) // []
typescript
// 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
typescript
// 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()
ts
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
typescript
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()
ts
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
ParameterTypeDescription
namestringThe 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 function
  • options: Hook options (priority, once, condition)
  • pluginName: Name of the plugin that registered the hook
  • id: 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
typescript
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()
ts
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
ParameterTypeDescription
namestringThe 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
typescript
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')
}
typescript
const hasRecordingHooks = hookManager.has('recordingStarted')
if (hasRecordingHooks) {
  console.log('Recording plugin is installed')
  enableRecordingUI()
}
count()
ts
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
ParameterTypeDescription
namestringThe 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
typescript
console.log('beforeCall handlers:', hookManager.count('beforeCall'))
console.log('callStarted handlers:', hookManager.count('callStarted'))
console.log('callEnded handlers:', hookManager.count('callEnded'))
typescript
// Register hooks
hookManager.register('testHook', handler1, {}, 'plugin-1')
hookManager.register('testHook', handler2, {}, 'plugin-2')

// Verify count
expect(hookManager.count('testHook')).toBe(2)
clear()
ts
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
typescript
// Application shutdown
console.log('Shutting down, clearing all hooks')
hookManager.clear()
console.log('All hooks cleared')
typescript
afterEach(() => {
  // Clean up hooks after each test
  hookManager.clear()
  // Ensure clean state for next test
})
typescript
// Reset entire hook system
hookManager.clear()
console.log('Hook count:', hookManager.getStats().totalHooks) // 0
// Ready to register new hooks
getStats()
ts
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 handlers
  • hookNames: Array of all hook names with registered handlers
  • totalHandlers: Total count of all registered handlers across all hooks
  • handlersByPlugin: Object mapping plugin names to their handler counts
NameTypeDefined in
totalHooksnumbersrc/plugins/HookManager.ts:1692
hookNamesstring[]src/plugins/HookManager.ts:1693
totalHandlersnumbersrc/plugins/HookManager.ts:1694
handlersByPluginRecord<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

typescript
{
  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
typescript
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}`)
}
typescript
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`)
  }
}
typescript
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

Implements

Constructors

Constructor
ts
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
ParameterTypeDescription
eventBusEventBusThe 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.
versionstringThe 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

PluginManager

Remarks

Initialization Process

The constructor performs the following initialization steps:

  1. Stores the event bus reference for plugin communication
  2. Stores the application version for compatibility checking
  3. Creates a new HookManager instance for hook coordination
  4. 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
typescript
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 plugins

Methods

setSipClient()
ts
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
ParameterTypeDescription
sipClientSipClient | nullThe 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.sipClient in 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
typescript
// 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
typescript
// Before destroying SIP client
pluginManager.setSipClient(null)
await sipClient.disconnect()
setMediaManager()
ts
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
ParameterTypeDescription
mediaManagerMediaManager | nullThe 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.mediaManager in hook handlers
  • Enables plugins to access media streams, control devices, and manage media state
Example
typescript
const mediaManager = new MediaManager(config)
await mediaManager.initialize()
pluginManager.setMediaManager(mediaManager)
// Plugins can now access media functionality
setConfig()
ts
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
ParameterTypeDescription
configSipClientConfig | nullThe 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.config in hook handlers
  • Enables plugins to adapt their behavior based on configuration settings

Configuration Updates

When configuration changes at runtime:

  1. Call setConfig() with the new configuration
  2. Optionally notify affected plugins via events or hook execution
  3. Plugins see the updated configuration in subsequent hook executions
Example
typescript
const config = await loadConfig()
pluginManager.setConfig(config)
// Plugins can now access configuration
setActiveCalls()
ts
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
ParameterTypeDescription
activeCallsMap<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.activeCalls in 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
typescript
const sipClient = new SipClient(config)
await sipClient.connect()

// Share the active calls map with plugins
pluginManager.setActiveCalls(sipClient.getActiveCalls())
// Plugins can now monitor active calls
register()
ts
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 ParameterDefault type
TConfig extends PluginConfigPluginConfig
Parameters
ParameterTypeDescription
pluginPlugin<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?TConfigOptional 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:

  1. Duplicate Check: Verifies no plugin with the same name is already registered
  2. Version Check: Validates plugin's minVersion and maxVersion against app version
  3. Dependency Check: Ensures all dependencies are registered and installed
  4. Config Merge: Combines plugin defaults with provided configuration
  5. Entry Creation: Creates PluginEntry with initial state of 'Registered'
  6. Registration: Adds entry to the plugin registry
  7. 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:

typescript
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
typescript
import { createRecordingPlugin } from './plugins/RecordingPlugin'

const recordingPlugin = createRecordingPlugin()
await pluginManager.register(recordingPlugin)
// Plugin installed with default config, auto-enabled
typescript
await pluginManager.register(recordingPlugin, {
  enabled: true,
  autoStart: true,
  recordingOptions: {
    audio: true,
    video: false,
    mimeType: 'audio/webm'
  }
})
typescript
// 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 })
typescript
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)
  }
}
typescript
// 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 satisfied
Implementation of

PluginManager.register

unregister()
ts
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
ParameterTypeDescription
pluginNamestringThe 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:

  1. Lookup: Retrieves plugin entry from the registry
  2. State Transition: Sets state to Uninstalling
  3. Plugin Uninstall: Calls plugin.uninstall(context) if method exists
  4. Hook Cleanup: Removes all hooks registered by the plugin (always, even if uninstall fails)
  5. Registry Removal: Deletes plugin entry from the registry (always)
  6. Event Emission: Emits 'plugin:unregistered' event (always)
  7. 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
typescript
// Unregister a plugin
await pluginManager.unregister('recording')
console.log(pluginManager.has('recording'))  // false
typescript
try {
  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
  }
}
typescript
if (pluginManager.has('analytics')) {
  await pluginManager.unregister('analytics')
  console.log('Analytics plugin removed')
}
typescript
// 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

PluginManager.unregister

get()
ts
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
ParameterTypeDescription
pluginNamestringThe 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 instance
  • config: Current plugin configuration
  • state: Current lifecycle state (Registered, Installing, Installed, etc.)
  • hookIds: Array of hook IDs registered by this plugin
  • installedAt: 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 installed
  • PluginState.Installing: Installation in progress
  • PluginState.Installed: Plugin fully operational
  • PluginState.Uninstalling: Cleanup in progress
  • PluginState.Failed: Installation failed, see entry.error

Return Value Handling

Always check for undefined before accessing entry properties:

typescript
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
typescript
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')
}
typescript
const entry = pluginManager.get('recording')
if (entry) {
  console.log('Auto-start:', entry.config.autoStart)
  console.log('Max recordings:', entry.config.maxRecordings)
}
typescript
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

PluginManager.get

has()
ts
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
ParameterTypeDescription
pluginNamestringThe 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
typescript
if (!pluginManager.has('recording')) {
  await pluginManager.register(recordingPlugin)
} else {
  console.log('Recording plugin already registered')
}
typescript
if (pluginManager.has('analytics')) {
  await pluginManager.unregister('analytics')
}
typescript
if (pluginManager.has('recording')) {
  console.log('Recording feature available')
  enableRecordingUI()
} else {
  console.log('Recording feature not available')
  disableRecordingUI()
}
Implementation of

PluginManager.has

getAll()
ts
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 entries
  • map.keys() - Get all plugin names
  • map.values() - Get all plugin entries
  • map.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
typescript
const plugins = pluginManager.getAll()
console.log(`Total plugins: ${plugins.size}`)

for (const [name, entry] of plugins) {
  console.log(`${name}: ${entry.state}`)
}
typescript
const allPlugins = pluginManager.getAll()
const installedPlugins = Array.from(allPlugins.values())
  .filter(entry => entry.state === PluginState.Installed)

console.log(`Operational plugins: ${installedPlugins.length}`)
typescript
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

PluginManager.getAll

updateConfig()
ts
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 ParameterDefault type
TConfig extends PluginConfigPluginConfig
Parameters
ParameterTypeDescription
pluginNamestringThe name of the plugin to configure. Must be a registered plugin that exists in the plugin registry.
configTConfigPartial 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:

  1. Lookup: Retrieves plugin entry from the registry
  2. Config Merge: Shallow merges new config with existing config
  3. Plugin Notification: Calls plugin.updateConfig(context, config) if method exists
  4. Logging: Logs the configuration update
  5. Event Emission: Emits 'plugin:configUpdated' event

Configuration Merging

Configuration is merged using object spread:

typescript
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
typescript
// Toggle auto-recording feature
await pluginManager.updateConfig('recording', {
  autoStart: true
})
// Only the autoStart property is updated, other config unchanged
typescript
await pluginManager.updateConfig('recording', {
  autoStart: false,
  maxRecordings: 100,
  storeInIndexedDB: true
})
typescript
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)
  }
}
typescript
eventBus.on('plugin:configUpdated', ({ pluginName, config }) => {
  console.log(`Plugin ${pluginName} config updated:`, config)
  // React to configuration changes
})
Implementation of

PluginManager.updateConfig

executeHook()
ts
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 ParameterDefault type
TDataunknown
TReturnunknown
Parameters
ParameterTypeDescription
namestringThe name of the hook to execute. This corresponds to the hook names defined in the HookName type (e.g., 'beforeCall', 'callStarted', 'callEnded', etc.).
data?TDataOptional 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:

  1. HookManager looks up all handlers registered for the hook name
  2. Handlers are executed sequentially in registration order
  3. Each handler receives the provided data and the plugin context
  4. Results from all handlers are collected into an array
  5. 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 handlers
  • TReturn: The type of value returned by hook handlers
Examples
typescript
// 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`)
typescript
// Execute a hook that doesn't require data
await pluginManager.executeHook('applicationReady')
typescript
// 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()
ts
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

HookManager

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
typescript
const hookManager = pluginManager.getHookManager()
const stats = hookManager.getStats()
console.log('Total hooks:', stats.totalHooks)
console.log('Hooks by name:', stats.hooksByName)
typescript
const hookManager = pluginManager.getHookManager()
// Perform advanced operations (use with caution)
// Most use cases should use plugin context instead
destroy()
ts
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:

  1. Collect Plugin Names: Gets array of all registered plugin names
  2. Unregister Plugins: Iterates through plugins and unregisters each one
  3. Error Handling: Logs errors but continues with remaining plugins
  4. Clear Hooks: Calls hookManager.clear() to remove all hooks
  5. 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
typescript
// During application shutdown
await pluginManager.destroy()
console.log('All plugins cleaned up')
// Safe to destroy other VueSip components
typescript
// 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])
typescript
afterEach(async () => {
  // Clean up plugins after each test
  await pluginManager.destroy()
})
Implementation of

PluginManager.destroy

getStats()
ts
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 PluginState
  • hookStats: Hook statistics from HookManager (total hooks, hooks by name, etc.)
NameTypeDefined in
totalPluginsnumbersrc/plugins/PluginManager.ts:2172
installedPluginsnumbersrc/plugins/PluginManager.ts:2173
failedPluginsnumbersrc/plugins/PluginManager.ts:2174
pluginsByStateRecord<PluginState, number>src/plugins/PluginManager.ts:2175
hookStatsobjectsrc/plugins/PluginManager.ts:2176
hookStats.totalHooksnumbersrc/plugins/HookManager.ts:1692
hookStats.hookNamesstring[]src/plugins/HookManager.ts:1693
hookStats.totalHandlersnumbersrc/plugins/HookManager.ts:1694
hookStats.handlersByPluginRecord<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 installed
  • Installing: Plugins currently being installed (usually 0)
  • Installed: Plugins fully operational
  • Uninstalling: 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

typescript
{
  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
typescript
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)
typescript
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)
    }
  }
}
typescript
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}`)
typescript
// 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 minute

RecordingPlugin

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
ts
new RecordingPlugin(): RecordingPlugin;
Returns

RecordingPlugin

Properties

PropertyTypeDefault valueDescriptionDefined in
metadataobjectundefinedPlugin metadatasrc/plugins/RecordingPlugin.ts:265
metadata.namestring'recording'-src/plugins/RecordingPlugin.ts:266
metadata.versionstring'1.0.0'-src/plugins/RecordingPlugin.ts:267
metadata.descriptionstring'Call recording plugin with MediaRecorder support'-src/plugins/RecordingPlugin.ts:268
metadata.authorstring'VueSip'-src/plugins/RecordingPlugin.ts:269
metadata.licensestring'MIT'-src/plugins/RecordingPlugin.ts:270
defaultConfigRequired<RecordingPluginConfig>DEFAULT_CONFIGDefault configurationsrc/plugins/RecordingPlugin.ts:274

Methods

install()
ts
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
ParameterTypeDescription
contextPluginContextThe plugin context provided by VueSip's plugin manager, containing the event bus and other runtime information needed for plugin integration
config?RecordingPluginConfigOptional 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

  1. Merges provided config with default configuration
  2. Validates MediaRecorder API availability in the browser
  3. Initializes IndexedDB database and object stores (if enabled)
  4. 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 stream
  • callEnded: Automatically stops and saves the recording

Storage Behavior

If storeInIndexedDB is enabled:

  • Creates database with name from dbName config (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 maxRecordings limit is reached (if autoDeleteOld is true)
  • Prevents memory leaks by revoking object URLs and clearing blob references
Examples
typescript
const plugin = createRecordingPlugin()
await plugin.install(context)
// Plugin ready with default configuration
typescript
const 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`)
  }
})
typescript
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

Plugin.install

uninstall()
ts
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
ParameterTypeDescription
_contextPluginContextThe 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:

  1. Stop Active Recordings: Stops all recordings currently in progress for any active calls
  2. Clear Memory: Removes all recording blobs from memory to free up heap space
  3. Clear Recordings Map: Removes all recording metadata from the in-memory map
  4. Close Database: Closes the IndexedDB connection (recordings remain persisted)
  5. 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
typescript
await plugin.uninstall(context)
console.log('Recording plugin uninstalled')
typescript
// 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
typescript
// 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

Plugin.uninstall

updateConfig()
ts
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
ParameterTypeDescription
_contextPluginContextThe plugin context (unused, but required by Plugin interface)
configRecordingPluginConfigPartial 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 autoStart setting (already registered listeners remain)
  • Callbacks use updated functions immediately
  • Storage operations use updated maxRecordings limit

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:

  1. Call uninstall() to remove existing listeners
  2. Update configuration
  3. Call install() with new configuration

Alternatively, update config before initial installation.

Storage Limitations

  • Changing storeInIndexedDB does not initialize or close the database connection
  • Changing dbName has no effect after installation (database already opened)
  • To change storage settings, uninstall and reinstall the plugin

Partial Updates

The configuration is merged, not replaced:

typescript
// Only updates audioBitsPerSecond, other recordingOptions unchanged
await plugin.updateConfig(context, {
  recordingOptions: { audioBitsPerSecond: 192000 }
})
Examples
typescript
// Increase audio quality for future recordings
await plugin.updateConfig(context, {
  recordingOptions: {
    audioBitsPerSecond: 192000,  // Increase from default 128000
    mimeType: 'audio/webm;codecs=opus'
  }
})
typescript
// Increase maximum stored recordings
await plugin.updateConfig(context, {
  maxRecordings: 100,  // Increase from default 50
  autoDeleteOld: true  // Ensure old recordings are cleaned up
})
typescript
// 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)
  }
})
typescript
// Temporarily disable recording
await plugin.updateConfig(context, { enabled: false })

// Re-enable later
await plugin.updateConfig(context, { enabled: true })
Implementation of

Plugin.updateConfig

startRecording()
ts
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
ParameterTypeDescription
callIdstringUnique 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.
streamMediaStreamMediaStream 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?RecordingOptionsOptional 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

  1. Validation: Checks if call is already being recorded
  2. Configuration: Merges provided options with default configuration
  3. MIME Type Selection: Determines best supported MIME type with automatic fallback
  4. MediaRecorder Creation: Initializes MediaRecorder with stream and options
  5. Event Handlers: Sets up handlers for data collection and lifecycle events
  6. 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 ondataavailable event
  • When stopped, chunks are combined into a single Blob
  • If storeInIndexedDB is 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 autoDeleteOld is true, oldest recordings are deleted when maxRecordings is exceeded

State Transitions

Recording state progresses through these stages:

  1. 'starting': MediaRecorder created, not yet started
  2. 'recording': Actively capturing media data
  3. 'paused': Temporarily suspended (via pauseRecording())
  4. 'stopped': Finalized, blob created
  5. '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
typescript
const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
const recordingId = await plugin.startRecording('call-123', stream)
console.log(`Recording started with ID: ${recordingId}`)
typescript
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
})
typescript
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 events
typescript
try {
  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')
  }
}
typescript
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()
ts
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
ParameterTypeDescription
callIdstringUnique 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

  1. Validation: Verifies an active MediaRecorder exists for the call
  2. State Check: Only stops if MediaRecorder is not already 'inactive'
  3. Stop Signal: Calls recorder.stop() to trigger finalization
  4. Cleanup: Removes recorder from activeRecordings map
  5. Async Finalization: MediaRecorder's onstop handler 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 storeInIndexedDB is enabled, recording is saved to database
  • Blob is cleared from memory after successful save
  • onRecordingStop callback is invoked with complete recording data

Storage Behavior

When storeInIndexedDB is enabled:

  • Recording is automatically saved to IndexedDB in the onstop handler
  • 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, onRecordingError callback is invoked and state becomes 'failed'
  • If autoDeleteOld is true, oldest recordings may be deleted to stay within maxRecordings limit

Memory Management

  • Blob remains in memory until saved to IndexedDB
  • After save, blob is automatically cleared via clearRecordingBlob()
  • Recording metadata remains in recordings map 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
  • onRecordingError callback 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 onstop handler
  • If error occurs, state becomes 'failed'

Callback Invocation

After finalization completes, onRecordingStop is called with RecordingData containing:

  • id: Recording ID
  • callId: Associated call ID
  • startTime: When recording started
  • endTime: When recording stopped
  • duration: Total duration in milliseconds
  • mimeType: MIME type of the recording
  • state: 'stopped' or 'failed'
  • blob: Recording blob (if not yet cleared)
Examples
typescript
try {
  await plugin.stopRecording('call-123')
  console.log('Recording stopped')
} catch (error) {
  console.error('No active recording for this call')
}
typescript
// 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)
typescript
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)
  }
}
typescript
// 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()
ts
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
ParameterTypeDescription
callIdstringUnique 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
typescript
try {
  plugin.pauseRecording('call-123')
  console.log('Recording paused')
} catch (error) {
  console.error('Failed to pause:', error)
}
typescript
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)
  }
})
typescript
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')
  }
})
typescript
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()
ts
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
ParameterTypeDescription
callIdstringUnique 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
typescript
try {
  plugin.resumeRecording('call-123')
  console.log('Recording resumed')
} catch (error) {
  console.error('Failed to resume:', error)
}
typescript
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)
typescript
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')
}
typescript
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)
  }
}
typescript
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()
ts
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
ParameterTypeDescription
recordingIdstringUnique 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 identifier
  • callId: Associated call identifier
  • startTime: 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 recording
  • state: 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:

  1. Query IndexedDB directly using the recording ID
  2. 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
typescript
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')
}
typescript
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)
}
typescript
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>
  `
}
typescript
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`)
    }
  }
}
typescript
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()
ts
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

RecordingData[]

An array of RecordingData objects, one for each recording in memory. Each object contains:

  • id: Recording unique identifier
  • callId: Associated call identifier
  • startTime: 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 recording
  • state: 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 storeInIndexedDB is 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 startTime property
  • 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
typescript
const recordings = plugin.getAllRecordings()
console.log(`Total recordings in memory: ${recordings.length}`)

recordings.forEach(recording => {
  console.log(`${recording.id}: ${recording.state}`)
})
typescript
const activeRecordings = plugin.getAllRecordings()
  .filter(r => r.state === 'recording' || r.state === 'paused')

console.log(`Active recordings: ${activeRecordings.length}`)
typescript
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()}`)
})
typescript
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`)
  })
}
typescript
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`)
typescript
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('')
typescript
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()
ts
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 recordings Map
  • Sums the size property of each blob that exists
  • Skips recordings where blob is 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:

  1. Created when recording stops (chunks combined into blob)
  2. Stays in memory for immediate access
  3. Saved to IndexedDB (if enabled)
  4. Cleared from memory via clearRecordingBlob()
  5. 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
typescript
const memoryUsage = plugin.getMemoryUsage()
console.log(`Memory usage: ${(memoryUsage / 1024 / 1024).toFixed(2)} MB`)
typescript
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`)
}
typescript
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)
typescript
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}`)
typescript
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}%)`)
})
typescript
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 seconds
clearOldRecordingsFromMemory()
ts
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
ParameterTypeDefault valueDescription
maxAgenumber3600000Maximum 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 recordings Map
  • Recording can still be accessed via getRecording() and getAllRecordings()
  • 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:

typescript
const db = await openDatabase('vuesip-recordings')
const recording = await getFromDB(db, 'recordings', recordingId)
// recording.blob contains the blob from IndexedDB
Examples
typescript
const cleared = plugin.clearOldRecordingsFromMemory()
console.log(`Cleared ${cleared} recordings from memory`)
typescript
const thirtyMinutes = 30 * 60 * 1000
const cleared = plugin.clearOldRecordingsFromMemory(thirtyMinutes)
console.log(`Cleared ${cleared} recordings older than 30 minutes`)
typescript
// 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)
typescript
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)`)
    }
  }
}
typescript
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`)
}
typescript
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()
ts
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
ParameterTypeDescription
recordingIdstringUnique 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?stringOptional 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

  1. Validation: Verifies recording exists and has a blob
  2. Environment Check: Ensures DOM access (document and body exist)
  3. URL Creation: Creates temporary object URL for the blob
  4. Link Creation: Creates temporary anchor element with download attribute
  5. Download Trigger: Programmatically clicks the link to initiate download
  6. 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}.webm

Example: 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 (document and document.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
typescript
try {
  plugin.downloadRecording('recording-123')
  console.log('Download initiated')
} catch (error) {
  console.error('Download failed:', error)
}
typescript
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)
}
typescript
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')
}
typescript
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)
  }
})
typescript
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'
  }
}
typescript
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

typescript
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
ts
new IndexedDBAdapter(config): IndexedDBAdapter;

Defined in: src/storage/IndexedDBAdapter.ts:61

Create a new IndexedDB adapter

Parameters
ParameterTypeDescription
configStorageConfigStorage configuration
Returns

IndexedDBAdapter

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"IndexedDBAdapter"'IndexedDBAdapter'Adapter name (for debugging)src/storage/IndexedDBAdapter.ts:49

Methods

initialize()
ts
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()
ts
get<T>(key): Promise<StorageResult<T>>;

Defined in: src/storage/IndexedDBAdapter.ts:151

Get a value from storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<T>>

Promise resolving to the value or undefined if not found

Implementation of

StorageAdapter.get

set()
ts
set<T>(key, value): Promise<StorageResult<void>>;

Defined in: src/storage/IndexedDBAdapter.ts:205

Set a value in storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
valueTValue to store
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.set

remove()
ts
remove(key): Promise<StorageResult<void>>;

Defined in: src/storage/IndexedDBAdapter.ts:254

Remove a value from storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.remove

clear()
ts
clear(prefix?): Promise<StorageResult<void>>;

Defined in: src/storage/IndexedDBAdapter.ts:303

Clear all values from storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.clear

has()
ts
has(key): Promise<boolean>;

Defined in: src/storage/IndexedDBAdapter.ts:385

Check if a key exists in storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<boolean>

Promise resolving to true if key exists

Implementation of

StorageAdapter.has

keys()
ts
keys(prefix?): Promise<string[]>;

Defined in: src/storage/IndexedDBAdapter.ts:421

Get all keys in storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<string[]>

Promise resolving to array of keys

Implementation of

StorageAdapter.keys

close()
ts
close(): Promise<void>;

Defined in: src/storage/IndexedDBAdapter.ts:463

Close the database connection

Returns

Promise<void>

deleteDatabase()
ts
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

typescript
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
ts
new LocalStorageAdapter(config, encryptionPassword?): LocalStorageAdapter;

Defined in: src/storage/LocalStorageAdapter.ts:60

Create a new LocalStorage adapter

Parameters
ParameterTypeDescription
configStorageConfigStorage configuration
encryptionPassword?stringOptional password for encrypting sensitive data
Returns

LocalStorageAdapter

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"LocalStorageAdapter"'LocalStorageAdapter'Adapter name (for debugging)src/storage/LocalStorageAdapter.ts:51

Methods

get()
ts
get<T>(key): Promise<StorageResult<T>>;

Defined in: src/storage/LocalStorageAdapter.ts:120

Get a value from storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<T>>

Promise resolving to the value or null if not found

Implementation of

StorageAdapter.get

set()
ts
set<T>(key, value): Promise<StorageResult<void>>;

Defined in: src/storage/LocalStorageAdapter.ts:191

Set a value in storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
valueTValue to store
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.set

remove()
ts
remove(key): Promise<StorageResult<void>>;

Defined in: src/storage/LocalStorageAdapter.ts:244

Remove a value from storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.remove

clear()
ts
clear(prefix?): Promise<StorageResult<void>>;

Defined in: src/storage/LocalStorageAdapter.ts:271

Clear all values from storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.clear

has()
ts
has(key): Promise<boolean>;

Defined in: src/storage/LocalStorageAdapter.ts:310

Check if a key exists in storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<boolean>

Promise resolving to true if key exists

Implementation of

StorageAdapter.has

keys()
ts
keys(prefix?): Promise<string[]>;

Defined in: src/storage/LocalStorageAdapter.ts:324

Get all keys in storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<string[]>

Promise resolving to array of keys

Implementation of

StorageAdapter.keys


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

typescript
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
ts
new SessionStorageAdapter(config, encryptionPassword?): SessionStorageAdapter;

Defined in: src/storage/SessionStorageAdapter.ts:62

Create a new SessionStorage adapter

Parameters
ParameterTypeDescription
configStorageConfigStorage configuration
encryptionPassword?stringOptional password for encrypting sensitive data
Returns

SessionStorageAdapter

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"SessionStorageAdapter"'SessionStorageAdapter'Adapter name (for debugging)src/storage/SessionStorageAdapter.ts:53

Methods

get()
ts
get<T>(key): Promise<StorageResult<T>>;

Defined in: src/storage/SessionStorageAdapter.ts:122

Get a value from storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<T>>

Promise resolving to the value or null if not found

Implementation of

StorageAdapter.get

set()
ts
set<T>(key, value): Promise<StorageResult<void>>;

Defined in: src/storage/SessionStorageAdapter.ts:193

Set a value in storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
valueTValue to store
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.set

remove()
ts
remove(key): Promise<StorageResult<void>>;

Defined in: src/storage/SessionStorageAdapter.ts:246

Remove a value from storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.remove

clear()
ts
clear(prefix?): Promise<StorageResult<void>>;

Defined in: src/storage/SessionStorageAdapter.ts:273

Clear all values from storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<StorageResult<void>>

Promise resolving to success status

Implementation of

StorageAdapter.clear

has()
ts
has(key): Promise<boolean>;

Defined in: src/storage/SessionStorageAdapter.ts:312

Check if a key exists in storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<boolean>

Promise resolving to true if key exists

Implementation of

StorageAdapter.has

keys()
ts
keys(prefix?): Promise<string[]>;

Defined in: src/storage/SessionStorageAdapter.ts:326

Get all keys in storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<string[]>

Promise resolving to array of keys

Implementation of

StorageAdapter.keys


PersistenceManager

Defined in: src/storage/persistence.ts:43

Persistence manager for a store

Type Parameters

Type Parameter
T

Constructors

Constructor
ts
new PersistenceManager<T>(options): PersistenceManager<T>;

Defined in: src/storage/persistence.ts:54

Parameters
ParameterType
optionsPersistenceOptions<T>
Returns

PersistenceManager<T>

Methods

save()
ts
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()
ts
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()
ts
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()
ts
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

ts
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
ts
new KeywordDetector(): KeywordDetector;
Returns

KeywordDetector

Methods

addRule()
ts
addRule(rule): string;

Defined in: src/transcription/features/keyword-detector.ts:40

Add a keyword detection rule

Parameters
ParameterTypeDescription
ruleOmit<KeywordRule, "id">Rule configuration (without id)
Returns

string

Generated rule ID

removeRule()
ts
removeRule(id): void;

Defined in: src/transcription/features/keyword-detector.ts:52

Remove a rule by ID

Parameters
ParameterTypeDescription
idstringRule ID to remove
Returns

void

getRules()
ts
getRules(): KeywordRule[];

Defined in: src/transcription/features/keyword-detector.ts:63

Get all registered rules

Returns

KeywordRule[]

clearRules()
ts
clearRules(): void;

Defined in: src/transcription/features/keyword-detector.ts:70

Clear all rules

Returns

void

detect()
ts
detect(entry): KeywordMatch[];

Defined in: src/transcription/features/keyword-detector.ts:80

Detect keywords in a transcript entry

Parameters
ParameterTypeDescription
entryTranscriptEntryTranscript entry to scan
Returns

KeywordMatch[]

Array of matches found

onMatch()
ts
onMatch(callback): () => void;

Defined in: src/transcription/features/keyword-detector.ts:159

Register callback for keyword matches

Parameters
ParameterTypeDescription
callback(match) => voidFunction called when keyword is detected
Returns

Unsubscribe function

ts
(): void;
Returns

void

dispose()
ts
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

ts
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
ts
new PIIRedactor(config): PIIRedactor;

Defined in: src/transcription/features/pii-redactor.ts:53

Parameters
ParameterType
configPartial<RedactionConfig>
Returns

PIIRedactor

Methods

configure()
ts
configure(config): void;

Defined in: src/transcription/features/pii-redactor.ts:95

Update redaction configuration

Parameters
ParameterType
configPartial<RedactionConfig>
Returns

void

isEnabled()
ts
isEnabled(): boolean;

Defined in: src/transcription/features/pii-redactor.ts:103

Check if redaction is enabled

Returns

boolean

redact()
ts
redact(text): RedactionResult;

Defined in: src/transcription/features/pii-redactor.ts:112

Redact PII from text

Parameters
ParameterTypeDescription
textstringText to redact
Returns

RedactionResult

Redaction result with original, redacted text, and detections

redactEntry()
ts
redactEntry(entry): TranscriptEntry;

Defined in: src/transcription/features/pii-redactor.ts:189

Redact PII from a transcript entry and call callback

Parameters
ParameterTypeDescription
entryTranscriptEntryTranscript entry to redact
Returns

TranscriptEntry

Modified entry with redacted text

dispose()
ts
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

ts
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
ts
new TranscriptExporter(): TranscriptExporter;
Returns

TranscriptExporter

Methods

export()
ts
export(
   entries, 
   format, 
   options): string;

Defined in: src/transcription/features/transcript-exporter.ts:76

Export transcript entries to specified format

Parameters
ParameterTypeDescription
entriesTranscriptEntry[]Transcript entries to export
formatExportFormatExport format
optionsExportOptionsExport options
Returns

string

Formatted string


ProviderRegistry

Defined in: src/transcription/providers/registry.ts:26

Registry for managing transcription providers

Example

ts
const registry = new ProviderRegistry()
registry.register('web-speech', () => new WebSpeechProvider())
const provider = await registry.get('web-speech', { language: 'en-US' })

Constructors

Constructor
ts
new ProviderRegistry(): ProviderRegistry;
Returns

ProviderRegistry

Methods

register()
ts
register(name, factory): void;

Defined in: src/transcription/providers/registry.ts:36

Register a provider factory

Parameters
ParameterTypeDescription
namestringUnique provider name
factoryProviderFactoryFactory function that creates provider instances
Returns

void

Throws

Error if provider name already registered

has()
ts
has(name): boolean;

Defined in: src/transcription/providers/registry.ts:48

Check if a provider is registered

Parameters
ParameterTypeDescription
namestringProvider name to check
Returns

boolean

get()
ts
get(name, options): Promise<TranscriptionProvider>;

Defined in: src/transcription/providers/registry.ts:59

Get or create a provider instance

Parameters
ParameterTypeDescription
namestringProvider name
optionsProviderOptionsProvider initialization options
Returns

Promise<TranscriptionProvider>

Initialized provider instance

Throws

Error if provider not found

getAvailable()
ts
getAvailable(): string[];

Defined in: src/transcription/providers/registry.ts:84

Get list of registered provider names

Returns

string[]

dispose()
ts
dispose(): void;

Defined in: src/transcription/providers/registry.ts:91

Dispose all cached provider instances

Returns

void

remove()
ts
remove(name): void;

Defined in: src/transcription/providers/registry.ts:107

Remove a cached provider instance (forces re-creation on next get)

Parameters
ParameterTypeDescription
namestringProvider 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

ts
const provider = new WebSpeechProvider()
await provider.initialize({ language: 'en-US' })
provider.onFinal((result) => console.log(result.text))
provider.startStream(audioSource)

Implements

Constructors

Constructor
ts
new WebSpeechProvider(): WebSpeechProvider;
Returns

WebSpeechProvider

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"web-speech"'web-speech'Provider identifiersrc/transcription/providers/web-speech.ts:64
capabilitiesreadonlyProviderCapabilitiesundefinedProvider capabilitiessrc/transcription/providers/web-speech.ts:66

Methods

initialize()
ts
initialize(options): Promise<void>;

Defined in: src/transcription/providers/web-speech.ts:112

Initialize the Web Speech API

Parameters
ParameterType
optionsProviderOptions
Returns

Promise<void>

Implementation of

TranscriptionProvider.initialize

startStream()
ts
startStream(audioSource): void;

Defined in: src/transcription/providers/web-speech.ts:184

Start transcribing audio

Parameters
ParameterType
audioSourceAudioSource
Returns

void

Implementation of

TranscriptionProvider.startStream

stopStream()
ts
stopStream(): void;

Defined in: src/transcription/providers/web-speech.ts:204

Stop transcribing

Returns

void

Implementation of

TranscriptionProvider.stopStream

onInterim()
ts
onInterim(callback): void;

Defined in: src/transcription/providers/web-speech.ts:215

Register interim result callback

Parameters
ParameterType
callback(text, sourceId) => void
Returns

void

Implementation of

TranscriptionProvider.onInterim

onFinal()
ts
onFinal(callback): void;

Defined in: src/transcription/providers/web-speech.ts:222

Register final result callback

Parameters
ParameterType
callback(result, sourceId) => void
Returns

void

Implementation of

TranscriptionProvider.onFinal

onError()
ts
onError(callback): void;

Defined in: src/transcription/providers/web-speech.ts:229

Register error callback

Parameters
ParameterType
callback(error) => void
Returns

void

Implementation of

TranscriptionProvider.onError

dispose()
ts
dispose(): void;

Defined in: src/transcription/providers/web-speech.ts:236

Clean up resources

Returns

void

Implementation of

TranscriptionProvider.dispose


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

ts
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
ts
new WhisperProvider(): WhisperProvider;
Returns

WhisperProvider

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"whisper"'whisper'Provider identifiersrc/transcription/providers/whisper.ts:84
capabilitiesreadonlyProviderCapabilitiesundefinedProvider capabilitiessrc/transcription/providers/whisper.ts:86

Methods

initialize()
ts
initialize(options): Promise<void>;

Defined in: src/transcription/providers/whisper.ts:229

Initialize the Whisper provider

Parameters
ParameterType
optionsWhisperProviderOptions
Returns

Promise<void>

Implementation of

TranscriptionProvider.initialize

startStream()
ts
startStream(audioSource): void;

Defined in: src/transcription/providers/whisper.ts:404

Start transcribing an audio source

Parameters
ParameterType
audioSourceAudioSource
Returns

void

Implementation of

TranscriptionProvider.startStream

stopStream()
ts
stopStream(): void;

Defined in: src/transcription/providers/whisper.ts:504

Stop transcribing

Returns

void

Implementation of

TranscriptionProvider.stopStream

onInterim()
ts
onInterim(callback): void;

Defined in: src/transcription/providers/whisper.ts:537

Register interim result callback

Parameters
ParameterType
callback(text, sourceId) => void
Returns

void

Implementation of

TranscriptionProvider.onInterim

onFinal()
ts
onFinal(callback): void;

Defined in: src/transcription/providers/whisper.ts:544

Register final result callback

Parameters
ParameterType
callback(result, sourceId) => void
Returns

void

Implementation of

TranscriptionProvider.onFinal

onError()
ts
onError(callback): void;

Defined in: src/transcription/providers/whisper.ts:551

Register error callback

Parameters
ParameterType
callback(error) => void
Returns

void

Implementation of

TranscriptionProvider.onError

detectLanguage()
ts
detectLanguage(): Promise<string>;

Defined in: src/transcription/providers/whisper.ts:558

Detect language from audio sample

Returns

Promise<string>

Implementation of

TranscriptionProvider.detectLanguage

getSupportedLanguages()
ts
getSupportedLanguages(): string[];

Defined in: src/transcription/providers/whisper.ts:566

Get supported languages

Returns

string[]

Implementation of

TranscriptionProvider.getSupportedLanguages

dispose()
ts
dispose(): void;

Defined in: src/transcription/providers/whisper.ts:573

Clean up resources

Returns

void

Implementation of

TranscriptionProvider.dispose


Logger

Defined in: src/utils/logger.ts:131

Logger class with namespace support

Constructors

Constructor
ts
new Logger(namespace): Logger;

Defined in: src/utils/logger.ts:142

Creates a new logger instance

Parameters
ParameterTypeDescription
namespacestringLogger namespace (e.g., 'SipClient', 'CallSession')
Returns

Logger

Methods

debug()
ts
debug(message, ...args): void;

Defined in: src/utils/logger.ts:158

Logs a debug message

Parameters
ParameterTypeDescription
messagestringLog message
...argsunknown[]Additional arguments to log
Returns

void

Example
typescript
const logger = new Logger('MyComponent')
logger.debug('Debug message', { foo: 'bar' })
info()
ts
info(message, ...args): void;

Defined in: src/utils/logger.ts:173

Logs an info message

Parameters
ParameterTypeDescription
messagestringLog message
...argsunknown[]Additional arguments to log
Returns

void

Example
typescript
logger.info('User connected', { userId: '123' })
warn()
ts
warn(message, ...args): void;

Defined in: src/utils/logger.ts:188

Logs a warning message

Parameters
ParameterTypeDescription
messagestringLog message
...argsunknown[]Additional arguments to log
Returns

void

Example
typescript
logger.warn('Connection slow', { latency: 500 })
error()
ts
error(message, ...args): void;

Defined in: src/utils/logger.ts:203

Logs an error message

Parameters
ParameterTypeDescription
messagestringLog message
...argsunknown[]Additional arguments to log (can include Error objects)
Returns

void

Example
typescript
logger.error('Connection failed', new Error('Network error'))
child()
ts
child(childNamespace): Logger;

Defined in: src/utils/logger.ts:278

Creates a child logger with an extended namespace

Parameters
ParameterTypeDescription
childNamespacestringChild namespace to append
Returns

Logger

New logger instance

Example
typescript
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

PropertyTypeDescriptionDefined in
autoEnterOnAnswer?booleanAuto-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 falsesrc/composables/types.ts:25
autoExitOnEnd?booleanAuto-exit PiP when call ends When true, PiP mode will automatically deactivate when the call terminates or fails. Default truesrc/composables/types.ts:33
persistPreference?booleanPersist PiP preference to localStorage When true, the user's PiP preference will be saved and restored across sessions. Default falsesrc/composables/types.ts:41

UseAmiReturn

Defined in: src/composables/useAmi.ts:42

Return type for useAmi composable

Properties

PropertyTypeDescriptionDefined in
connectionStateRef<AmiConnectionState>AMI connection statesrc/composables/useAmi.ts:45
isConnectedComputedRef<boolean>Whether connected to AMIsrc/composables/useAmi.ts:47
errorRef<string | null>Connection error messagesrc/composables/useAmi.ts:49
presenceStatesRef<Map<string, AmiPresenceState>>Map of extension presence statessrc/composables/useAmi.ts:51
discoveredStatesRef<Set<string>>List of discovered presence states (from events)src/composables/useAmi.ts:53
connect(config) => Promise<void>Connect to AMI WebSocketsrc/composables/useAmi.ts:57
disconnect() => voidDisconnect from AMIsrc/composables/useAmi.ts:59
getPresenceState(extension) => Promise<AmiPresenceState>Get presence state for extensionsrc/composables/useAmi.ts:61
setPresenceState(extension, state, message?) => Promise<void>Set presence state for extensionsrc/composables/useAmi.ts:63
queryExtensions(extensions) => Promise<Map<string, AmiPresenceState>>Query multiple extensionssrc/composables/useAmi.ts:65
onEvent(callback) => () => voidListen for AMI eventssrc/composables/useAmi.ts:67
onPresenceChange(callback) => () => voidListen for presence changessrc/composables/useAmi.ts:69
getClient() => AmiClient | nullGet underlying AMI clientsrc/composables/useAmi.ts:71

UseAmiCallsReturn

Defined in: src/composables/useAmiCalls.ts:34

Return type for useAmiCalls composable

Properties

PropertyTypeDescriptionDefined in
callsRef<Map<string, ActiveCall>>Map of active calls by unique IDsrc/composables/useAmiCalls.ts:37
channelsRef<ChannelInfo[]>Raw channel listsrc/composables/useAmiCalls.ts:39
loadingRef<boolean>Loading statesrc/composables/useAmiCalls.ts:41
errorRef<string | null>Error messagesrc/composables/useAmiCalls.ts:43
lastRefreshRef<Date | null>Last refresh timestampsrc/composables/useAmiCalls.ts:45
callListComputedRef<ActiveCall[]>List of active callssrc/composables/useAmiCalls.ts:49
callCountComputedRef<number>Number of active callssrc/composables/useAmiCalls.ts:51
ringingCallsComputedRef<ActiveCall[]>Calls in ringing statesrc/composables/useAmiCalls.ts:53
connectedCallsComputedRef<ActiveCall[]>Calls in connected/up statesrc/composables/useAmiCalls.ts:55
dialingCallsComputedRef<ActiveCall[]>Calls in dialing statesrc/composables/useAmiCalls.ts:57
totalDurationComputedRef<number>Total call duration across all callssrc/composables/useAmiCalls.ts:59
refresh() => Promise<void>Refresh channel listsrc/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 callsrc/composables/useAmiCalls.ts:69
transfer(channelOrUniqueId, destination, context?) => Promise<void>Transfer a callsrc/composables/useAmiCalls.ts:71
getStateLabel(state) => stringGet state labelsrc/composables/useAmiCalls.ts:73

UseAmiDatabaseReturn

Defined in: src/composables/useAmiDatabase.ts:37

Return type for useAmiDatabase composable

Properties

PropertyTypeDescriptionDefined in
contactsRef<Map<string, AmiContact>>Map of contacts by IDsrc/composables/useAmiDatabase.ts:40
groupsRef<string[]>Available groupssrc/composables/useAmiDatabase.ts:42
loadingRef<boolean>Loading statesrc/composables/useAmiDatabase.ts:44
errorRef<string | null>Error messagesrc/composables/useAmiDatabase.ts:46
contactListComputedRef<AmiContact[]>List of all contactssrc/composables/useAmiDatabase.ts:50
contactsByGroupComputedRef<Map<string, ContactGroup>>Contacts grouped by groupsrc/composables/useAmiDatabase.ts:52
contactCountComputedRef<number>Total contact countsrc/composables/useAmiDatabase.ts:54
refresh() => Promise<void>Refresh contacts from AstDBsrc/composables/useAmiDatabase.ts:58
getContact(id) => Promise<AmiContact | null>Get a contact by IDsrc/composables/useAmiDatabase.ts:60
saveContact(contact) => Promise<AmiContact>Save a contactsrc/composables/useAmiDatabase.ts:62
deleteContact(id) => Promise<void>Delete a contactsrc/composables/useAmiDatabase.ts:64
search(query) => AmiContact[]Search contactssrc/composables/useAmiDatabase.ts:66
getByGroup(group) => AmiContact[]Get contacts by groupsrc/composables/useAmiDatabase.ts:68
getGroups() => string[]Get available groupssrc/composables/useAmiDatabase.ts:70
addGroup(group) => voidAdd a groupsrc/composables/useAmiDatabase.ts:72
getFieldDefinitions() => ContactFieldDefinition[]Get field definitionssrc/composables/useAmiDatabase.ts:74
dbGet(family, key) => Promise<string | null>Raw DB operationssrc/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 arraysrc/composables/useAmiDatabase.ts:83
registerKnownId(id) => voidRegister 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

PropertyTypeDescriptionDefined in
parkingLotsRef<Map<string, ParkingLotStatus>>Map of parking lots by namesrc/composables/useAmiParking.ts:34
parkedCallsComputedRef<ParkedCall[]>All parked calls across all lotssrc/composables/useAmiParking.ts:36
isLoadingRef<boolean>Whether currently loadingsrc/composables/useAmiParking.ts:38
errorRef<string | null>Error message if anysrc/composables/useAmiParking.ts:40
totalParkedCallsComputedRef<number>Total parked calls countsrc/composables/useAmiParking.ts:42
getParkingLots() => Promise<ParkingLot[]>Get all parking lots configurationsrc/composables/useAmiParking.ts:46
getParkedCalls(parkingLot?) => Promise<ParkedCall[]>Get parked calls in a lotsrc/composables/useAmiParking.ts:48
parkCall(channel, parkingLot?, timeout?) => Promise<number>Park a callsrc/composables/useAmiParking.ts:50
retrieveCall(parkingSpace, channel, parkingLot?) => Promise<void>Retrieve a parked callsrc/composables/useAmiParking.ts:52
refreshParkingLot(parkingLot?) => Promise<void>Refresh parking lot statussrc/composables/useAmiParking.ts:54
getParkedCallBySpace(parkingSpace, parkingLot?) => ParkedCall | undefinedGet parked call by space numbersrc/composables/useAmiParking.ts:56
onParkingEvent(callback) => () => voidListen for parking eventssrc/composables/useAmiParking.ts:58

UseAmiPeersReturn

Defined in: src/composables/useAmiPeers.ts:40

Return type for useAmiPeers composable

Properties

PropertyTypeDescriptionDefined in
peersRef<Map<string, PeerInfo>>Map of peers by object namesrc/composables/useAmiPeers.ts:43
loadingRef<boolean>Loading statesrc/composables/useAmiPeers.ts:45
errorRef<string | null>Error messagesrc/composables/useAmiPeers.ts:47
lastRefreshRef<Date | null>Last refresh timestampsrc/composables/useAmiPeers.ts:49
peerListComputedRef<PeerInfo[]>List of all peerssrc/composables/useAmiPeers.ts:53
sipPeersComputedRef<PeerInfo[]>SIP peers onlysrc/composables/useAmiPeers.ts:55
pjsipPeersComputedRef<PeerInfo[]>PJSIP peers onlysrc/composables/useAmiPeers.ts:57
onlinePeersComputedRef<PeerInfo[]>Online peerssrc/composables/useAmiPeers.ts:59
offlinePeersComputedRef<PeerInfo[]>Offline peerssrc/composables/useAmiPeers.ts:61
statusSummaryComputedRef<PeerStatusSummary>Status summarysrc/composables/useAmiPeers.ts:63
refresh() => Promise<void>Refresh all peer datasrc/composables/useAmiPeers.ts:67
refreshSipPeers() => Promise<void>Refresh SIP peers onlysrc/composables/useAmiPeers.ts:69
refreshPjsipPeers() => Promise<void>Refresh PJSIP endpoints onlysrc/composables/useAmiPeers.ts:71
getPeer(name) => PeerInfo | undefinedGet peer by namesrc/composables/useAmiPeers.ts:73
isOnline(nameOrPeer) => booleanCheck if peer is onlinesrc/composables/useAmiPeers.ts:75

UseAmiQueuesReturn

Defined in: src/composables/useAmiQueues.ts:36

Return type for useAmiQueues composable

Properties

PropertyTypeDescriptionDefined in
queuesRef<Map<string, QueueInfo>>Map of queue name to queue infosrc/composables/useAmiQueues.ts:39
summariesRef<QueueSummary[]>Queue summaries (quick stats)src/composables/useAmiQueues.ts:41
loadingRef<boolean>Loading statesrc/composables/useAmiQueues.ts:43
errorRef<string | null>Error messagesrc/composables/useAmiQueues.ts:45
lastRefreshRef<Date | null>Last refresh timestampsrc/composables/useAmiQueues.ts:47
queueListComputedRef<QueueInfo[]>List of all queuessrc/composables/useAmiQueues.ts:51
totalCallersComputedRef<number>Total callers waiting across all queuessrc/composables/useAmiQueues.ts:53
totalAvailableComputedRef<number>Total available agents across all queuessrc/composables/useAmiQueues.ts:55
totalPausedComputedRef<number>Total paused agents across all queuessrc/composables/useAmiQueues.ts:57
longestWaitComputedRef< | { queue: string; wait: number; } | null>Queue with longest wait timesrc/composables/useAmiQueues.ts:59
overallServiceLevelComputedRef<number>Overall service level across all queuessrc/composables/useAmiQueues.ts:61
refresh() => Promise<void>Refresh all queue datasrc/composables/useAmiQueues.ts:65
refreshQueue(queueName) => Promise<void>Refresh specific queuesrc/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 membersrc/composables/useAmiQueues.ts:71
unpauseMember(queue, iface) => Promise<void>Unpause a queue membersrc/composables/useAmiQueues.ts:73
addMember(queue, iface, options?) => Promise<void>Add member to queuesrc/composables/useAmiQueues.ts:75
removeMember(queue, iface) => Promise<void>Remove member from queuesrc/composables/useAmiQueues.ts:77
setPenalty(queue, iface, penalty) => Promise<void>Set member penaltysrc/composables/useAmiQueues.ts:79
getPauseReasons() => string[]Get configured pause reasonssrc/composables/useAmiQueues.ts:81
getStatusLabel(status) => stringGet status label for a member statussrc/composables/useAmiQueues.ts:83

UseAmiSupervisorReturn

Defined in: src/composables/useAmiSupervisor.ts:46

Return type for useAmiSupervisor composable

Properties

PropertyTypeDescriptionDefined in
sessionsRef<Map<string, SupervisionSession>>Active supervision sessionssrc/composables/useAmiSupervisor.ts:49
loadingRef<boolean>Loading statesrc/composables/useAmiSupervisor.ts:51
errorRef<string | null>Error messagesrc/composables/useAmiSupervisor.ts:53
monitor(supervisorExtension, targetChannel) => Promise<SupervisionSession>Start silent monitoringsrc/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 sessionsrc/composables/useAmiSupervisor.ts:63
endAllSessions() => Promise<void>End all supervision sessionssrc/composables/useAmiSupervisor.ts:65
isSupervising(targetChannel) => booleanCheck if supervising a channelsrc/composables/useAmiSupervisor.ts:67
getSessionForChannel(targetChannel) => SupervisionSession | undefinedGet session for target channelsrc/composables/useAmiSupervisor.ts:69
switchMode(sessionId, newMode) => Promise<SupervisionSession>Switch supervision mode for an existing sessionsrc/composables/useAmiSupervisor.ts:71
activeSessionCountComputedRef<number>Get active session countsrc/composables/useAmiSupervisor.ts:73

UseAmiVoicemailReturn

Defined in: src/composables/useAmiVoicemail.ts:27

Return type for useAmiVoicemail composable

Properties

PropertyTypeDescriptionDefined in
mwiStatesRef<Map<string, MwiState>>Map of MWI states by mailboxsrc/composables/useAmiVoicemail.ts:30
mailboxesRef<Map<string, MailboxInfo>>Map of mailbox info by mailboxsrc/composables/useAmiVoicemail.ts:32
isLoadingRef<boolean>Whether currently loadingsrc/composables/useAmiVoicemail.ts:34
errorRef<string | null>Error message if anysrc/composables/useAmiVoicemail.ts:36
totalNewMessagesComputedRef<number>Total new messages across all monitored mailboxessrc/composables/useAmiVoicemail.ts:38
totalOldMessagesComputedRef<number>Total old messages across all monitored mailboxessrc/composables/useAmiVoicemail.ts:40
hasWaitingMessagesComputedRef<boolean>Whether any mailbox has waiting messagessrc/composables/useAmiVoicemail.ts:42
getMwiState(mailbox, context?) => Promise<MwiState>Get MWI state for a mailboxsrc/composables/useAmiVoicemail.ts:46
getMailboxInfo(mailbox, context?) => Promise<MailboxInfo | null>Get mailbox infosrc/composables/useAmiVoicemail.ts:48
getVoicemailUsers(context?) => Promise<MailboxInfo[]>Get all voicemail userssrc/composables/useAmiVoicemail.ts:50
refreshMailbox(mailbox, context?) => Promise<void>Refresh MWI for a mailboxsrc/composables/useAmiVoicemail.ts:52
monitorMailbox(mailbox, context?) => voidMonitor a mailbox for MWI changessrc/composables/useAmiVoicemail.ts:54
unmonitorMailbox(mailbox, context?) => voidStop monitoring a mailboxsrc/composables/useAmiVoicemail.ts:56
clearMonitoring() => voidClear all monitored mailboxessrc/composables/useAmiVoicemail.ts:58
onMwiChange(callback) => () => voidListen for MWI changessrc/composables/useAmiVoicemail.ts:60

ActiveTransfer

Defined in: src/composables/useCallControls.ts:28

Active transfer information

Properties

PropertyTypeDescriptionDefined in
idstringTransfer IDsrc/composables/useCallControls.ts:30
stateTransferStateTransfer statesrc/composables/useCallControls.ts:32
typeTransferTypeTransfer typesrc/composables/useCallControls.ts:34
targetstringTarget URIsrc/composables/useCallControls.ts:36
callIdstringCall being transferredsrc/composables/useCallControls.ts:38
consultationCallId?stringConsultation call ID (for attended transfer)src/composables/useCallControls.ts:40
initiatedAtDateInitiated timestampsrc/composables/useCallControls.ts:42
completedAt?DateCompleted timestampsrc/composables/useCallControls.ts:44
error?stringError message (if failed)src/composables/useCallControls.ts:46

UseCallControlsReturn

Defined in: src/composables/useCallControls.ts:52

Return type for useCallControls composable

Properties

PropertyTypeDescriptionDefined in
activeTransferRef<ActiveTransfer | null>Active transfer (if any)src/composables/useCallControls.ts:58
transferStateComputedRef<TransferState>Transfer statesrc/composables/useCallControls.ts:60
isTransferringComputedRef<boolean>Whether a transfer is in progresssrc/composables/useCallControls.ts:62
consultationCallRef<CallSession | null>Consultation call for attended transfersrc/composables/useCallControls.ts:64
blindTransfer(callId, targetUri, extraHeaders?) => Promise<void>Perform blind transfersrc/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 transfersrc/composables/useCallControls.ts:77
forwardCall(callId, targetUri) => Promise<void>Forward call to target URIsrc/composables/useCallControls.ts:79
getTransferProgress() => TransferProgress | nullGet transfer progresssrc/composables/useCallControls.ts:81
onTransferEvent(callback) => () => voidListen for transfer eventssrc/composables/useCallControls.ts:83

UseCallHistoryReturn

Defined in: src/composables/useCallHistory.ts:28

Return type for useCallHistory composable

Properties

PropertyTypeDescriptionDefined in
historyComputedRef<readonly CallHistoryEntry[]>All call history entriessrc/composables/useCallHistory.ts:34
filteredHistoryComputedRef<readonly CallHistoryEntry[]>Filtered history entriessrc/composables/useCallHistory.ts:36
totalCallsComputedRef<number>Total number of calls in historysrc/composables/useCallHistory.ts:38
missedCallsCountComputedRef<number>Total number of missed callssrc/composables/useCallHistory.ts:40
currentFilterRef<HistoryFilter | null>Current filtersrc/composables/useCallHistory.ts:42
getHistory(filter?) => HistorySearchResultGet history with optional filtersrc/composables/useCallHistory.ts:49
searchHistory(query, filter?) => HistorySearchResultSearch history by querysrc/composables/useCallHistory.ts:51
clearHistory() => Promise<void>Clear all historysrc/composables/useCallHistory.ts:53
deleteEntry(entryId) => Promise<void>Delete a specific entrysrc/composables/useCallHistory.ts:55
exportHistory(options) => Promise<void>Export history to filesrc/composables/useCallHistory.ts:57
getStatistics(filter?) => HistoryStatisticsGet history statisticssrc/composables/useCallHistory.ts:59
setFilter(filter) => voidSet current filtersrc/composables/useCallHistory.ts:61
getMissedCalls() => readonly CallHistoryEntry[]Get missed calls onlysrc/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

PropertyTypeDescriptionDefined in
audio?booleanEnable audio (default: true)src/composables/useCallSession.ts:38
video?booleanEnable video (default: false)src/composables/useCallSession.ts:40
data?Record<string, unknown>Custom call datasrc/composables/useCallSession.ts:42
autoCleanup?booleanAuto-cleanup on hangup (default: true)src/composables/useCallSession.ts:44

UseCallSessionReturn

Defined in: src/composables/useCallSession.ts:50

Return type for useCallSession composable

Properties

PropertyTypeDescriptionDefined in
sessionRef<CallSession | null>Active call sessionsrc/composables/useCallSession.ts:56
stateComputedRef<CallState>Call statesrc/composables/useCallSession.ts:58
callIdComputedRef<string | null>Call IDsrc/composables/useCallSession.ts:60
directionComputedRef<CallDirection | null>Call directionsrc/composables/useCallSession.ts:62
localUriComputedRef<string | null>Local SIP URIsrc/composables/useCallSession.ts:64
remoteUriComputedRef<string | null>Remote SIP URIsrc/composables/useCallSession.ts:66
remoteDisplayNameComputedRef<string | null>Remote display namesrc/composables/useCallSession.ts:68
isActiveComputedRef<boolean>Is call activesrc/composables/useCallSession.ts:70
isOnHoldComputedRef<boolean>Is on holdsrc/composables/useCallSession.ts:72
isMutedComputedRef<boolean>Is mutedsrc/composables/useCallSession.ts:74
hasRemoteVideoComputedRef<boolean>Has remote videosrc/composables/useCallSession.ts:76
hasLocalVideoComputedRef<boolean>Has local videosrc/composables/useCallSession.ts:78
localStreamComputedRef<MediaStream | null>Local media streamsrc/composables/useCallSession.ts:80
remoteStreamComputedRef<MediaStream | null>Remote media streamsrc/composables/useCallSession.ts:82
timingComputedRef<CallTimingInfo>Call timing informationsrc/composables/useCallSession.ts:84
durationComputedRef<number>Call duration in seconds (if active)src/composables/useCallSession.ts:86
terminationCauseComputedRef<TerminationCause | undefined>Termination cause (if ended)src/composables/useCallSession.ts:88
makeCall(target, options?, signal?) => Promise<void>Make an outgoing call with optional abort signalsrc/composables/useCallSession.ts:95
answer(options?) => Promise<void>Answer an incoming callsrc/composables/useCallSession.ts:97
reject(statusCode?) => Promise<void>Reject an incoming callsrc/composables/useCallSession.ts:99
hangup() => Promise<void>Hangup the callsrc/composables/useCallSession.ts:101
hold() => Promise<void>Put call on holdsrc/composables/useCallSession.ts:103
unhold() => Promise<void>Resume call from holdsrc/composables/useCallSession.ts:105
toggleHold() => Promise<void>Toggle hold statesrc/composables/useCallSession.ts:107
mute() => voidMute audiosrc/composables/useCallSession.ts:109
unmute() => voidUnmute audiosrc/composables/useCallSession.ts:111
toggleMute() => voidToggle mute statesrc/composables/useCallSession.ts:113
disableVideo() => voidDisable videosrc/composables/useCallSession.ts:115
enableVideo() => voidEnable videosrc/composables/useCallSession.ts:117
toggleVideo() => voidToggle video statesrc/composables/useCallSession.ts:119
sendDTMF(tone, options?) => Promise<void>Send DTMF tonesrc/composables/useCallSession.ts:121
getStats() => Promise<CallStatistics | null>Get call statisticssrc/composables/useCallSession.ts:123
clearSession() => voidClear current sessionsrc/composables/useCallSession.ts:125
transferCall(target, options) => Promise<TransferResult>Transfer call (blind or attended)src/composables/useCallSession.ts:127
isPiPSupportedRef<boolean>Whether PiP is supported by the browsersrc/composables/useCallSession.ts:134
isPiPActiveRef<boolean>Whether PiP mode is currently activesrc/composables/useCallSession.ts:136
pipWindowRef<PictureInPictureWindow | null>Current PiP window reference (dimensions accessible)src/composables/useCallSession.ts:138
pipErrorRef<Error | null>Current PiP error statesrc/composables/useCallSession.ts:140
setVideoRef(element) => voidSet video element for PiPsrc/composables/useCallSession.ts:142
enterPiP(videoElement?) => Promise<PictureInPictureWindow | null>Enter PiP modesrc/composables/useCallSession.ts:148
exitPiP() => Promise<void>Exit PiP modesrc/composables/useCallSession.ts:150
togglePiP(videoElement?) => Promise<void>Toggle PiP modesrc/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

PropertyTypeDescriptionDefined in
conferenceRef<ConferenceStateInterface | null>Current conference state object containing all conference data Remarks Null when no conference exists, populated after creating or joiningsrc/composables/useConference.ts:48
stateComputedRef<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
participantsComputedRef<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
localParticipantComputedRef<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
participantCountComputedRef<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
isActiveComputedRef<boolean>Whether the conference is currently active Remarks True only when state is ConferenceState.Activesrc/composables/useConference.ts:79
isLockedComputedRef<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
isRecordingComputedRef<boolean>Whether the conference is currently being recorded Remarks Returns false when no conference exists or recording not startedsrc/composables/useConference.ts:91
createConference(options?) => Promise<string>Create a new conference Throws If SIP client not initialized or conference already activesrc/composables/useConference.ts:103
joinConference(conferenceUri, options?) => Promise<void>Join an existing conference Throws If SIP client not initialized or join failssrc/composables/useConference.ts:111
addParticipant(uri, displayName?) => Promise<string>Add a participant to the conference Throws If no active conference, conference locked, or conference fullsrc/composables/useConference.ts:120
removeParticipant(participantId, reason?) => Promise<void>Remove a participant from the conference Throws If no active conference or participant not foundsrc/composables/useConference.ts:128
muteParticipant(participantId) => Promise<void>Mute a participant's audio Throws If no active conference or participant not foundsrc/composables/useConference.ts:135
unmuteParticipant(participantId) => Promise<void>Unmute a participant's audio Throws If no active conference or participant not foundsrc/composables/useConference.ts:142
endConference() => Promise<void>End the conference for all participants Throws If no active conferencesrc/composables/useConference.ts:148
lockConference() => Promise<void>Lock the conference to prevent new participants from joining Throws If no active conferencesrc/composables/useConference.ts:154
unlockConference() => Promise<void>Unlock the conference to allow new participants to join Throws If no active conferencesrc/composables/useConference.ts:160
startRecording() => Promise<void>Start recording the conference Throws If no active conference or recording failssrc/composables/useConference.ts:166
stopRecording() => Promise<void>Stop recording the conference Throws If no active conferencesrc/composables/useConference.ts:172
getParticipant(participantId) => Participant | nullGet a specific participant by their IDsrc/composables/useConference.ts:179
onConferenceEvent(callback) => () => voidRegister an event listener for conference eventssrc/composables/useConference.ts:186

DTMFSequenceOptions

Defined in: src/composables/useDTMF.ts:21

DTMF sequence options

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
interToneGap?numberInter-tone gap in milliseconds (default: 70ms)DTMFOptions.interToneGap-src/composables/useDTMF.ts:23
transport?"INFO" | "RFC2833"Transport method for sending DTMFDTMFOptions.transport-src/composables/useDTMF.ts:25
onToneSent?(tone) => voidCallback for each tone sent--src/composables/useDTMF.ts:27
onComplete?() => voidCallback when sequence completes--src/composables/useDTMF.ts:29
onError?(error, tone) => voidCallback on error--src/composables/useDTMF.ts:31
duration?numberDuration of the tone in milliseconds (default: 100)-DTMFOptions.durationsrc/types/call.types.ts:125
transportType?"INFO" | "RFC2833"Transport type-DTMFOptions.transportTypesrc/types/call.types.ts:129

DTMFSendResult

Defined in: src/composables/useDTMF.ts:37

DTMF send result

Properties

PropertyTypeDescriptionDefined in
successbooleanSuccess statussrc/composables/useDTMF.ts:39
tonestringTone that was sentsrc/composables/useDTMF.ts:41
error?ErrorError if failedsrc/composables/useDTMF.ts:43
timestampDateTimestampsrc/composables/useDTMF.ts:45

UseDTMFReturn

Defined in: src/composables/useDTMF.ts:51

Return type for useDTMF composable

Properties

PropertyTypeDescriptionDefined in
isSendingRef<boolean>Is currently sending DTMFsrc/composables/useDTMF.ts:57
queuedTonesRef<string[]>Queued tonessrc/composables/useDTMF.ts:59
lastSentToneRef<string | null>Last sent tonesrc/composables/useDTMF.ts:61
lastResultRef<DTMFSendResult | null>Last send resultsrc/composables/useDTMF.ts:63
tonesSentCountRef<number>Total tones sentsrc/composables/useDTMF.ts:65
queueSizeComputedRef<number>Queue sizesrc/composables/useDTMF.ts:67
isQueueEmptyComputedRef<boolean>Is queue emptysrc/composables/useDTMF.ts:69
sendTone(tone, options?) => Promise<void>Send a single DTMF tonesrc/composables/useDTMF.ts:76
sendToneSequence(tones, options?) => Promise<void>Send a sequence of DTMF tonessrc/composables/useDTMF.ts:78
queueTone(tone) => voidQueue a tone for sendingsrc/composables/useDTMF.ts:80
queueToneSequence(tones) => voidQueue multiple tones for sendingsrc/composables/useDTMF.ts:82
processQueue(options?) => Promise<void>Process the tone queuesrc/composables/useDTMF.ts:84
clearQueue() => voidClear the tone queuesrc/composables/useDTMF.ts:86
stopSending() => voidStop sending (clear queue and cancel current)src/composables/useDTMF.ts:88
resetStats() => voidReset statisticssrc/composables/useDTMF.ts:90

DeviceTestOptions

Defined in: src/composables/useMediaDevices.ts:39

Device test options

Properties

PropertyTypeDescriptionDefined in
duration?numberTest duration in milliseconds (default: 2000)src/composables/useMediaDevices.ts:41
audioLevelThreshold?numberAudio 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

PropertyTypeDescriptionDefined in
audioInputDevicesComputedRef<readonly MediaDevice[]>Audio input devicessrc/composables/useMediaDevices.ts:55
audioOutputDevicesComputedRef<readonly MediaDevice[]>Audio output devicessrc/composables/useMediaDevices.ts:57
videoInputDevicesComputedRef<readonly MediaDevice[]>Video input devicessrc/composables/useMediaDevices.ts:59
allDevicesComputedRef<readonly MediaDevice[]>All devicessrc/composables/useMediaDevices.ts:61
selectedAudioInputIdRef<string | null>Selected audio input device IDsrc/composables/useMediaDevices.ts:63
selectedAudioOutputIdRef<string | null>Selected audio output device IDsrc/composables/useMediaDevices.ts:65
selectedVideoInputIdRef<string | null>Selected video input device IDsrc/composables/useMediaDevices.ts:67
selectedAudioInputDeviceComputedRef<MediaDevice | undefined>Selected audio input devicesrc/composables/useMediaDevices.ts:69
selectedAudioOutputDeviceComputedRef<MediaDevice | undefined>Selected audio output devicesrc/composables/useMediaDevices.ts:71
selectedVideoInputDeviceComputedRef<MediaDevice | undefined>Selected video input devicesrc/composables/useMediaDevices.ts:73
audioPermissionComputedRef<PermissionStatus>Audio permission statussrc/composables/useMediaDevices.ts:75
videoPermissionComputedRef<PermissionStatus>Video permission statussrc/composables/useMediaDevices.ts:77
hasAudioPermissionComputedRef<boolean>Has audio permissionsrc/composables/useMediaDevices.ts:79
hasVideoPermissionComputedRef<boolean>Has video permissionsrc/composables/useMediaDevices.ts:81
hasAudioInputDevicesComputedRef<boolean>Has audio input devicessrc/composables/useMediaDevices.ts:83
hasAudioOutputDevicesComputedRef<boolean>Has audio output devicessrc/composables/useMediaDevices.ts:85
hasVideoInputDevicesComputedRef<boolean>Has video input devicessrc/composables/useMediaDevices.ts:87
totalDevicesComputedRef<number>Total device countsrc/composables/useMediaDevices.ts:89
isEnumeratingRef<boolean>Is enumerating devicessrc/composables/useMediaDevices.ts:91
lastErrorRef<Error | null>Last errorsrc/composables/useMediaDevices.ts:93
enumerateDevices(signal?) => Promise<MediaDevice[]>Enumerate devices with optional abort signalsrc/composables/useMediaDevices.ts:100
requestAudioPermission() => Promise<boolean>Request audio permissionsrc/composables/useMediaDevices.ts:102
requestVideoPermission() => Promise<boolean>Request video permissionsrc/composables/useMediaDevices.ts:104
requestPermissions(audio?, video?) => Promise<void>Request permissionssrc/composables/useMediaDevices.ts:106
selectAudioInput(deviceId) => voidSelect audio input devicesrc/composables/useMediaDevices.ts:108
selectAudioOutput(deviceId) => voidSelect audio output devicesrc/composables/useMediaDevices.ts:110
selectVideoInput(deviceId) => voidSelect video input devicesrc/composables/useMediaDevices.ts:112
testAudioInput(deviceId?, options?) => Promise<boolean>Test audio input devicesrc/composables/useMediaDevices.ts:114
testAudioOutput(deviceId?) => Promise<boolean>Test audio output devicesrc/composables/useMediaDevices.ts:116
getDeviceById(deviceId) => MediaDevice | undefinedGet device by IDsrc/composables/useMediaDevices.ts:118
getDevicesByKind(kind) => readonly MediaDevice[]Get devices by kindsrc/composables/useMediaDevices.ts:120
startDeviceChangeMonitoring() => voidStart device change monitoringsrc/composables/useMediaDevices.ts:122
stopDeviceChangeMonitoring() => voidStop device change monitoringsrc/composables/useMediaDevices.ts:124

Conversation

Defined in: src/composables/useMessaging.ts:31

Conversation thread

Properties

PropertyTypeDescriptionDefined in
uristringPeer URIsrc/composables/useMessaging.ts:33
displayName?stringPeer display namesrc/composables/useMessaging.ts:35
messagesMessage[]Messages in conversationsrc/composables/useMessaging.ts:37
unreadCountnumberUnread countsrc/composables/useMessaging.ts:39
lastMessageAtDate | nullLast message timestampsrc/composables/useMessaging.ts:41
isComposingbooleanIs peer composingsrc/composables/useMessaging.ts:43

UseMessagingReturn

Defined in: src/composables/useMessaging.ts:49

Return type for useMessaging composable

Properties

PropertyTypeDescriptionDefined in
messagesRef<Message[]>All messagessrc/composables/useMessaging.ts:55
conversationsComputedRef<Map<string, Conversation>>Conversations grouped by URIsrc/composables/useMessaging.ts:57
unreadCountComputedRef<number>Total unread message countsrc/composables/useMessaging.ts:59
composingIndicatorsRef<Map<string, ComposingIndicator>>Composing indicatorssrc/composables/useMessaging.ts:61
sendMessage(to, content, options?) => Promise<string>Send a messagesrc/composables/useMessaging.ts:68
markAsRead(messageId) => voidMark message as readsrc/composables/useMessaging.ts:70
markAllAsRead(uri?) => voidMark all messages from a URI as readsrc/composables/useMessaging.ts:72
deleteMessage(messageId) => voidDelete a messagesrc/composables/useMessaging.ts:74
clearMessages(uri?) => voidClear all messagessrc/composables/useMessaging.ts:76
getMessagesForUri(uri) => Message[]Get messages for a specific URIsrc/composables/useMessaging.ts:78
getFilteredMessages(filter) => Message[]Get filtered messagessrc/composables/useMessaging.ts:80
sendComposingIndicator(to, isComposing) => Promise<void>Send composing indicatorsrc/composables/useMessaging.ts:82
onMessagingEvent(callback) => () => voidListen for messaging eventssrc/composables/useMessaging.ts:84

UseOAuth2Options

Defined in: src/composables/useOAuth2.ts:76

Options for useOAuth2 composable

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
autoInitialize?booleanAuto-initialize on mount (restore session)--src/composables/useOAuth2.ts:78
autoHandleCallback?booleanAuto-handle callback if on callback URL--src/composables/useOAuth2.ts:80
callbackPath?stringCallback path to detectOAuth2ServiceConfig.callbackPath-src/composables/useOAuth2.ts:82
providerOAuth2ProviderConfigOAuth2 provider configuration-OAuth2ServiceConfig.providersrc/types/oauth.types.ts:299
credentialMappingSipCredentialMappingSIP credential mapping configuration-OAuth2ServiceConfig.credentialMappingsrc/types/oauth.types.ts:301
autoRefresh?booleanAuto-refresh tokens before expiry-OAuth2ServiceConfig.autoRefreshsrc/types/oauth.types.ts:303
refreshThreshold?numberRefresh tokens this many seconds before expiry-OAuth2ServiceConfig.refreshThresholdsrc/types/oauth.types.ts:305
storageKeyPrefix?stringStorage key prefix for persisting tokens-OAuth2ServiceConfig.storageKeyPrefixsrc/types/oauth.types.ts:307
storageType?"localStorage" | "sessionStorage" | "memory"Storage type to use-OAuth2ServiceConfig.storageTypesrc/types/oauth.types.ts:309
debug?booleanEnable debug logging-OAuth2ServiceConfig.debugsrc/types/oauth.types.ts:311
postLoginRedirect?stringPost-login redirect URL-OAuth2ServiceConfig.postLoginRedirectsrc/types/oauth.types.ts:315
postLogoutRedirect?stringPost-logout redirect URL-OAuth2ServiceConfig.postLogoutRedirectsrc/types/oauth.types.ts:317

UseOAuth2ComposableReturn

Defined in: src/composables/useOAuth2.ts:88

Extended return type with additional composable features

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
serviceOAuth2ServiceReturnService instance (for advanced usage)-src/composables/useOAuth2.ts:90
isInitializedRef<boolean>Whether initialization is complete-src/composables/useOAuth2.ts:92
isOnCallbackPageComputedRef<boolean>Whether currently on callback page-src/composables/useOAuth2.ts:94
authStateRef<OAuth2AuthState, OAuth2AuthState>Current authentication stateUseOAuth2Return.authStatesrc/types/oauth.types.ts:325
isAuthenticatedComputedRef<boolean>Whether user is authenticatedUseOAuth2Return.isAuthenticatedsrc/types/oauth.types.ts:327
errorRef<OAuth2Error | null, OAuth2Error | null>Current error (null if none)UseOAuth2Return.errorsrc/types/oauth.types.ts:329
userInfoRef<OAuth2UserInfo | null, OAuth2UserInfo | null>Current OAuth2 user infoUseOAuth2Return.userInfosrc/types/oauth.types.ts:331
sipCredentialsRef<ProvisionedSipCredentials | null, ProvisionedSipCredentials | null>Provisioned SIP credentialsUseOAuth2Return.sipCredentialssrc/types/oauth.types.ts:333
tokensRef<OAuth2TokenResponse | null, OAuth2TokenResponse | null>Current OAuth2 tokensUseOAuth2Return.tokenssrc/types/oauth.types.ts:335
tokenExpiresAtRef<Date | null, Date | null>Token expiration timestampUseOAuth2Return.tokenExpiresAtsrc/types/oauth.types.ts:337
isRefreshingRef<boolean, boolean>Whether token refresh is in progressUseOAuth2Return.isRefreshingsrc/types/oauth.types.ts:339
login(options?) => Promise<void>Initiate OAuth2 login flowUseOAuth2Return.loginsrc/types/oauth.types.ts:343
handleCallback(url?) => Promise<ProvisionedSipCredentials>Handle OAuth2 callback (after redirect)UseOAuth2Return.handleCallbacksrc/types/oauth.types.ts:345
logout() => Promise<void>Logout and revoke tokensUseOAuth2Return.logoutsrc/types/oauth.types.ts:347
refreshTokens() => Promise<OAuth2TokenResponse>Manually refresh tokensUseOAuth2Return.refreshTokenssrc/types/oauth.types.ts:349
getAccessToken() => Promise<string>Get current access token (auto-refresh if needed)UseOAuth2Return.getAccessTokensrc/types/oauth.types.ts:351
isTokenExpired() => booleanCheck if tokens are expiredUseOAuth2Return.isTokenExpiredsrc/types/oauth.types.ts:353
clearAuth() => voidClear stored auth dataUseOAuth2Return.clearAuthsrc/types/oauth.types.ts:355

PictureInPictureOptions

Defined in: src/composables/usePictureInPicture.ts:6

Options for the usePictureInPicture composable

Properties

PropertyTypeDescriptionDefined in
persistPreference?booleanWhether to persist the user's PiP preference to localStorage Default falsesrc/composables/usePictureInPicture.ts:11
preferenceKey?stringKey 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

PropertyTypeDefined in
widthnumbersrc/composables/usePictureInPicture.ts:24
heightnumbersrc/composables/usePictureInPicture.ts:25

UsePictureInPictureReturn

Defined in: src/composables/usePictureInPicture.ts:31

Return type for the usePictureInPicture composable

Properties

PropertyTypeDescriptionDefined in
isPiPSupportedRef<boolean>Whether PiP is supported by the browsersrc/composables/usePictureInPicture.ts:33
isPiPActiveRef<boolean>Whether PiP mode is currently activesrc/composables/usePictureInPicture.ts:35
pipWindowRef<PictureInPictureWindow | null>Current PiP window dimensions (null when not in PiP)src/composables/usePictureInPicture.ts:37
enterPiP() => Promise<void>Enter PiP modesrc/composables/usePictureInPicture.ts:39
exitPiP() => Promise<void>Exit PiP modesrc/composables/usePictureInPicture.ts:41
togglePiP() => Promise<void>Toggle PiP modesrc/composables/usePictureInPicture.ts:43
errorRef<Error | null>Current error statesrc/composables/usePictureInPicture.ts:45

UsePresenceReturn

Defined in: src/composables/usePresence.ts:29

Return type for usePresence composable

Properties

PropertyTypeDescriptionDefined in
currentStatusRef<PresenceStatus | null>Current user's presence statussrc/composables/usePresence.ts:35
watchedUsersRef<Map<string, PresenceStatus>>Map of watched users and their presence statussrc/composables/usePresence.ts:37
subscriptionsRef<Map<string, PresenceSubscription>>Active subscriptionssrc/composables/usePresence.ts:39
currentStateComputedRef<PresenceState>Current presence statesrc/composables/usePresence.ts:41
subscriptionCountComputedRef<number>Number of active subscriptionssrc/composables/usePresence.ts:43
setStatus(state, options?) => Promise<void>Set own presence statussrc/composables/usePresence.ts:50
subscribe(uri, options?) => Promise<string>Subscribe to user's presencesrc/composables/usePresence.ts:52
unsubscribe(uri) => Promise<void>Unsubscribe from user's presencesrc/composables/usePresence.ts:54
getStatus(uri) => PresenceStatus | nullGet presence status for a specific usersrc/composables/usePresence.ts:56
unsubscribeAll() => Promise<void>Unsubscribe from all watched userssrc/composables/usePresence.ts:58
onPresenceEvent(callback) => () => voidListen for presence eventssrc/composables/usePresence.ts:60

UseSipClientReturn

Defined in: src/composables/useSipClient.ts:50

SIP Client composable return type

Properties

PropertyTypeDescriptionDefined in
isConnectedComputedRef<boolean>Whether client is connected to SIP serversrc/composables/useSipClient.ts:56
isRegisteredComputedRef<boolean>Whether client is registered with SIP serversrc/composables/useSipClient.ts:59
connectionStateComputedRef<ConnectionState>Current connection statesrc/composables/useSipClient.ts:62
registrationStateComputedRef<RegistrationState>Current registration statesrc/composables/useSipClient.ts:65
registeredUriComputedRef<string | null>Registered SIP URIsrc/composables/useSipClient.ts:68
errorRef<Error | null>Current error messagesrc/composables/useSipClient.ts:71
isConnectingComputedRef<boolean>Whether client is connectingsrc/composables/useSipClient.ts:74
isDisconnectingRef<boolean>Whether client is disconnectingsrc/composables/useSipClient.ts:77
isStartedComputedRef<boolean>Whether client is startedsrc/composables/useSipClient.ts:80
connect() => Promise<void>Start the SIP client and connect to server Throws If configuration is invalid or connection failssrc/composables/useSipClient.ts:90
disconnect() => Promise<void>Disconnect from SIP server and stop the client Throws If disconnect failssrc/composables/useSipClient.ts:96
register() => Promise<void>Register with SIP server Throws If not connected or registration failssrc/composables/useSipClient.ts:102
unregister() => Promise<void>Unregister from SIP server Throws If not registered or unregistration failssrc/composables/useSipClient.ts:108
updateConfig(config) => ValidationResultUpdate SIP client configuration Requires disconnect and reconnect to take effectsrc/composables/useSipClient.ts:115
reconnect() => Promise<void>Reconnect to SIP server Performs disconnect followed by connect Throws If reconnection failssrc/composables/useSipClient.ts:122
getClient() => SipClient | nullGet the underlying SIP client instancesrc/composables/useSipClient.ts:128
getEventBus() => EventBusGet the event bus instancesrc/composables/useSipClient.ts:134

RegistrationOptions

Defined in: src/composables/useSipRegistration.ts:22

Registration options

Properties

PropertyTypeDescriptionDefined in
expires?numberRegistration expiry time in seconds (default: 600)src/composables/useSipRegistration.ts:24
maxRetries?numberMaximum retry attempts before giving up (default: 3)src/composables/useSipRegistration.ts:26
autoRefresh?booleanEnable automatic re-registration before expiry (default: true)src/composables/useSipRegistration.ts:28
userAgent?stringCustom User-Agent headersrc/composables/useSipRegistration.ts:30

UseSipRegistrationReturn

Defined in: src/composables/useSipRegistration.ts:36

Return type for useSipRegistration composable

Properties

PropertyTypeDescriptionDefined in
stateRef<RegistrationState>Current registration statesrc/composables/useSipRegistration.ts:42
registeredUriRef<string | null>Registered SIP URIsrc/composables/useSipRegistration.ts:44
isRegisteredComputedRef<boolean>Whether currently registeredsrc/composables/useSipRegistration.ts:46
isRegisteringComputedRef<boolean>Whether registration is in progresssrc/composables/useSipRegistration.ts:48
isUnregisteringComputedRef<boolean>Whether unregistration is in progresssrc/composables/useSipRegistration.ts:50
hasRegistrationFailedComputedRef<boolean>Whether registration has failedsrc/composables/useSipRegistration.ts:52
expiresRef<number>Registration expiry time in secondssrc/composables/useSipRegistration.ts:54
lastRegistrationTimeRef<Date | null>Timestamp when registration was last successfulsrc/composables/useSipRegistration.ts:56
expiryTimeRef<Date | null>Timestamp when registration will expiresrc/composables/useSipRegistration.ts:58
secondsUntilExpiryComputedRef<number>Seconds remaining until registration expiressrc/composables/useSipRegistration.ts:60
isExpiringSoonComputedRef<boolean>Whether registration is about to expire (less than 30 seconds)src/composables/useSipRegistration.ts:62
hasExpiredComputedRef<boolean>Whether registration has expiredsrc/composables/useSipRegistration.ts:64
retryCountRef<number>Number of registration retry attemptssrc/composables/useSipRegistration.ts:66
lastErrorRef<string | null>Last registration error messagesrc/composables/useSipRegistration.ts:68
register() => Promise<void>Register with SIP serversrc/composables/useSipRegistration.ts:75
unregister() => Promise<void>Unregister from SIP serversrc/composables/useSipRegistration.ts:77
refresh() => Promise<void>Manually refresh registrationsrc/composables/useSipRegistration.ts:79
resetRetries() => voidReset retry countsrc/composables/useSipRegistration.ts:81
getStatistics() => RegistrationStatisticsGet registration statisticssrc/composables/useSipRegistration.ts:83

VideoInsetOptions

Defined in: src/composables/useVideoInset.ts:16

Options for the useVideoInset composable

Properties

PropertyTypeDescriptionDefined in
initialPosition?InsetPositionInitial position of the inset video Default 'bottom-right'src/composables/useVideoInset.ts:21
initialSize?InsetSizeInitial size preset Default 'medium'src/composables/useVideoInset.ts:27
customWidth?numberCustom width in pixels (used when size is 'custom') Default 160src/composables/useVideoInset.ts:33
customHeight?numberCustom height in pixels (used when size is 'custom') Default 120src/composables/useVideoInset.ts:39
margin?numberMargin from container edges in pixels Default 16src/composables/useVideoInset.ts:45
borderRadius?numberBorder radius in pixels Default 8src/composables/useVideoInset.ts:51
draggable?booleanWhether the inset can be dragged Default truesrc/composables/useVideoInset.ts:57
showInitially?booleanWhether to show the inset initially Default truesrc/composables/useVideoInset.ts:63
persistPreference?booleanPersist position/size to localStorage Default falsesrc/composables/useVideoInset.ts:69
preferenceKey?stringKey for localStorage persistence Default 'vuesip-video-inset'src/composables/useVideoInset.ts:75

InsetDimensions

Defined in: src/composables/useVideoInset.ts:81

Inset dimensions

Properties

PropertyTypeDefined in
widthnumbersrc/composables/useVideoInset.ts:82
heightnumbersrc/composables/useVideoInset.ts:83

UseVideoInsetReturn

Defined in: src/composables/useVideoInset.ts:89

Return type for the useVideoInset composable

Properties

PropertyTypeDescriptionDefined in
isVisibleRef<boolean>Whether inset is currently visiblesrc/composables/useVideoInset.ts:91
positionRef<InsetPosition>Current position of the insetsrc/composables/useVideoInset.ts:93
sizeRef<InsetSize>Current size presetsrc/composables/useVideoInset.ts:95
dimensionsRef<InsetDimensions>Current dimensions in pixelssrc/composables/useVideoInset.ts:97
isSwappedRef<boolean>Whether videos are swapped (local is main, remote is inset)src/composables/useVideoInset.ts:99
isDraggableRef<boolean>Whether dragging is enabledsrc/composables/useVideoInset.ts:101
isDraggingRef<boolean>Whether currently being draggedsrc/composables/useVideoInset.ts:103
insetStylesRef<CSSProperties>Computed CSS styles for the inset containersrc/composables/useVideoInset.ts:105
show() => voidShow the insetsrc/composables/useVideoInset.ts:107
hide() => voidHide the insetsrc/composables/useVideoInset.ts:109
toggle() => voidToggle inset visibilitysrc/composables/useVideoInset.ts:111
setPosition(pos) => voidSet positionsrc/composables/useVideoInset.ts:113
setSize(size) => voidSet size presetsrc/composables/useVideoInset.ts:115
setCustomDimensions(width, height) => voidSet custom dimensionssrc/composables/useVideoInset.ts:117
swapVideos() => voidSwap main and inset videossrc/composables/useVideoInset.ts:119
cyclePosition() => voidCycle through positionssrc/composables/useVideoInset.ts:121
reset() => voidReset to initial settingssrc/composables/useVideoInset.ts:123

VueSipOptions

Defined in: src/index.ts:347

Options for the VueSip Vue plugin.

Properties

PropertyTypeDescriptionDefined in
debug?booleanEnable debug mode Default falsesrc/index.ts:352
logLevel?"error" | "debug" | "info" | "warn"Logging level Default 'warn'src/index.ts:358
sipConfig?objectGlobal SIP configuration Can also be provided via ConfigProvider componentsrc/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?objectGlobal media configurationsrc/index.ts:376
mediaConfig.audioEnabled?boolean-src/index.ts:377
mediaConfig.videoEnabled?boolean-src/index.ts:378
userPreferences?objectUser preferencessrc/index.ts:385
userPreferences.autoAnswer?boolean-src/index.ts:386
userPreferences.recordCalls?boolean-src/index.ts:387
logger?LoggerCustom logger instancesrc/index.ts:394

OAuth2ProviderContext

Defined in: src/providers/OAuth2Provider.ts:88

Provider context shape - what gets injected into children

Properties

PropertyTypeDescriptionDefined in
authStateRef<OAuth2AuthState>Current authentication statesrc/providers/OAuth2Provider.ts:90
isAuthenticatedComputedRef<boolean>Whether user is authenticatedsrc/providers/OAuth2Provider.ts:92
errorRef<OAuth2Error | null>Current error (null if none)src/providers/OAuth2Provider.ts:94
userInfoRef<OAuth2UserInfo | null>Current OAuth2 user infosrc/providers/OAuth2Provider.ts:96
sipCredentialsRef<ProvisionedSipCredentials | null>Provisioned SIP credentialssrc/providers/OAuth2Provider.ts:98
tokensRef<OAuth2TokenResponse | null>Current OAuth2 tokenssrc/providers/OAuth2Provider.ts:100
isInitializedRef<boolean>Whether initialization is completesrc/providers/OAuth2Provider.ts:102
isRefreshingRef<boolean>Whether token refresh is in progresssrc/providers/OAuth2Provider.ts:104
login(options?) => Promise<void>Initiate OAuth2 login flowsrc/providers/OAuth2Provider.ts:106
handleCallback(url?) => Promise<ProvisionedSipCredentials>Handle OAuth2 callback (after redirect)src/providers/OAuth2Provider.ts:108
logout() => Promise<void>Logout and revoke tokenssrc/providers/OAuth2Provider.ts:110
refreshTokens() => Promise<OAuth2TokenResponse>Manually refresh tokenssrc/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

PropertyTypeDescriptionDefined in
configOAuth2ServiceConfigOAuth2 service configurationsrc/providers/OAuth2Provider.ts:138
autoInitialize?booleanAuto-initialize on mount (restore session)src/providers/OAuth2Provider.ts:140
autoHandleCallback?booleanAuto-handle callback if on callback URLsrc/providers/OAuth2Provider.ts:142
callbackPath?stringCallback path to detectsrc/providers/OAuth2Provider.ts:144
postAuthRedirect?stringRedirect after successful authenticationsrc/providers/OAuth2Provider.ts:146

SipClientProviderContext

Defined in: src/providers/SipClientProvider.ts:77

Provider context shape - what gets injected into children

Properties

PropertyTypeDescriptionDefined in
clientRef<SipClient | null>SIP client instance (null if not initialized)src/providers/SipClientProvider.ts:79
eventBusRef<EventBus>Event bus instance for subscribing to eventssrc/providers/SipClientProvider.ts:81
connectionStateRef<ConnectionState>Current connection statesrc/providers/SipClientProvider.ts:83
registrationStateRef<RegistrationState>Current registration statesrc/providers/SipClientProvider.ts:85
isReadyRef<boolean>Whether client is ready to usesrc/providers/SipClientProvider.ts:87
errorRef<Error | null>Current error (null if no error)src/providers/SipClientProvider.ts:89
connect() => Promise<void>Programmatically connect to SIP serversrc/providers/SipClientProvider.ts:91
disconnect() => Promise<void>Programmatically disconnect from SIP serversrc/providers/SipClientProvider.ts:93

StorageOptions

Defined in: src/providers/credentialStorage.ts:11

Storage configuration options

Properties

PropertyTypeDescriptionDefined in
key?stringCustom storage key (default: 'vuesip_credentials')src/providers/credentialStorage.ts:13

CredentialStorage

Defined in: src/providers/credentialStorage.ts:17

Credential storage interface

Methods

save()
ts
save(credentials): void;

Defined in: src/providers/credentialStorage.ts:19

Save credentials to storage

Parameters
ParameterType
credentialsStoredCredentials
Returns

void

load()
ts
load(): StoredCredentials | null;

Defined in: src/providers/credentialStorage.ts:21

Load credentials from storage

Returns

StoredCredentials | null

clear()
ts
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

PropertyTypeDescriptionDefined in
force?booleanForce overwrite if provider already existssrc/providers/providerRegistry.ts:13

SelectOption

Defined in: src/providers/types.ts:11

Option for select fields

Properties

PropertyTypeDefined in
labelstringsrc/providers/types.ts:12
valuestringsrc/providers/types.ts:13

ProviderField

Defined in: src/providers/types.ts:17

Field definition for provider login forms

Properties

PropertyTypeDescriptionDefined in
namestringField identifier (e.g., 'username', 'password', 'domain')src/providers/types.ts:19
labelstringDisplay label (e.g., 'SIP Username')src/providers/types.ts:21
type"text" | "password" | "select"Input typesrc/providers/types.ts:23
placeholder?stringPlaceholder textsrc/providers/types.ts:25
required?booleanWhether field is requiredsrc/providers/types.ts:27
helpText?stringHelp text shown below fieldsrc/providers/types.ts:29
helpUrl?stringLink to provider documentationsrc/providers/types.ts:31
options?SelectOption[]Options for select fieldssrc/providers/types.ts:33

SipCredentials

Defined in: src/providers/types.ts:37

Credentials passed to useSipClient

Properties

PropertyTypeDescriptionDefined in
uristringWebSocket URLsrc/providers/types.ts:39
sipUristringSIP URI (sip:user@domain)src/providers/types.ts:41
passwordstringSIP passwordsrc/providers/types.ts:43
displayName?stringDisplay name for caller IDsrc/providers/types.ts:45

ProviderConfig

Defined in: src/providers/types.ts:49

Config-only provider definition (simple providers)

Extended by

Properties

PropertyTypeDescriptionDefined in
idstringUnique identifier (e.g., '46elks')src/providers/types.ts:51
namestringDisplay name (e.g., '46 elks')src/providers/types.ts:53
logo?stringProvider logo URL or data URIsrc/providers/types.ts:55
websocketUrlstringDefault WebSocket URL (can be empty if user provides)src/providers/types.ts:57
fieldsProviderField[]Form fields for this providersrc/providers/types.ts:59
mapCredentials(input) => SipCredentialsTransform user input to SIP credentialssrc/providers/types.ts:61

OAuthConfig

Defined in: src/providers/types.ts:65

OAuth configuration for providers that support it

Properties

PropertyTypeDescriptionDefined in
authUrlstringOAuth authorization URLsrc/providers/types.ts:67
tokenUrlstringOAuth token URLsrc/providers/types.ts:69
clientIdstringOAuth client IDsrc/providers/types.ts:71
scopesstring[]Required OAuth scopessrc/providers/types.ts:73

ProviderAdapter

Defined in: src/providers/types.ts:77

Full adapter interface (complex providers like Twilio)

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
idstringUnique identifier (e.g., '46elks')ProviderConfig.idsrc/providers/types.ts:51
namestringDisplay name (e.g., '46 elks')ProviderConfig.namesrc/providers/types.ts:53
logo?stringProvider logo URL or data URIProviderConfig.logosrc/providers/types.ts:55
websocketUrlstringDefault WebSocket URL (can be empty if user provides)ProviderConfig.websocketUrlsrc/providers/types.ts:57
fieldsProviderField[]Form fields for this providerProviderConfig.fieldssrc/providers/types.ts:59
mapCredentials(input) => SipCredentialsTransform user input to SIP credentialsProviderConfig.mapCredentialssrc/providers/types.ts:61
connect?(credentials, sipClient) => Promise<void>Override connection behavior if needed-src/providers/types.ts:79
oauth?OAuthConfigOAuth flow support-src/providers/types.ts:81

ProviderSelectorOptions

Defined in: src/providers/types.ts:88

Composable options

Properties

PropertyTypeDescriptionDefined in
storage?StorageTypeStorage type for credentials (default: 'local')src/providers/types.ts:90
defaultProvider?stringDefault provider ID (default: 'own-pbx')src/providers/types.ts:92
providers?ProviderConfig[]Override or extend built-in providerssrc/providers/types.ts:94

StoredCredentials

Defined in: src/providers/types.ts:98

Stored credential data

Properties

PropertyTypeDescriptionDefined in
providerIdstringProvider IDsrc/providers/types.ts:100
valuesRecord<string, string>Credential values keyed by field namesrc/providers/types.ts:102
storedAtnumberTimestamp when storedsrc/providers/types.ts:104

UseProviderSelectorReturn

Defined in: src/providers/useProviderSelector.ts:21

Return type for useProviderSelector composable

Properties

PropertyTypeDescriptionDefined in
providersComputedRef<ProviderConfig[]>List of all available providers (computed ref)src/providers/useProviderSelector.ts:23
selectedProviderRef<ProviderConfig | null>Currently selected provider (ref)src/providers/useProviderSelector.ts:25
credentialsRecord<string, string>Current credential values (reactive object)src/providers/useProviderSelector.ts:27
isConfiguredComputedRef<boolean>Whether all required fields are filled (computed ref)src/providers/useProviderSelector.ts:29
selectProvider(providerId) => voidSelect a provider by IDsrc/providers/useProviderSelector.ts:31
updateCredential(field, value) => voidUpdate a credential field valuesrc/providers/useProviderSelector.ts:33
saveCredentials() => voidSave credentials to storagesrc/providers/useProviderSelector.ts:35
clearCredentials() => voidClear stored credentials and reset valuessrc/providers/useProviderSelector.ts:37
getSipConfig() => SipCredentials | nullGet SIP config for useSipClientsrc/providers/useProviderSelector.ts:39

PersistenceOptions

Defined in: src/storage/persistence.ts:19

Options for store persistence

Type Parameters

Type Parameter
T

Properties

PropertyTypeDescriptionDefined in
adapterStorageAdapterStorage adapter to usesrc/storage/persistence.ts:21
keystringStorage keysrc/storage/persistence.ts:23
getState() => TState getter functionsrc/storage/persistence.ts:25
setState(state) => voidState setter functionsrc/storage/persistence.ts:27
watchSource?WatchSource<T>Watch source for automatic savesrc/storage/persistence.ts:29
debounce?numberDebounce delay for automatic saves (ms, default: 300)src/storage/persistence.ts:31
autoLoad?booleanWhether to load state on initialization (default: true)src/storage/persistence.ts:33
serialize?(state) => unknownTransform function for serialization (optional)src/storage/persistence.ts:35
deserialize?(data) => TTransform function for deserialization (optional)src/storage/persistence.ts:37

PersistenceConfig

Defined in: src/stores/persistence.ts:25

Persistence configuration options

Properties

PropertyTypeDescriptionDefined in
storage?StorageConfigStorage configuration (prefix, version, encryption)src/stores/persistence.ts:27
encryptionPassword?stringEncryption password for sensitive datasrc/stores/persistence.ts:29
enabled?booleanEnable persistence (default: true)src/stores/persistence.ts:31
autoLoad?booleanAuto-load state on initialization (default: true)src/stores/persistence.ts:33
debounce?numberDebounce 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

ts
[key: string]: unknown

Additional provider-specific options

Properties

PropertyTypeDescriptionInherited fromDefined in
serverUrl?stringWebSocket 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?numberAudio sample rate in Hz (default: 16000)-src/transcription/providers/whisper.ts:30
chunkDuration?numberChunk duration in milliseconds (default: 1000)-src/transcription/providers/whisper.ts:32
autoReconnect?booleanEnable automatic reconnection (default: true)-src/transcription/providers/whisper.ts:34
maxReconnectAttempts?numberMaximum reconnection attempts (default: 5)-src/transcription/providers/whisper.ts:36
reconnectDelay?numberInitial reconnection delay in ms (default: 1000)-src/transcription/providers/whisper.ts:38
apiKey?stringAPI key (for cloud providers)ProviderOptions.apiKeysrc/types/transcription.types.ts:132
language?stringLanguage codeProviderOptions.languagesrc/types/transcription.types.ts:134
interimResults?booleanEnable interim resultsProviderOptions.interimResultssrc/types/transcription.types.ts:136
endpoint?stringCustom endpoint URLProviderOptions.endpointsrc/types/transcription.types.ts:138

ActiveSpeakerOptions

Defined in: src/types/active-speaker.types.ts:12

Active speaker detection options

Properties

PropertyTypeDescriptionDefined in
threshold?numberAudio level threshold to consider someone speaking (0-1). Default: 0.15src/types/active-speaker.types.ts:14
debounceMs?numberDebounce time in ms to prevent rapid speaker switching. Default: 300src/types/active-speaker.types.ts:16
historySize?numberNumber of recent speakers to track in history. Default: 10src/types/active-speaker.types.ts:18
excludeMuted?booleanExclude muted participants from detection. Default: truesrc/types/active-speaker.types.ts:20
onSpeakerChange?(speaker, previous) => voidCallback when active speaker changessrc/types/active-speaker.types.ts:22

SpeakerHistoryEntry

Defined in: src/types/active-speaker.types.ts:28

Speaker history entry

Properties

PropertyTypeDescriptionDefined in
participantIdstringParticipant IDsrc/types/active-speaker.types.ts:30
displayNamestringDisplay name at time of speakingsrc/types/active-speaker.types.ts:32
startedAtnumberWhen they started speakingsrc/types/active-speaker.types.ts:34
endedAtnumber | nullWhen they stopped speaking (null if still speaking)src/types/active-speaker.types.ts:36
peakLevelnumberPeak audio level during this speaking periodsrc/types/active-speaker.types.ts:38

UseActiveSpeakerReturn

Defined in: src/types/active-speaker.types.ts:44

Return type for useActiveSpeaker composable

Properties

PropertyTypeDescriptionDefined in
activeSpeakerComputedRef<Participant | null>Current dominant speaker (highest audio level above threshold)src/types/active-speaker.types.ts:46
activeSpeakersComputedRef<Participant[]>All participants currently speaking (above threshold)src/types/active-speaker.types.ts:48
isSomeoneSpeakingComputedRef<boolean>Is anyone currently speakingsrc/types/active-speaker.types.ts:50
speakerHistoryRef<SpeakerHistoryEntry[]>Recent speaker historysrc/types/active-speaker.types.ts:52
clearHistory() => voidClear speaker historysrc/types/active-speaker.types.ts:54
setThreshold(threshold) => voidUpdate threshold dynamicallysrc/types/active-speaker.types.ts:56

BlockEntry

Defined in: src/types/blacklist.types.ts:36

Block entry representing a blocked number

Properties

PropertyTypeDescriptionDefined in
numberstringPhone number or pattern (supports wildcards like 1800*)src/types/blacklist.types.ts:38
reasonBlockReasonReason for blockingsrc/types/blacklist.types.ts:40
actionBlockActionAction to take when call from this number is receivedsrc/types/blacklist.types.ts:42
description?stringOptional description or notessrc/types/blacklist.types.ts:44
blockedAtDateWhen the number was blockedsrc/types/blacklist.types.ts:46
expiresAt?DateWhen the block expires (optional, undefined = permanent)src/types/blacklist.types.ts:48
blockedBy?stringWho blocked the number (extension or system)src/types/blacklist.types.ts:50
statusBlockStatusCurrent statussrc/types/blacklist.types.ts:52
blockedCountnumberNumber of blocked call attempts from this numbersrc/types/blacklist.types.ts:54
lastBlockedAt?DateLast time a call was blocked from this numbersrc/types/blacklist.types.ts:56

CallQualityScore

Defined in: src/types/call-quality.types.ts:22

Comprehensive call quality score combining multiple metrics

Properties

PropertyTypeDescriptionDefined in
overallnumberOverall score 0-100src/types/call-quality.types.ts:24
audionumberAudio quality score 0-100src/types/call-quality.types.ts:26
videonumber | nullVideo quality score 0-100 (null if audio-only)src/types/call-quality.types.ts:28
networknumberNetwork stability score 0-100src/types/call-quality.types.ts:30
gradeQualityGradeQuality gradesrc/types/call-quality.types.ts:32
descriptionstringHuman-readable quality descriptionsrc/types/call-quality.types.ts:34
timestampnumberTimestamp of score calculationsrc/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

PropertyTypeDescriptionDefined in
packetLossnumberWeight for packet loss impact (0-1)src/types/call-quality.types.ts:45
jitternumberWeight for jitter impact (0-1)src/types/call-quality.types.ts:47
rttnumberWeight for round-trip time impact (0-1)src/types/call-quality.types.ts:49
mosnumberWeight for MOS score impact (0-1)src/types/call-quality.types.ts:51
bitrateStabilitynumberWeight 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

PropertyTypeDescriptionDefined in
directionQualityTrendDirectionDirection of quality changesrc/types/call-quality.types.ts:77
ratenumberRate of change (-100 to 100, negative = degrading)src/types/call-quality.types.ts:79
confidencenumberConfidence 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

PropertyTypeDescriptionDefined in
weights?Partial<QualityScoreWeights>Custom weight configuration (partial, will be merged with defaults)src/types/call-quality.types.ts:89
historySize?numberHistory size for trend calculation Default 10src/types/call-quality.types.ts:91
updateInterval?numberUpdate interval in ms Default 1000src/types/call-quality.types.ts:93
enableTrendAnalysis?booleanEnable trend analysis Default truesrc/types/call-quality.types.ts:95

QualityScoreInput

Defined in: src/types/call-quality.types.ts:101

Input stats for quality score calculation

Properties

PropertyTypeDescriptionDefined in
packetLoss?numberPacket loss percentage (0-100)src/types/call-quality.types.ts:103
jitter?numberJitter in millisecondssrc/types/call-quality.types.ts:105
rtt?numberRound-trip time in millisecondssrc/types/call-quality.types.ts:107
mos?numberMOS score (1-5)src/types/call-quality.types.ts:109
bitrate?numberCurrent bitrate in kbpssrc/types/call-quality.types.ts:111
previousBitrate?numberPrevious bitrate for stability calculationsrc/types/call-quality.types.ts:113
audioPacketLoss?numberAudio-specific packet losssrc/types/call-quality.types.ts:115
audioJitterBufferDelay?numberAudio jitter buffer delay in mssrc/types/call-quality.types.ts:117
videoPacketLoss?numberVideo packet losssrc/types/call-quality.types.ts:119
framerate?numberVideo frameratesrc/types/call-quality.types.ts:121
targetFramerate?numberTarget frameratesrc/types/call-quality.types.ts:123
resolutionWidth?numberVideo resolution widthsrc/types/call-quality.types.ts:125
resolutionHeight?numberVideo resolution heightsrc/types/call-quality.types.ts:127
freezeCount?numberNumber of freeze eventssrc/types/call-quality.types.ts:129
audioOnly?booleanWhether this is an audio-only callsrc/types/call-quality.types.ts:131

UseCallQualityScoreReturn

Defined in: src/types/call-quality.types.ts:137

Return type for useCallQualityScore composable

Properties

PropertyTypeDescriptionDefined in
scoreRef<CallQualityScore | null, CallQualityScore | null>Current quality score (null if no stats available)src/types/call-quality.types.ts:139
trendRef<QualityTrend | null, QualityTrend | null>Quality trend (null if insufficient history)src/types/call-quality.types.ts:141
historyRef<CallQualityScore[], CallQualityScore[]>Score history for chartingsrc/types/call-quality.types.ts:143
updateScore(input) => voidUpdate score with new statssrc/types/call-quality.types.ts:145
reset() => voidClear history and resetsrc/types/call-quality.types.ts:147
weightsRef<QualityScoreWeights, QualityScoreWeights>Current weights being usedsrc/types/call-quality.types.ts:149

NetworkDetails

Defined in: src/types/call-quality.types.ts:180

Detailed network metrics for tooltip display

Properties

PropertyTypeDescriptionDefined in
rttnumberRound-trip time in mssrc/types/call-quality.types.ts:182
jitternumberJitter in mssrc/types/call-quality.types.ts:184
packetLossnumberPacket loss percentage (0-100)src/types/call-quality.types.ts:186
bandwidthnumberAvailable bandwidth estimate in kbpssrc/types/call-quality.types.ts:188
connectionTypestringConnection 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

PropertyTypeDescriptionDefined in
levelNetworkQualityLevelCurrent quality levelsrc/types/call-quality.types.ts:198
barsSignalBarsSignal strength bars (1-5)src/types/call-quality.types.ts:200
colorstringColor for UI (CSS color value)src/types/call-quality.types.ts:202
iconNetworkQualityIconIcon name suggestionsrc/types/call-quality.types.ts:204
ariaLabelstringAccessibility labelsrc/types/call-quality.types.ts:206
detailsNetworkDetailsDetailed metrics for tooltipsrc/types/call-quality.types.ts:208

NetworkQualityThresholds

Defined in: src/types/call-quality.types.ts:231

Thresholds for network quality level determination

Properties

PropertyTypeDescriptionDefined 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

PropertyTypeDescriptionDefined in
updateInterval?numberUpdate interval in ms Default 1000src/types/call-quality.types.ts:254
colors?Partial<NetworkQualityColors>Custom color schemesrc/types/call-quality.types.ts:256
estimateBandwidth?booleanEnable bandwidth estimation Default truesrc/types/call-quality.types.ts:258
thresholds?Partial<NetworkQualityThresholds>Custom thresholdssrc/types/call-quality.types.ts:260

NetworkQualityInput

Defined in: src/types/call-quality.types.ts:266

Input for network quality indicator

Properties

PropertyTypeDescriptionDefined in
rtt?numberRound-trip time in mssrc/types/call-quality.types.ts:268
jitter?numberJitter in mssrc/types/call-quality.types.ts:270
packetLoss?numberPacket loss percentage (0-100)src/types/call-quality.types.ts:272
bitrate?numberCurrent bitrate in kbps (for bandwidth estimation)src/types/call-quality.types.ts:274
availableOutgoingBitrate?numberAvailable outgoing bitrate from BWEsrc/types/call-quality.types.ts:276
candidateType?stringICE candidate pair typesrc/types/call-quality.types.ts:278

UseNetworkQualityIndicatorReturn

Defined in: src/types/call-quality.types.ts:284

Return type for useNetworkQualityIndicator composable

Properties

PropertyTypeDescriptionDefined in
indicatorRef<NetworkQualityIndicatorData, NetworkQualityIndicatorData>Current indicator datasrc/types/call-quality.types.ts:286
isAvailableRef<boolean, boolean>Whether data is availablesrc/types/call-quality.types.ts:288
update(input) => voidUpdate indicator with new statssrc/types/call-quality.types.ts:290
reset() => voidReset to unknown statesrc/types/call-quality.types.ts:292

AdaptationSuggestion

Defined in: src/types/call-quality.types.ts:317

Specific adaptation suggestion

Properties

PropertyTypeDescriptionDefined in
typeSuggestionTypeType of suggestionsrc/types/call-quality.types.ts:319
messagestringSuggestion text for displaysrc/types/call-quality.types.ts:321
currentstringCurrent value descriptionsrc/types/call-quality.types.ts:323
recommendedstringRecommended value descriptionsrc/types/call-quality.types.ts:325
impactnumberImpact 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

PropertyTypeDescriptionDefined in
actionBandwidthActionRecommended actionsrc/types/call-quality.types.ts:335
suggestionsAdaptationSuggestion[]Specific recommendations ordered by impactsrc/types/call-quality.types.ts:337
priorityRecommendationPriorityPriority levelsrc/types/call-quality.types.ts:339
estimatedImprovementnumberEstimated quality improvement if applied (0-100)src/types/call-quality.types.ts:341
timestampnumberTimestamp of recommendationsrc/types/call-quality.types.ts:343

VideoResolution

Defined in: src/types/call-quality.types.ts:349

Video resolution preset

Properties

PropertyTypeDefined in
widthnumbersrc/types/call-quality.types.ts:350
heightnumbersrc/types/call-quality.types.ts:351
labelstringsrc/types/call-quality.types.ts:352

BandwidthConstraints

Defined in: src/types/call-quality.types.ts:369

Bandwidth adaptation constraints

Properties

PropertyTypeDescriptionDefined in
minVideoBitrate?numberMinimum acceptable video bitrate in kbps Default 100src/types/call-quality.types.ts:371
maxVideoBitrate?numberMaximum video bitrate in kbps Default 2500src/types/call-quality.types.ts:373
minAudioBitrate?numberMinimum audio bitrate in kbps Default 16src/types/call-quality.types.ts:375
maxAudioBitrate?numberMaximum audio bitrate in kbps Default 128src/types/call-quality.types.ts:377
targetFramerate?numberTarget framerate Default 30src/types/call-quality.types.ts:379
minFramerate?numberMinimum acceptable framerate Default 15src/types/call-quality.types.ts:381
minResolution?VideoResolutionMinimum acceptable resolutionsrc/types/call-quality.types.ts:383
preferredResolution?VideoResolutionPreferred resolutionsrc/types/call-quality.types.ts:385

BandwidthAdaptationOptions

Defined in: src/types/call-quality.types.ts:405

Options for useBandwidthAdaptation composable

Properties

PropertyTypeDescriptionDefined in
constraints?BandwidthConstraintsConstraints for adaptationsrc/types/call-quality.types.ts:407
sensitivity?numberAdaptation sensitivity (0-1, higher = more reactive) Default 0.5src/types/call-quality.types.ts:409
autoAdapt?booleanEnable automatic adaptation (vs recommendation only) Default falsesrc/types/call-quality.types.ts:411
onRecommendation?(rec) => voidCallback when recommendation changessrc/types/call-quality.types.ts:413
historySize?numberHistory size for smoothing Default 5src/types/call-quality.types.ts:415

BandwidthAdaptationInput

Defined in: src/types/call-quality.types.ts:421

Input for bandwidth adaptation

Properties

PropertyTypeDescriptionDefined in
availableBitrate?numberAvailable outgoing bitrate in kbpssrc/types/call-quality.types.ts:423
currentBitrate?numberCurrent send bitrate in kbpssrc/types/call-quality.types.ts:425
packetLoss?numberPacket loss percentagesrc/types/call-quality.types.ts:427
rtt?numberRound-trip time in mssrc/types/call-quality.types.ts:429
currentResolution?VideoResolutionCurrent video resolutionsrc/types/call-quality.types.ts:431
currentFramerate?numberCurrent frameratesrc/types/call-quality.types.ts:433
currentAudioBitrate?numberCurrent audio bitratesrc/types/call-quality.types.ts:435
videoEnabled?booleanWhether video is enabledsrc/types/call-quality.types.ts:437
degradationEvents?numberNumber of recent quality degradation eventssrc/types/call-quality.types.ts:439

UseBandwidthAdaptationReturn

Defined in: src/types/call-quality.types.ts:445

Return type for useBandwidthAdaptation composable

Properties

PropertyTypeDescriptionDefined in
recommendationRef<BandwidthRecommendation, BandwidthRecommendation>Current recommendationsrc/types/call-quality.types.ts:447
isAutoAdaptingRef<boolean, boolean>Whether auto-adaptation is enabledsrc/types/call-quality.types.ts:449
constraintsRef<Required<BandwidthConstraints>, Required<BandwidthConstraints>>Current constraintssrc/types/call-quality.types.ts:451
update(input) => voidUpdate with new statssrc/types/call-quality.types.ts:453
setAutoAdapt(enabled) => voidEnable/disable auto-adaptationsrc/types/call-quality.types.ts:455
setConstraints(constraints) => voidUpdate constraintssrc/types/call-quality.types.ts:457
reset() => voidReset to defaultssrc/types/call-quality.types.ts:459
applySuggestion(suggestion) => voidApply a specific suggestion manuallysrc/types/call-quality.types.ts:461

CallOptions

Defined in: src/types/call.types.ts:77

Call options for making a call

Properties

PropertyTypeDescriptionDefined in
audio?boolean | MediaTrackConstraintsEnable audio (shorthand for mediaConstraints.audio)src/types/call.types.ts:79
video?boolean | MediaTrackConstraintsEnable video (shorthand for mediaConstraints.video)src/types/call.types.ts:81
mediaConstraints?objectMedia 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?RTCConfigurationRTC configuration overridesrc/types/call.types.ts:88
extraHeaders?string[]Custom SIP headerssrc/types/call.types.ts:90
anonymous?booleanAnonymous callsrc/types/call.types.ts:92
sessionTimers?booleanEnable session timerssrc/types/call.types.ts:94
sessionTimersExpires?numberSession timers expiry (seconds)src/types/call.types.ts:96
pcmaCodecOnly?booleanPCMA codec onlysrc/types/call.types.ts:98

AnswerOptions

Defined in: src/types/call.types.ts:104

Answer options for incoming calls

Properties

PropertyTypeDescriptionDefined in
audio?boolean | MediaTrackConstraintsEnable audio (shorthand for mediaConstraints.audio)src/types/call.types.ts:106
video?boolean | MediaTrackConstraintsEnable video (shorthand for mediaConstraints.video)src/types/call.types.ts:108
mediaConstraints?objectMedia 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?RTCConfigurationRTC configuration overridesrc/types/call.types.ts:115
extraHeaders?string[]Custom SIP headerssrc/types/call.types.ts:117

DTMFOptions

Defined in: src/types/call.types.ts:123

DTMF options

Extended by

Properties

PropertyTypeDescriptionDefined in
duration?numberDuration of the tone in milliseconds (default: 100)src/types/call.types.ts:125
interToneGap?numberInter-tone gap in milliseconds (default: 70)src/types/call.types.ts:127
transportType?"INFO" | "RFC2833"Transport typesrc/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

PropertyTypeDescriptionDefined in
startTime?DateTime when call was initiatedsrc/types/call.types.ts:139
answerTime?DateTime when call was answeredsrc/types/call.types.ts:141
endTime?DateTime when call endedsrc/types/call.types.ts:143
duration?numberCall duration in secondssrc/types/call.types.ts:145
ringDuration?numberRing duration in secondssrc/types/call.types.ts:147

CallStatistics

Defined in: src/types/call.types.ts:153

Call statistics

Properties

PropertyTypeDescriptionDefined in
audio?objectAudio statisticssrc/types/call.types.ts:155
audio.bytesSent?numberBytes sentsrc/types/call.types.ts:157
audio.bytesReceived?numberBytes receivedsrc/types/call.types.ts:159
audio.packetsSent?numberPackets sentsrc/types/call.types.ts:161
audio.packetsReceived?numberPackets receivedsrc/types/call.types.ts:163
audio.packetsLost?numberPackets lostsrc/types/call.types.ts:165
audio.jitter?numberJitter in secondssrc/types/call.types.ts:167
audio.roundTripTime?numberRound trip time in secondssrc/types/call.types.ts:169
audio.audioLevel?numberAudio level (0-1)src/types/call.types.ts:171
audio.codecName?stringCodec namesrc/types/call.types.ts:173
video?objectVideo statisticssrc/types/call.types.ts:176
video.bytesSent?numberBytes sentsrc/types/call.types.ts:178
video.bytesReceived?numberBytes receivedsrc/types/call.types.ts:180
video.packetsSent?numberPackets sentsrc/types/call.types.ts:182
video.packetsReceived?numberPackets receivedsrc/types/call.types.ts:184
video.packetsLost?numberPackets lostsrc/types/call.types.ts:186
video.frameRate?numberFrame ratesrc/types/call.types.ts:188
video.frameWidth?numberFrame widthsrc/types/call.types.ts:190
video.frameHeight?numberFrame heightsrc/types/call.types.ts:192
video.codecName?stringCodec namesrc/types/call.types.ts:194
network?objectNetwork statisticssrc/types/call.types.ts:197
network.currentRoundTripTime?numberCurrent round trip timesrc/types/call.types.ts:199
network.availableOutgoingBitrate?numberAvailable outgoing bitratesrc/types/call.types.ts:201
network.availableIncomingBitrate?numberAvailable incoming bitratesrc/types/call.types.ts:203

CallEvent

Defined in: src/types/call.types.ts:250

Call event

Extended by

Properties

PropertyTypeDescriptionDefined in
typestringEvent typesrc/types/call.types.ts:252
sessionCallSessionCall sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event datasrc/types/call.types.ts:256
timestampDateTimestampsrc/types/call.types.ts:258
originator?"local" | "remote" | "system"Event originator (local, remote, or system) - present in hold/unhold/ended eventssrc/types/call.types.ts:260
error?stringError message - present in failed eventssrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer eventssrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer eventssrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress eventssrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress eventssrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress eventssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer eventssrc/types/call.types.ts:274

CallProgressEvent

Defined in: src/types/call.types.ts:280

Call progress event (provisional responses)

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
originator?"local" | "remote" | "system"Event originator (local, remote, or system) - present in hold/unhold/ended events-CallEvent.originatorsrc/types/call.types.ts:260
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"progress"Event typeCallEvent.type-src/types/call.types.ts:281
responseCodenumberResponse code (e.g., 180, 183)--src/types/call.types.ts:283
reasonPhrasestringReason phrase--src/types/call.types.ts:285

CallFailedEvent

Defined in: src/types/call.types.ts:291

Call failed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
originator?"local" | "remote" | "system"Event originator (local, remote, or system) - present in hold/unhold/ended events-CallEvent.originatorsrc/types/call.types.ts:260
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"failed"Event typeCallEvent.type-src/types/call.types.ts:292
causeTerminationCauseTermination cause--src/types/call.types.ts:294
responseCode?numberResponse code--src/types/call.types.ts:296
reasonPhrase?stringReason phrase--src/types/call.types.ts:298
message?stringError message--src/types/call.types.ts:300

CallEndedEvent

Defined in: src/types/call.types.ts:306

Call ended event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"ended"Event typeCallEvent.type-src/types/call.types.ts:307
causeTerminationCauseTermination cause--src/types/call.types.ts:309
originator"local" | "remote" | "system"Originator of the BYECallEvent.originator-src/types/call.types.ts:311

CallAcceptedEvent

Defined in: src/types/call.types.ts:317

Call accepted event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
originator?"local" | "remote" | "system"Event originator (local, remote, or system) - present in hold/unhold/ended events-CallEvent.originatorsrc/types/call.types.ts:260
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"accepted"Event typeCallEvent.type-src/types/call.types.ts:318
responseCodenumberResponse code--src/types/call.types.ts:320

CallConfirmedEvent

Defined in: src/types/call.types.ts:326

Call confirmed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
originator?"local" | "remote" | "system"Event originator (local, remote, or system) - present in hold/unhold/ended events-CallEvent.originatorsrc/types/call.types.ts:260
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"confirmed"Event typeCallEvent.type-src/types/call.types.ts:327

CallHoldEvent

Defined in: src/types/call.types.ts:333

Call hold event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"hold" | "unhold"Event typeCallEvent.type-src/types/call.types.ts:334
originator"local" | "remote"Originator of the hold/unholdCallEvent.originator-src/types/call.types.ts:336

CallMuteEvent

Defined in: src/types/call.types.ts:342

Call mute event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
sessionCallSessionCall session-CallEvent.sessionsrc/types/call.types.ts:254
originalEvent?unknownOriginal event data-CallEvent.originalEventsrc/types/call.types.ts:256
timestampDateTimestamp-CallEvent.timestampsrc/types/call.types.ts:258
originator?"local" | "remote" | "system"Event originator (local, remote, or system) - present in hold/unhold/ended events-CallEvent.originatorsrc/types/call.types.ts:260
error?stringError message - present in failed events-CallEvent.errorsrc/types/call.types.ts:262
transferType?"blind" | "attended"Transfer type - present in transfer events-CallEvent.transferTypesrc/types/call.types.ts:264
target?stringTransfer target URI - present in transfer events-CallEvent.targetsrc/types/call.types.ts:266
transferId?stringTransfer ID - present in transfer progress events-CallEvent.transferIdsrc/types/call.types.ts:268
state?stringTransfer state - present in transfer progress events-CallEvent.statesrc/types/call.types.ts:270
progress?numberTransfer progress percentage - present in transfer progress events-CallEvent.progresssrc/types/call.types.ts:272
replaceCallId?stringReplace call ID - present in attended transfer events-CallEvent.replaceCallIdsrc/types/call.types.ts:274
type"muted" | "unmuted"Event typeCallEvent.type-src/types/call.types.ts:343

HoldOptions

Defined in: src/types/call.types.ts:370

Hold options

Properties

PropertyTypeDescriptionDefined in
direction?HoldDirectionSDP direction for hold state (default: 'sendonly')src/types/call.types.ts:372
extraHeaders?string[]Custom SIP headerssrc/types/call.types.ts:374

HoldEvent

Defined in: src/types/call.types.ts:380

Hold event

Properties

PropertyTypeDescriptionDefined in
type"hold" | "unhold" | "hold_failed" | "unhold_failed"Event typesrc/types/call.types.ts:382
stateHoldStateHold statesrc/types/call.types.ts:384
originator"local" | "remote"Originator of the hold/unholdsrc/types/call.types.ts:386
timestampDateTimestampsrc/types/call.types.ts:388
error?stringError message (if failed)src/types/call.types.ts:390
callIdstringCall IDsrc/types/call.types.ts:392

HoldResult

Defined in: src/types/call.types.ts:398

Hold result

Properties

PropertyTypeDescriptionDefined in
successbooleanWhether operation was successfulsrc/types/call.types.ts:400
stateHoldStateHold state after operationsrc/types/call.types.ts:402
error?stringError message if failedsrc/types/call.types.ts:404

CallbackRequest

Defined in: src/types/callback.types.ts:25

Callback request from a caller

Properties

PropertyTypeDescriptionDefined in
idstringUnique callback IDsrc/types/callback.types.ts:27
callerNumberstringCaller's phone number to call backsrc/types/callback.types.ts:30
callerName?stringOptional caller namesrc/types/callback.types.ts:33
targetQueue?stringQueue or extension that should handle the callbacksrc/types/callback.types.ts:36
targetAgent?stringSpecific agent to handle the callbacksrc/types/callback.types.ts:39
reason?stringOriginal call context (why they called)src/types/callback.types.ts:42
notes?stringNotes added by agent or systemsrc/types/callback.types.ts:45
priorityCallbackPriorityPriority levelsrc/types/callback.types.ts:48
statusCallbackStatusCurrent statussrc/types/callback.types.ts:51
requestedAtDateWhen the callback was requestedsrc/types/callback.types.ts:54
scheduledAt?DateScheduled callback time (if specified)src/types/callback.types.ts:57
executedAt?DateWhen the callback was actually executedsrc/types/callback.types.ts:60
completedAt?DateWhen the callback was completedsrc/types/callback.types.ts:63
attemptsnumberNumber of callback attemptssrc/types/callback.types.ts:66
maxAttemptsnumberMaximum attempts before marking as failedsrc/types/callback.types.ts:69
handledBy?stringAgent who handled the callbacksrc/types/callback.types.ts:72
channel?stringChannel ID when callback is in progresssrc/types/callback.types.ts:75
duration?numberDuration of the callback call in secondssrc/types/callback.types.ts:78
disposition?"failed" | "no_answer" | "busy" | "answered" | "voicemail"Result/disposition of the callbacksrc/types/callback.types.ts:81
metadata?Record<string, string>Custom metadatasrc/types/callback.types.ts:84

Participant

Defined in: src/types/conference.types.ts:45

Conference participant

Properties

PropertyTypeDescriptionDefined in
idstringParticipant IDsrc/types/conference.types.ts:47
uristringParticipant URIsrc/types/conference.types.ts:49
displayName?stringDisplay namesrc/types/conference.types.ts:51
stateParticipantStateParticipant statesrc/types/conference.types.ts:53
isMutedbooleanIs mutedsrc/types/conference.types.ts:55
isOnHoldbooleanIs on holdsrc/types/conference.types.ts:57
isModeratorbooleanIs moderatorsrc/types/conference.types.ts:59
isSelfbooleanIs self (local participant)src/types/conference.types.ts:61
audioLevel?numberAudio level (0-1)src/types/conference.types.ts:63
stream?MediaStreamMedia streamsrc/types/conference.types.ts:65
joinedAtDateJoin timesrc/types/conference.types.ts:67
metadata?Record<string, unknown>Custom metadatasrc/types/conference.types.ts:69

ConferenceStateInterface

Defined in: src/types/conference.types.ts:75

Conference state interface

Properties

PropertyTypeDescriptionDefined in
idstringConference IDsrc/types/conference.types.ts:77
stateConferenceStateConference statesrc/types/conference.types.ts:79
uri?stringConference URIsrc/types/conference.types.ts:81
participantsMap<string, Participant>Participantssrc/types/conference.types.ts:83
localParticipant?ParticipantLocal participantsrc/types/conference.types.ts:85
maxParticipants?numberMaximum participants allowedsrc/types/conference.types.ts:87
startedAt?DateStart timesrc/types/conference.types.ts:89
endedAt?DateEnd timesrc/types/conference.types.ts:91
isLockedbooleanIs lockedsrc/types/conference.types.ts:93
isRecordingbooleanIs recordingsrc/types/conference.types.ts:95
metadata?Record<string, unknown>Custom metadatasrc/types/conference.types.ts:97

ConferenceOptions

Defined in: src/types/conference.types.ts:103

Conference options

Properties

PropertyTypeDescriptionDefined in
maxParticipants?numberMaximum participantssrc/types/conference.types.ts:105
enableRecording?booleanEnable recordingsrc/types/conference.types.ts:107
enableVideo?booleanEnable videosrc/types/conference.types.ts:109
locked?booleanLock conference on creationsrc/types/conference.types.ts:111
moderatorPin?stringModerator PINsrc/types/conference.types.ts:113
metadata?Record<string, unknown>Custom metadatasrc/types/conference.types.ts:115

ConferenceEvent

Defined in: src/types/conference.types.ts:121

Conference event

Extended by

Properties

PropertyTypeDescriptionDefined in
typestringEvent typesrc/types/conference.types.ts:123
conferenceIdstringConference IDsrc/types/conference.types.ts:125
state?ConferenceStateConference statesrc/types/conference.types.ts:127
participant?ParticipantParticipant (if applicable)src/types/conference.types.ts:129
timestampDateTimestampsrc/types/conference.types.ts:131
data?unknownAdditional datasrc/types/conference.types.ts:133

ParticipantJoinedEvent

Defined in: src/types/conference.types.ts:139

Participant joined event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
conferenceIdstringConference ID-ConferenceEvent.conferenceIdsrc/types/conference.types.ts:125
state?ConferenceStateConference state-ConferenceEvent.statesrc/types/conference.types.ts:127
timestampDateTimestamp-ConferenceEvent.timestampsrc/types/conference.types.ts:131
data?unknownAdditional data-ConferenceEvent.datasrc/types/conference.types.ts:133
type"participant:joined"Event typeConferenceEvent.type-src/types/conference.types.ts:140
participantParticipantParticipant (if applicable)ConferenceEvent.participant-src/types/conference.types.ts:141

ParticipantLeftEvent

Defined in: src/types/conference.types.ts:147

Participant left event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
conferenceIdstringConference ID-ConferenceEvent.conferenceIdsrc/types/conference.types.ts:125
state?ConferenceStateConference state-ConferenceEvent.statesrc/types/conference.types.ts:127
timestampDateTimestamp-ConferenceEvent.timestampsrc/types/conference.types.ts:131
data?unknownAdditional data-ConferenceEvent.datasrc/types/conference.types.ts:133
type"participant:left"Event typeConferenceEvent.type-src/types/conference.types.ts:148
participantParticipantParticipant (if applicable)ConferenceEvent.participant-src/types/conference.types.ts:149
reason?stringReason for leaving--src/types/conference.types.ts:151

ParticipantUpdatedEvent

Defined in: src/types/conference.types.ts:157

Participant updated event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
conferenceIdstringConference ID-ConferenceEvent.conferenceIdsrc/types/conference.types.ts:125
state?ConferenceStateConference state-ConferenceEvent.statesrc/types/conference.types.ts:127
timestampDateTimestamp-ConferenceEvent.timestampsrc/types/conference.types.ts:131
data?unknownAdditional data-ConferenceEvent.datasrc/types/conference.types.ts:133
type"participant:updated"Event typeConferenceEvent.type-src/types/conference.types.ts:158
participantParticipantParticipant (if applicable)ConferenceEvent.participant-src/types/conference.types.ts:159
changesPartial<Participant>Changed properties--src/types/conference.types.ts:161

AudioLevelEvent

Defined in: src/types/conference.types.ts:167

Audio level event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
conferenceIdstringConference ID-ConferenceEvent.conferenceIdsrc/types/conference.types.ts:125
state?ConferenceStateConference state-ConferenceEvent.statesrc/types/conference.types.ts:127
participant?ParticipantParticipant (if applicable)-ConferenceEvent.participantsrc/types/conference.types.ts:129
timestampDateTimestamp-ConferenceEvent.timestampsrc/types/conference.types.ts:131
data?unknownAdditional data-ConferenceEvent.datasrc/types/conference.types.ts:133
type"audio:level"Event typeConferenceEvent.type-src/types/conference.types.ts:168
levelsMap<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

PropertyTypeDescriptionDefined in
urlsstring | readonly string[]TURN server URLs (e.g., 'turn:turn.example.com:3478')src/types/config.types.ts:11
username?stringUsername for TURN server authenticationsrc/types/config.types.ts:13
credential?stringCredential for TURN server authenticationsrc/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

PropertyTypeDescriptionDefined in
audio?| boolean | MediaTrackConstraints | { [key: string]: unknown; }Audio constraintssrc/types/config.types.ts:28
video?| boolean | MediaTrackConstraints | { [key: string]: unknown; }Video constraintssrc/types/config.types.ts:30
echoCancellation?booleanEnable echo cancellation (default: true)src/types/config.types.ts:32
noiseSuppression?booleanEnable noise suppression (default: true)src/types/config.types.ts:34
autoGainControl?booleanEnable auto gain control (default: true)src/types/config.types.ts:36
audioCodec?"opus" | "pcmu" | "pcma" | "g722"Preferred audio codecsrc/types/config.types.ts:38
videoCodec?"vp8" | "vp9" | "h264"Preferred video codecsrc/types/config.types.ts:40
dataChannel?booleanEnable data channelsrc/types/config.types.ts:42

UserPreferences

Defined in: src/types/config.types.ts:48

User preferences for the SIP client

Properties

PropertyTypeDescriptionDefined in
audioInputDeviceId?stringDefault audio input device IDsrc/types/config.types.ts:50
audioOutputDeviceId?stringDefault audio output device IDsrc/types/config.types.ts:52
videoInputDeviceId?stringDefault video input device IDsrc/types/config.types.ts:54
enableAudio?booleanEnable local audio by defaultsrc/types/config.types.ts:56
enableVideo?booleanEnable local video by defaultsrc/types/config.types.ts:58
autoAnswer?booleanAuto-answer incoming callssrc/types/config.types.ts:60
autoAnswerDelay?numberAuto-answer delay in millisecondssrc/types/config.types.ts:62
ringToneUrl?stringRing tone URLsrc/types/config.types.ts:64
ringBackToneUrl?stringRing back tone URLsrc/types/config.types.ts:66
enableDtmfTones?booleanEnable DTMF tonessrc/types/config.types.ts:68

ExtendedRTCConfiguration

Defined in: src/types/config.types.ts:74

Extended RTCConfiguration with VueSip-specific options

Extends

  • RTCConfiguration

Properties

PropertyTypeDescriptionOverridesDefined 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?RTCIceTransportPolicyICE transport policyRTCConfiguration.iceTransportPolicysrc/types/config.types.ts:80
bundlePolicy?RTCBundlePolicyBundle policyRTCConfiguration.bundlePolicysrc/types/config.types.ts:82
rtcpMuxPolicy?"require"RTC configurationRTCConfiguration.rtcpMuxPolicysrc/types/config.types.ts:84
iceCandidatePoolSize?numberICE candidate pool sizeRTCConfiguration.iceCandidatePoolSizesrc/types/config.types.ts:86

SipClientConfig

Defined in: src/types/config.types.ts:92

Main SIP client configuration

Properties

PropertyTypeDescriptionDefined in
uristringWebSocket SIP server URI (e.g., 'wss://sip.example.com:7443')src/types/config.types.ts:94
sipUristringSIP user URI (e.g., 'sip:user@domain.com')src/types/config.types.ts:96
passwordstringSIP password for authenticationsrc/types/config.types.ts:98
displayName?stringDisplay name for the usersrc/types/config.types.ts:100
authorizationUsername?stringAuthorization username (if different from SIP username)src/types/config.types.ts:102
realm?stringSIP realm for authenticationsrc/types/config.types.ts:104
ha1?stringHA1 hash for enhanced security (alternative to password)src/types/config.types.ts:106
wsOptions?objectWebSocket connection optionssrc/types/config.types.ts:109
wsOptions.protocols?readonly string[]WebSocket protocolssrc/types/config.types.ts:111
wsOptions.connectionTimeout?numberConnection timeout in milliseconds (default: 10000)src/types/config.types.ts:113
wsOptions.maxReconnectionAttempts?numberMaximum reconnection attempts (default: 5)src/types/config.types.ts:115
wsOptions.reconnectionDelay?numberReconnection delay in milliseconds (default: 2000)src/types/config.types.ts:117
registrationOptions?objectRegistration optionssrc/types/config.types.ts:121
registrationOptions.expires?numberRegistration expiry time in seconds (default: 600)src/types/config.types.ts:123
registrationOptions.autoRegister?booleanEnable automatic registration on connection (default: true)src/types/config.types.ts:125
registrationOptions.registrationRetryInterval?numberRegistration retry interval in milliseconds (default: 30000)src/types/config.types.ts:127
sessionOptions?objectSession optionssrc/types/config.types.ts:131
sessionOptions.sessionTimers?booleanSession timers (default: true)src/types/config.types.ts:133
sessionOptions.sessionTimersRefreshMethod?"INVITE" | "UPDATE"Session timers refresh methodsrc/types/config.types.ts:135
sessionOptions.maxConcurrentCalls?numberMaximum concurrent calls (default: 1)src/types/config.types.ts:137
sessionOptions.callTimeout?numberCall timeout in milliseconds (default: 60000)src/types/config.types.ts:139
mediaConfiguration?MediaConfigurationMedia configurationsrc/types/config.types.ts:143
rtcConfiguration?ExtendedRTCConfigurationRTC configurationsrc/types/config.types.ts:146
userPreferences?UserPreferencesUser preferencessrc/types/config.types.ts:149
userAgent?stringUser agent stringsrc/types/config.types.ts:152
debug?booleanEnable debug modesrc/types/config.types.ts:155
logger?objectLogger 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

PropertyTypeDescriptionDefined in
validbooleanWhether the validation passedsrc/types/config.types.ts:171
errors?string[]Error messages if validation failedsrc/types/config.types.ts:173
warnings?string[]Warning messagessrc/types/config.types.ts:175

NetworkInfo

Defined in: src/types/connection-recovery.types.ts:9

Network information from Network Information API

Properties

PropertyTypeDescriptionDefined in
typestringConnection type (wifi, cellular, ethernet, etc.)src/types/connection-recovery.types.ts:11
effectiveTypestringEffective connection type (4g, 3g, 2g, slow-2g)src/types/connection-recovery.types.ts:13
downlinknumberDownlink speed in Mbpssrc/types/connection-recovery.types.ts:15
rttnumberRound-trip time in mssrc/types/connection-recovery.types.ts:17
isOnlinebooleanWhether browser is onlinesrc/types/connection-recovery.types.ts:19

IceHealthStatus

Defined in: src/types/connection-recovery.types.ts:42

ICE connection health status

Properties

PropertyTypeDescriptionDefined in
iceStateRTCIceConnectionStateCurrent ICE connection statesrc/types/connection-recovery.types.ts:44
stateAgenumberTime since last state change (ms)src/types/connection-recovery.types.ts:46
recoveryAttemptsnumberNumber of recovery attemptssrc/types/connection-recovery.types.ts:48
isHealthybooleanWhether connection is considered healthysrc/types/connection-recovery.types.ts:50

RecoveryAttempt

Defined in: src/types/connection-recovery.types.ts:56

Recovery attempt result

Properties

PropertyTypeDescriptionDefined in
attemptnumberAttempt numbersrc/types/connection-recovery.types.ts:58
strategyRecoveryStrategyStrategy usedsrc/types/connection-recovery.types.ts:60
successbooleanWhether attempt succeededsrc/types/connection-recovery.types.ts:62
durationnumberDuration of attempt (ms)src/types/connection-recovery.types.ts:64
error?stringError if failedsrc/types/connection-recovery.types.ts:66
timestampnumberTimestampsrc/types/connection-recovery.types.ts:68

ConnectionRecoveryOptions

Defined in: src/types/connection-recovery.types.ts:74

Connection recovery options

Properties

PropertyTypeDescriptionDefined in
autoRecover?booleanEnable automatic recovery (default: true)src/types/connection-recovery.types.ts:76
maxAttempts?numberMaximum recovery attempts before giving up (default: 3)src/types/connection-recovery.types.ts:78
attemptDelay?numberDelay between attempts in ms (default: 2000)src/types/connection-recovery.types.ts:80
iceRestartTimeout?numberICE restart timeout in ms (default: 10000)src/types/connection-recovery.types.ts:82
strategy?RecoveryStrategyStrategy to use (default: 'ice-restart')src/types/connection-recovery.types.ts:84
autoReconnectOnNetworkChange?booleanEnable automatic reconnection on network changes (default: false)src/types/connection-recovery.types.ts:86
networkChangeDelay?numberDelay before triggering recovery after network change in ms (default: 500)src/types/connection-recovery.types.ts:88
exponentialBackoff?booleanUse exponential backoff for retry delays (default: false)src/types/connection-recovery.types.ts:90
maxBackoffDelay?numberMaximum 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?() => voidCallback when recovery startssrc/types/connection-recovery.types.ts:96
onRecoverySuccess?(attempt) => voidCallback when recovery succeedssrc/types/connection-recovery.types.ts:98
onRecoveryFailed?(attempts) => voidCallback when recovery failssrc/types/connection-recovery.types.ts:100
onNetworkChange?(info) => voidCallback 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

PropertyTypeDescriptionDefined in
stateComputedRef<RecoveryState>Current recovery state (readonly)src/types/connection-recovery.types.ts:110
iceHealthComputedRef<IceHealthStatus>Current ICE health status (readonly)src/types/connection-recovery.types.ts:112
attemptsComputedRef<RecoveryAttempt[]>History of recovery attempts (readonly)src/types/connection-recovery.types.ts:114
isRecoveringComputedRef<boolean>Whether recovery is in progresssrc/types/connection-recovery.types.ts:116
isHealthyComputedRef<boolean>Whether connection is healthysrc/types/connection-recovery.types.ts:118
errorComputedRef<string | null>Last error message (readonly)src/types/connection-recovery.types.ts:120
networkInfoComputedRef<NetworkInfo>Current network information (readonly)src/types/connection-recovery.types.ts:122
recover() => Promise<boolean>Manually trigger recoverysrc/types/connection-recovery.types.ts:124
reset() => voidReset recovery statesrc/types/connection-recovery.types.ts:126
monitor(pc) => voidStart monitoring a peer connectionsrc/types/connection-recovery.types.ts:128
stopMonitoring() => voidStop monitoringsrc/types/connection-recovery.types.ts:130

SipResponse

Defined in: src/types/events.types.ts:15

SIP Response helper interface

Indexable

ts
[key: string]: unknown

Properties

PropertyTypeDefined in
status_code?numbersrc/types/events.types.ts:16
reason_phrase?stringsrc/types/events.types.ts:17
headers?Record<string, unknown>src/types/events.types.ts:18
body?stringsrc/types/events.types.ts:19

SipRequest

Defined in: src/types/events.types.ts:26

SIP Request helper interface

Indexable

ts
[key: string]: unknown

Properties

PropertyTypeDefined in
method?stringsrc/types/events.types.ts:27
ruri?stringsrc/types/events.types.ts:28
headers?Record<string, unknown>src/types/events.types.ts:29
body?stringsrc/types/events.types.ts:30

SipSession

Defined in: src/types/events.types.ts:37

SIP Session helper interface (for event types)

Indexable

ts
[key: string]: unknown

Properties

PropertyTypeDefined in
id?stringsrc/types/events.types.ts:38
direction?"outgoing" | "incoming"src/types/events.types.ts:39
status?stringsrc/types/events.types.ts:40
connection?RTCPeerConnectionsrc/types/events.types.ts:41

SipMessage

Defined in: src/types/events.types.ts:48

SIP Message helper interface

Indexable

ts
[key: string]: unknown

Properties

PropertyTypeDefined in
direction"outgoing" | "incoming"src/types/events.types.ts:49
body?stringsrc/types/events.types.ts:50
contentType?stringsrc/types/events.types.ts:51

SipEventObject

Defined in: src/types/events.types.ts:58

SIP Event Object helper interface

Indexable

ts
[key: string]: unknown

Properties

PropertyTypeDefined in
eventstringsrc/types/events.types.ts:59

BaseEvent

Defined in: src/types/events.types.ts:66

Base event interface

Extended by

Type Parameters

Type ParameterDefault type
Tunknown

Properties

PropertyTypeDescriptionDefined in
typestringEvent typesrc/types/events.types.ts:68
payload?TEvent payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurredsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadatasrc/types/events.types.ts:74

EventListenerOptions

Defined in: src/types/events.types.ts:95

Event listener options

Properties

PropertyTypeDescriptionDefined in
once?booleanExecute only oncesrc/types/events.types.ts:97
priority?numberPriority (higher priority handlers execute first)src/types/events.types.ts:99
id?stringHandler 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

ts
[key: string]: BaseEvent<unknown>

Properties

PropertyTypeDefined in
connectedConnectionEventsrc/types/events.types.ts:191
disconnectedConnectionEventsrc/types/events.types.ts:192
connectingConnectionEventsrc/types/events.types.ts:193
connection_failedConnectionEventsrc/types/events.types.ts:194
reconnectingConnectionEventsrc/types/events.types.ts:195
registeredRegistrationEventsrc/types/events.types.ts:198
unregisteredRegistrationEventsrc/types/events.types.ts:199
registeringRegistrationEventsrc/types/events.types.ts:200
registration_failedRegistrationEventsrc/types/events.types.ts:201
call:incomingCallEventsrc/types/events.types.ts:204
call:outgoingCallEventsrc/types/events.types.ts:205
call:progressCallEventsrc/types/events.types.ts:206
call:ringingCallEventsrc/types/events.types.ts:207
call:acceptedCallEventsrc/types/events.types.ts:208
call:confirmedCallEventsrc/types/events.types.ts:209
call:failedCallEventsrc/types/events.types.ts:210
call:endedCallEventsrc/types/events.types.ts:211
call:holdCallEventsrc/types/events.types.ts:212
call:unholdCallEventsrc/types/events.types.ts:213
call:mutedCallEventsrc/types/events.types.ts:214
call:unmutedCallEventsrc/types/events.types.ts:215
media:stream:addedMediaStreamEventsrc/types/events.types.ts:218
media:stream:removedMediaStreamEventsrc/types/events.types.ts:219
media:track:addedMediaTrackEventsrc/types/events.types.ts:220
media:track:removedMediaTrackEventsrc/types/events.types.ts:221
media:track:mutedMediaTrackEventsrc/types/events.types.ts:222
media:track:unmutedMediaTrackEventsrc/types/events.types.ts:223
media:device:changedMediaDeviceChangeEventsrc/types/events.types.ts:224
call:transfer_initiatedCallTransferInitiatedEventsrc/types/events.types.ts:227
call:transfer_acceptedCallTransferAcceptedEventsrc/types/events.types.ts:228
call:transfer_failedCallTransferFailedEventsrc/types/events.types.ts:229
call:transfer_completedCallTransferCompletedEventsrc/types/events.types.ts:230
sip:connectedSipConnectedEventsrc/types/events.types.ts:233
sip:disconnectedSipDisconnectedEventsrc/types/events.types.ts:234
sip:registeredSipRegisteredEventsrc/types/events.types.ts:235
sip:unregisteredSipUnregisteredEventsrc/types/events.types.ts:236
sip:registration_failedSipRegistrationFailedEventsrc/types/events.types.ts:237
sip:registration_expiringSipRegistrationExpiringEventsrc/types/events.types.ts:238
sip:new_sessionSipNewSessionEventsrc/types/events.types.ts:239
sip:new_messageSipNewMessageEventsrc/types/events.types.ts:240
sip:eventSipGenericEventsrc/types/events.types.ts:241
sip:conference:createdConferenceCreatedEventsrc/types/events.types.ts:244
sip:conference:joinedConferenceJoinedEventsrc/types/events.types.ts:245
sip:conference:endedConferenceEndedEventsrc/types/events.types.ts:246
sip:conference:participant:joinedConferenceParticipantJoinedEventsrc/types/events.types.ts:247
sip:conference:participant:leftConferenceParticipantLeftEventsrc/types/events.types.ts:248
sip:conference:participant:invitedConferenceParticipantInvitedEventsrc/types/events.types.ts:249
sip:conference:participant:removedConferenceParticipantRemovedEventsrc/types/events.types.ts:250
sip:conference:participant:mutedConferenceParticipantMutedEventsrc/types/events.types.ts:251
sip:conference:participant:unmutedConferenceParticipantUnmutedEventsrc/types/events.types.ts:252
sip:conference:recording:startedConferenceRecordingStartedEventsrc/types/events.types.ts:253
sip:conference:recording:stoppedConferenceRecordingStoppedEventsrc/types/events.types.ts:254
sip:audio:mutedAudioMutedEventsrc/types/events.types.ts:257
sip:audio:unmutedAudioUnmutedEventsrc/types/events.types.ts:258
sip:video:disabledVideoDisabledEventsrc/types/events.types.ts:261
sip:video:enabledVideoEnabledEventsrc/types/events.types.ts:262
sip:presence:publishPresencePublishEventsrc/types/events.types.ts:265
sip:presence:subscribePresenceSubscribeEventsrc/types/events.types.ts:266
sip:presence:unsubscribePresenceUnsubscribeEventsrc/types/events.types.ts:267
plugin:installedPluginInstalledEventsrc/types/events.types.ts:270
plugin:errorPluginErrorEventsrc/types/events.types.ts:271
plugin:unregisteredPluginUnregisteredEventsrc/types/events.types.ts:272
plugin:configUpdatedPluginConfigUpdatedEventsrc/types/events.types.ts:273

ErrorEvent

Defined in: src/types/events.types.ts:282

Error event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"error"Event typeBaseEvent.type-src/types/events.types.ts:283
errorErrorError object--src/types/events.types.ts:285
context?stringError 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

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:connected"Event typeBaseEvent.type-src/types/events.types.ts:296
transport?stringTransport URL--src/types/events.types.ts:298

SipDisconnectedEvent

Defined in: src/types/events.types.ts:304

SIP Disconnected event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:disconnected"Event typeBaseEvent.type-src/types/events.types.ts:305
error?anyError if applicable--src/types/events.types.ts:308

SipRegisteredEvent

Defined in: src/types/events.types.ts:314

SIP Registered event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:registered"Event typeBaseEvent.type-src/types/events.types.ts:315
uristringRegistered URI--src/types/events.types.ts:317
expires?string | numberExpiry time in seconds--src/types/events.types.ts:319

SipUnregisteredEvent

Defined in: src/types/events.types.ts:325

SIP Unregistered event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:unregistered"Event typeBaseEvent.type-src/types/events.types.ts:326
cause?stringUnregistration cause--src/types/events.types.ts:328

SipRegistrationFailedEvent

Defined in: src/types/events.types.ts:334

SIP Registration Failed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:registration_failed"Event typeBaseEvent.type-src/types/events.types.ts:335
cause?stringFailure cause--src/types/events.types.ts:337
response?SipResponseResponse object--src/types/events.types.ts:339

SipRegistrationExpiringEvent

Defined in: src/types/events.types.ts:345

SIP Registration Expiring event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:registration_expiring"Event typeBaseEvent.type-src/types/events.types.ts:346

SipNewSessionEvent

Defined in: src/types/events.types.ts:352

SIP New Session event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:new_session"Event typeBaseEvent.type-src/types/events.types.ts:353
sessionSipSessionSession object--src/types/events.types.ts:355
originator"local" | "remote"Session originator--src/types/events.types.ts:357
request?SipRequestSIP request object--src/types/events.types.ts:359
callIdstringCall ID--src/types/events.types.ts:361

SipNewMessageEvent

Defined in: src/types/events.types.ts:367

SIP New Message event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:new_message"Event typeBaseEvent.type-src/types/events.types.ts:368
messageSipMessageMessage object--src/types/events.types.ts:370
originator"local" | "remote"Message originator--src/types/events.types.ts:372
request?SipRequestSIP request object--src/types/events.types.ts:374
fromstringSender URI--src/types/events.types.ts:376
contentstringMessage content--src/types/events.types.ts:378
contentType?stringContent type--src/types/events.types.ts:380

SipGenericEvent

Defined in: src/types/events.types.ts:386

SIP Generic Event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:event"Event typeBaseEvent.type-src/types/events.types.ts:387
eventSipEventObjectEvent object--src/types/events.types.ts:389
requestSipRequestRequest object--src/types/events.types.ts:391

ConferenceCreatedEvent

Defined in: src/types/events.types.ts:397

Conference Created event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:created"Event typeBaseEvent.type-src/types/events.types.ts:398
conferenceIdstringConference ID--src/types/events.types.ts:400
conferenceConferenceStateInterfaceConference state--src/types/events.types.ts:402

ConferenceJoinedEvent

Defined in: src/types/events.types.ts:408

Conference Joined event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:joined"Event typeBaseEvent.type-src/types/events.types.ts:409
conferenceIdstringConference ID--src/types/events.types.ts:411
conferenceConferenceStateInterfaceConference state--src/types/events.types.ts:413

ConferenceEndedEvent

Defined in: src/types/events.types.ts:419

Conference Ended event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:ended"Event typeBaseEvent.type-src/types/events.types.ts:420
conferenceIdstringConference ID--src/types/events.types.ts:422
conferenceConferenceStateInterfaceConference state--src/types/events.types.ts:424

ConferenceParticipantJoinedEvent

Defined in: src/types/events.types.ts:430

Conference Participant Joined event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:participant:joined"Event typeBaseEvent.type-src/types/events.types.ts:431
conferenceIdstringConference ID--src/types/events.types.ts:433
participantParticipantParticipant--src/types/events.types.ts:435

ConferenceParticipantLeftEvent

Defined in: src/types/events.types.ts:441

Conference Participant Left event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:participant:left"Event typeBaseEvent.type-src/types/events.types.ts:442
conferenceIdstringConference ID--src/types/events.types.ts:444
participantParticipantParticipant--src/types/events.types.ts:446

ConferenceParticipantInvitedEvent

Defined in: src/types/events.types.ts:452

Conference Participant Invited event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:participant:invited"Event typeBaseEvent.type-src/types/events.types.ts:453
conferenceIdstringConference ID--src/types/events.types.ts:455
participantParticipantParticipant--src/types/events.types.ts:457

ConferenceParticipantRemovedEvent

Defined in: src/types/events.types.ts:463

Conference Participant Removed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:participant:removed"Event typeBaseEvent.type-src/types/events.types.ts:464
conferenceIdstringConference ID--src/types/events.types.ts:466
participantParticipantParticipant--src/types/events.types.ts:468

ConferenceParticipantMutedEvent

Defined in: src/types/events.types.ts:474

Conference Participant Muted event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:participant:muted"Event typeBaseEvent.type-src/types/events.types.ts:475
conferenceIdstringConference ID--src/types/events.types.ts:477
participantParticipantParticipant--src/types/events.types.ts:479

ConferenceParticipantUnmutedEvent

Defined in: src/types/events.types.ts:485

Conference Participant Unmuted event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:participant:unmuted"Event typeBaseEvent.type-src/types/events.types.ts:486
conferenceIdstringConference ID--src/types/events.types.ts:488
participantParticipantParticipant--src/types/events.types.ts:490

ConferenceRecordingStartedEvent

Defined in: src/types/events.types.ts:496

Conference Recording Started event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:recording:started"Event typeBaseEvent.type-src/types/events.types.ts:497
conferenceIdstringConference ID--src/types/events.types.ts:499

ConferenceRecordingStoppedEvent

Defined in: src/types/events.types.ts:505

Conference Recording Stopped event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:conference:recording:stopped"Event typeBaseEvent.type-src/types/events.types.ts:506
conferenceIdstringConference ID--src/types/events.types.ts:508

AudioMutedEvent

Defined in: src/types/events.types.ts:514

Audio Muted event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:audio:muted"Event typeBaseEvent.type-src/types/events.types.ts:515

AudioUnmutedEvent

Defined in: src/types/events.types.ts:521

Audio Unmuted event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:audio:unmuted"Event typeBaseEvent.type-src/types/events.types.ts:522

VideoDisabledEvent

Defined in: src/types/events.types.ts:528

Video Disabled event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:video:disabled"Event typeBaseEvent.type-src/types/events.types.ts:529

VideoEnabledEvent

Defined in: src/types/events.types.ts:535

Video Enabled event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:video:enabled"Event typeBaseEvent.type-src/types/events.types.ts:536

PresencePublishEvent

Defined in: src/types/events.types.ts:542

Presence Publish event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:presence:publish"Event typeBaseEvent.type-src/types/events.types.ts:543
presencePresencePublishOptionsPresence options--src/types/events.types.ts:545
bodystringPIDF 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

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:presence:subscribe"Event typeBaseEvent.type-src/types/events.types.ts:556
uristringTarget URI--src/types/events.types.ts:558
options?PresenceSubscriptionOptionsSubscription options--src/types/events.types.ts:560

PresenceUnsubscribeEvent

Defined in: src/types/events.types.ts:566

Presence Unsubscribe event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"sip:presence:unsubscribe"Event typeBaseEvent.type-src/types/events.types.ts:567
uristringTarget URI--src/types/events.types.ts:569

PluginInstalledEvent

Defined in: src/types/events.types.ts:575

Plugin Installed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
type"plugin:installed"Event typeBaseEvent.type-src/types/events.types.ts:576
pluginNamestringPlugin name--src/types/events.types.ts:578
metadataobjectPlugin metadataBaseEvent.metadata-src/types/events.types.ts:580
metadata.namestring---src/types/events.types.ts:581
metadata.versionstring---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

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"plugin:error"Event typeBaseEvent.type-src/types/events.types.ts:596
pluginNamestringPlugin name--src/types/events.types.ts:598
errorunknownError that occurred--src/types/events.types.ts:600

PluginUnregisteredEvent

Defined in: src/types/events.types.ts:606

Plugin Unregistered event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"plugin:unregistered"Event typeBaseEvent.type-src/types/events.types.ts:607
pluginNamestringPlugin name--src/types/events.types.ts:609

PluginConfigUpdatedEvent

Defined in: src/types/events.types.ts:615

Plugin Config Updated event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"plugin:configUpdated"Event typeBaseEvent.type-src/types/events.types.ts:616
pluginNamestringPlugin name--src/types/events.types.ts:618
configRecord<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

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"call:transfer_initiated"Event typeBaseEvent.type-src/types/events.types.ts:627
targetstringTransfer target URI--src/types/events.types.ts:629
transferType"blind" | "attended"Transfer method--src/types/events.types.ts:631
replaceCallId?stringReplace 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

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"call:transfer_accepted"Event typeBaseEvent.type-src/types/events.types.ts:640
targetstringTransfer target URI--src/types/events.types.ts:642

CallTransferFailedEvent

Defined in: src/types/events.types.ts:648

Call Transfer Failed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"call:transfer_failed"Event typeBaseEvent.type-src/types/events.types.ts:649
targetstringTransfer target URI--src/types/events.types.ts:651
error?stringError message--src/types/events.types.ts:653

CallTransferCompletedEvent

Defined in: src/types/events.types.ts:659

Call Transfer Completed event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"call:transfer_completed"Event typeBaseEvent.type-src/types/events.types.ts:660
targetstringTransfer target URI--src/types/events.types.ts:662

EventEmitter

Defined in: src/types/events.types.ts:668

Event emitter interface

Methods

on()
ts
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
ParameterType
eventK
handlerEventHandler<EventMap[K]>
options?EventListenerOptions
Returns

void

once()
ts
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
ParameterType
eventK
handlerEventHandler<EventMap[K]>
Returns

void

off()
ts
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
ParameterType
eventK
handlerEventHandler<EventMap[K]>
Returns

void

emit()
ts
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
ParameterType
eventK
dataEventMap[K]
Returns

void

removeAllListeners()
ts
removeAllListeners(event?): void;

Defined in: src/types/events.types.ts:696

Remove all listeners for an event or all events

Parameters
ParameterType
event?keyof EventMap
Returns

void

waitFor()
ts
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
ParameterType
eventK
timeout?number
Returns

Promise<EventMap[K]>


ContainerSize

Defined in: src/types/gallery-layout.types.ts:25

Container dimensions for layout calculations

Properties

PropertyTypeDescriptionDefined in
widthnumberContainer width in pixelssrc/types/gallery-layout.types.ts:27
heightnumberContainer height in pixelssrc/types/gallery-layout.types.ts:29

TileDimensions

Defined in: src/types/gallery-layout.types.ts:35

Tile dimensions for participant video tiles

Properties

PropertyTypeDescriptionDefined in
widthnumberTile width in pixelssrc/types/gallery-layout.types.ts:37
heightnumberTile height in pixelssrc/types/gallery-layout.types.ts:39

GalleryLayoutOptions

Defined in: src/types/gallery-layout.types.ts:45

Gallery layout options

Properties

PropertyTypeDescriptionDefined in
containerSize?Ref<ContainerSize, ContainerSize>Container size for dimension calculationssrc/types/gallery-layout.types.ts:47
gap?numberGap between tiles in pixels. Default: 8src/types/gallery-layout.types.ts:49
activeSpeakerId?Ref<string | null, string | null>Active speaker ID for speaker-focused layoutssrc/types/gallery-layout.types.ts:51
maxCols?numberMaximum columns. Default: 4src/types/gallery-layout.types.ts:53
maxRows?numberMaximum rows. Default: 4src/types/gallery-layout.types.ts:55
aspectRatio?numberAspect ratio for tiles (width/height). Default: 16/9src/types/gallery-layout.types.ts:57

UseGalleryLayoutReturn

Defined in: src/types/gallery-layout.types.ts:63

Return type for useGalleryLayout composable

Properties

PropertyTypeDescriptionDefined in
layoutRef<GalleryLayoutMode>Current layout modesrc/types/gallery-layout.types.ts:65
gridColsComputedRef<number>Number of grid columnssrc/types/gallery-layout.types.ts:67
gridRowsComputedRef<number>Number of grid rowssrc/types/gallery-layout.types.ts:69
tileDimensionsComputedRef<TileDimensions>Calculated tile dimensionssrc/types/gallery-layout.types.ts:71
gridStyleComputedRef<string>CSS grid style stringsrc/types/gallery-layout.types.ts:73
focusedParticipantIdComputedRef<string | null>Currently focused participant ID (for speaker layout)src/types/gallery-layout.types.ts:75
pinnedParticipantIdRef<string | null>Pinned participant IDsrc/types/gallery-layout.types.ts:77
setLayout(mode) => voidSet layout modesrc/types/gallery-layout.types.ts:79
pinParticipant(id) => voidPin a participant to focussrc/types/gallery-layout.types.ts:81
unpinParticipant() => voidUnpin the focused participantsrc/types/gallery-layout.types.ts:83

CallHistoryEntry

Defined in: src/types/history.types.ts:11

Call history entry

Properties

PropertyTypeDescriptionDefined in
idstringEntry IDsrc/types/history.types.ts:13
directionCallDirectionCall directionsrc/types/history.types.ts:15
remoteUristringRemote URIsrc/types/history.types.ts:17
remoteDisplayName?stringRemote display namesrc/types/history.types.ts:19
localUristringLocal URIsrc/types/history.types.ts:21
startTimeDateCall start timesrc/types/history.types.ts:23
answerTime?DateCall answer time (if answered)src/types/history.types.ts:25
endTimeDateCall end timesrc/types/history.types.ts:27
durationnumberCall duration in secondssrc/types/history.types.ts:29
ringDuration?numberRing duration in secondssrc/types/history.types.ts:31
finalStateCallStateFinal call statesrc/types/history.types.ts:33
terminationCauseTerminationCauseTermination causesrc/types/history.types.ts:35
wasAnsweredbooleanWas answeredsrc/types/history.types.ts:37
wasMissedbooleanWas missed (for incoming calls)src/types/history.types.ts:39
hasVideobooleanWas video callsrc/types/history.types.ts:41
tags?readonly string[]Custom tagssrc/types/history.types.ts:43
metadata?Record<string, unknown>Custom metadatasrc/types/history.types.ts:45

HistoryFilter

Defined in: src/types/history.types.ts:51

History filter options

Properties

PropertyTypeDescriptionDefined in
direction?CallDirectionFilter by directionsrc/types/history.types.ts:53
remoteUri?stringFilter by remote URIsrc/types/history.types.ts:55
wasAnswered?booleanFilter by answered/unansweredsrc/types/history.types.ts:57
wasMissed?booleanFilter by missed callssrc/types/history.types.ts:59
hasVideo?booleanFilter by video callssrc/types/history.types.ts:61
dateFrom?DateFilter by date range (from)src/types/history.types.ts:63
dateTo?DateFilter by date range (to)src/types/history.types.ts:65
tags?readonly string[]Filter by tagssrc/types/history.types.ts:67
searchQuery?stringSearch query (searches in URI and display name)src/types/history.types.ts:69
sortBy?"remoteUri" | "startTime" | "duration"Sort fieldsrc/types/history.types.ts:71
sortOrder?"desc" | "asc"Sort ordersrc/types/history.types.ts:73
limit?numberLimit resultssrc/types/history.types.ts:75
offset?numberOffset for paginationsrc/types/history.types.ts:77

HistoryExportOptions

Defined in: src/types/history.types.ts:95

History export options

Properties

PropertyTypeDescriptionDefined in
formatHistoryExportFormatExport formatsrc/types/history.types.ts:97
filter?HistoryFilterFilter to apply before exportsrc/types/history.types.ts:99
includeMetadata?booleanInclude metadatasrc/types/history.types.ts:101
filename?stringFilename (without extension)src/types/history.types.ts:103

HistoryStatistics

Defined in: src/types/history.types.ts:109

History statistics

Properties

PropertyTypeDescriptionDefined in
totalCallsnumberTotal callssrc/types/history.types.ts:111
incomingCallsnumberTotal incoming callssrc/types/history.types.ts:113
outgoingCallsnumberTotal outgoing callssrc/types/history.types.ts:115
answeredCallsnumberTotal answered callssrc/types/history.types.ts:117
missedCallsnumberTotal missed callssrc/types/history.types.ts:119
totalDurationnumberTotal call duration (seconds)src/types/history.types.ts:121
averageDurationnumberAverage call duration (seconds)src/types/history.types.ts:123
videoCallsnumberTotal video callssrc/types/history.types.ts:125
frequentContactsobject[]Most frequent contactssrc/types/history.types.ts:127

HistorySearchResult

Defined in: src/types/history.types.ts:137

History search result

Properties

PropertyTypeDescriptionDefined in
entriesreadonly CallHistoryEntry[]Matched entriessrc/types/history.types.ts:139
totalCountnumberTotal count (before pagination)src/types/history.types.ts:141
hasMorebooleanHas more resultssrc/types/history.types.ts:143

LocalRecordingOptions

Defined in: src/types/local-recording.types.ts:6

Options for useLocalRecording composable

Properties

PropertyTypeDescriptionDefined in
mimeType?stringMIME type for recording (default: 'audio/webm')src/types/local-recording.types.ts:8
audioBitsPerSecond?numberAudio bits per secondsrc/types/local-recording.types.ts:10
videoBitsPerSecond?numberVideo bits per second (if recording video)src/types/local-recording.types.ts:12
timeslice?numberTime slice in ms for ondataavailable events (default: 1000)src/types/local-recording.types.ts:14
persist?booleanEnable IndexedDB persistence (default: false)src/types/local-recording.types.ts:16
dbName?stringIndexedDB database name (default: 'vuesip-recordings')src/types/local-recording.types.ts:18
storeName?stringIndexedDB store name (default: 'recordings')src/types/local-recording.types.ts:20
autoDownload?booleanAuto-download on stop (default: false)src/types/local-recording.types.ts:22
filenamePrefix?stringFilename 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

PropertyTypeDescriptionDefined in
idstringUnique recording IDsrc/types/local-recording.types.ts:32
blobBlobRecording blobsrc/types/local-recording.types.ts:34
mimeTypestringMIME typesrc/types/local-recording.types.ts:36
startedAtnumberRecording start timestampsrc/types/local-recording.types.ts:38
stoppedAtnumberRecording end timestampsrc/types/local-recording.types.ts:40
durationnumberDuration in millisecondssrc/types/local-recording.types.ts:42
url?stringObject URL for playback (created on demand)src/types/local-recording.types.ts:44
metadata?Record<string, unknown>Optional metadatasrc/types/local-recording.types.ts:46

UseLocalRecordingReturn

Defined in: src/types/local-recording.types.ts:52

Return type for useLocalRecording composable

Properties

PropertyTypeDescriptionDefined in
stateRef<RecordingState, RecordingState>Current recording statesrc/types/local-recording.types.ts:54
isRecordingComputedRef<boolean>Whether recording is activesrc/types/local-recording.types.ts:56
isPausedComputedRef<boolean>Whether recording is pausedsrc/types/local-recording.types.ts:58
durationRef<number, number>Current recording duration in mssrc/types/local-recording.types.ts:60
recordingDataRef<LocalRecordingData | null, LocalRecordingData | null>Recorded data after stopsrc/types/local-recording.types.ts:62
errorRef<Error | null, Error | null>Error if anysrc/types/local-recording.types.ts:64
start(stream, metadata?) => voidStart recording with given streamsrc/types/local-recording.types.ts:66
pause() => voidPause recordingsrc/types/local-recording.types.ts:68
resume() => voidResume recordingsrc/types/local-recording.types.ts:70
stop() => Promise<LocalRecordingData | null>Stop recordingsrc/types/local-recording.types.ts:72
download(filename?) => voidDownload recordingsrc/types/local-recording.types.ts:74
clear() => voidClear current recording datasrc/types/local-recording.types.ts:76
isSupported(mimeType?) => booleanCheck if MIME type is supportedsrc/types/local-recording.types.ts:78

MediaDevice

Defined in: src/types/media.types.ts:20

Media device information

Properties

PropertyTypeDescriptionDefined in
deviceIdstringDevice IDsrc/types/media.types.ts:22
kindMediaDeviceKindDevice kindsrc/types/media.types.ts:24
labelstringDevice labelsrc/types/media.types.ts:26
groupIdstringGroup IDsrc/types/media.types.ts:28
isDefault?booleanIs default devicesrc/types/media.types.ts:30

MediaPermissions

Defined in: src/types/media.types.ts:55

Media permissions

Properties

PropertyTypeDescriptionDefined in
audioPermissionStatusAudio permission statussrc/types/media.types.ts:57
videoPermissionStatusVideo permission statussrc/types/media.types.ts:59

AudioStatistics

Defined in: src/types/media.types.ts:65

Audio statistics

Properties

PropertyTypeDescriptionDefined in
inputLevel?numberAudio input level (0-1)src/types/media.types.ts:67
outputLevel?numberAudio output level (0-1)src/types/media.types.ts:69
bytesSent?numberBytes sentsrc/types/media.types.ts:71
bytesReceived?numberBytes receivedsrc/types/media.types.ts:73
packetsSent?numberPackets sentsrc/types/media.types.ts:75
packetsReceived?numberPackets receivedsrc/types/media.types.ts:77
packetsLost?numberPackets lostsrc/types/media.types.ts:79
packetLossPercentage?numberPacket loss percentagesrc/types/media.types.ts:81
jitter?numberJitter (seconds)src/types/media.types.ts:83
roundTripTime?numberRound trip time (seconds)src/types/media.types.ts:85
codec?stringAudio codecsrc/types/media.types.ts:87
bitrate?numberBitrate (bits per second)src/types/media.types.ts:89
sampleRate?numberSample ratesrc/types/media.types.ts:91
channels?numberChannelssrc/types/media.types.ts:93

VideoStatistics

Defined in: src/types/media.types.ts:99

Video statistics

Properties

PropertyTypeDescriptionDefined in
bytesSent?numberBytes sentsrc/types/media.types.ts:101
bytesReceived?numberBytes receivedsrc/types/media.types.ts:103
packetsSent?numberPackets sentsrc/types/media.types.ts:105
packetsReceived?numberPackets receivedsrc/types/media.types.ts:107
packetsLost?numberPackets lostsrc/types/media.types.ts:109
packetLossPercentage?numberPacket loss percentagesrc/types/media.types.ts:111
frameRate?numberFrame ratesrc/types/media.types.ts:113
frameWidth?numberFrame widthsrc/types/media.types.ts:115
frameHeight?numberFrame heightsrc/types/media.types.ts:117
framesSent?numberFrames sentsrc/types/media.types.ts:119
framesReceived?numberFrames receivedsrc/types/media.types.ts:121
framesDropped?numberFrames droppedsrc/types/media.types.ts:123
codec?stringVideo codecsrc/types/media.types.ts:125
bitrate?numberBitrate (bits per second)src/types/media.types.ts:127

NetworkStatistics

Defined in: src/types/media.types.ts:133

Network statistics

Properties

PropertyTypeDescriptionDefined in
currentRoundTripTime?numberCurrent round trip timesrc/types/media.types.ts:135
availableOutgoingBitrate?numberAvailable outgoing bitratesrc/types/media.types.ts:137
availableIncomingBitrate?numberAvailable incoming bitratesrc/types/media.types.ts:139
totalBytesSent?numberTotal bytes sentsrc/types/media.types.ts:141
totalBytesReceived?numberTotal bytes receivedsrc/types/media.types.ts:143
transportType?stringTransport typesrc/types/media.types.ts:145
localCandidateType?stringLocal candidate typesrc/types/media.types.ts:147
remoteCandidateType?stringRemote candidate typesrc/types/media.types.ts:149

MediaStatistics

Defined in: src/types/media.types.ts:155

Combined media statistics

Properties

PropertyTypeDescriptionDefined in
audio?AudioStatisticsAudio statisticssrc/types/media.types.ts:157
video?VideoStatisticsVideo statisticssrc/types/media.types.ts:159
network?NetworkStatisticsNetwork statisticssrc/types/media.types.ts:161
timestampDateTimestampsrc/types/media.types.ts:163

RecordingOptions

Defined in: src/types/media.types.ts:185

Recording options

Properties

PropertyTypeDescriptionDefined in
mimeType?stringMIME type (e.g., 'audio/webm', 'video/webm')src/types/media.types.ts:187
audioBitsPerSecond?numberAudio bits per secondsrc/types/media.types.ts:189
videoBitsPerSecond?numberVideo bits per secondsrc/types/media.types.ts:191
timeslice?numberTime slice in millisecondssrc/types/media.types.ts:193
audio?booleanInclude audiosrc/types/media.types.ts:195
video?booleanInclude videosrc/types/media.types.ts:197

RecordingData

Defined in: src/types/media.types.ts:203

Recording data

Properties

PropertyTypeDescriptionDefined in
idstringRecording IDsrc/types/media.types.ts:205
callId?stringCall ID associated with this recordingsrc/types/media.types.ts:207
state?RecordingStateCurrent recording statesrc/types/media.types.ts:209
blob?BlobBlob datasrc/types/media.types.ts:211
mimeTypestringMIME typesrc/types/media.types.ts:213
duration?numberDuration in millisecondssrc/types/media.types.ts:215
size?numberSize in bytessrc/types/media.types.ts:217
startTimeDateStart timesrc/types/media.types.ts:219
endTime?DateEnd timesrc/types/media.types.ts:221

MediaStreamEvent

Defined in: src/types/media.types.ts:227

Media stream event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"active" | "inactive" | "addtrack" | "removetrack"Event typeBaseEvent.type-src/types/media.types.ts:229
streamMediaStreamMedia stream--src/types/media.types.ts:231
track?MediaStreamTrackTrack (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

PropertyTypeDescriptionOverridesInherited fromDefined in
payload?unknownEvent payload-BaseEvent.payloadsrc/types/events.types.ts:70
timestampDateTimestamp when the event occurred-BaseEvent.timestampsrc/types/events.types.ts:72
metadata?Record<string, unknown>Event metadata-BaseEvent.metadatasrc/types/events.types.ts:74
type"ended" | "mute" | "unmute" | "added" | "removed"Event typeBaseEvent.type-src/types/media.types.ts:243
trackMediaStreamTrackTrack--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

PropertyTypeDescriptionDefined in
type"devicechange"Event typesrc/types/media.types.ts:257
addedDevicesMediaDevice[]Added devicessrc/types/media.types.ts:259
removedDevicesMediaDevice[]Removed devicessrc/types/media.types.ts:261
currentDevicesMediaDevice[]Current devicessrc/types/media.types.ts:263
timestampDateTimestampsrc/types/media.types.ts:265

MediaError

Defined in: src/types/media.types.ts:271

Media error

Properties

PropertyTypeDescriptionDefined in
namestringError namesrc/types/media.types.ts:273
messagestringError messagesrc/types/media.types.ts:275
constraint?stringConstraint 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

PropertyTypeDescriptionDefined in
audioDeviceId?stringAudio device IDsrc/types/media.types.ts:285
videoDeviceId?stringVideo device IDsrc/types/media.types.ts:287
echoCancellation?booleanEcho cancellationsrc/types/media.types.ts:289
noiseSuppression?booleanNoise suppressionsrc/types/media.types.ts:291
autoGainControl?booleanAuto gain controlsrc/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

typescript
const audioSender = peerConnection.getSenders()
  .find(sender => sender.track?.kind === 'audio') as RTCRtpSenderWithDTMF

if (audioSender?.dtmf) {
  audioSender.dtmf.insertDTMF('123', 100, 70)
}

Properties

PropertyModifierTypeDescriptionDefined in
toneBufferreadonlystringTone buffer containing queued DTMF tonessrc/types/media.types.ts:325
ontonechange?public(event) => void | nullEvent handler called when a tone starts playingsrc/types/media.types.ts:328

Methods

insertDTMF()
ts
insertDTMF(
   tones, 
   duration?, 
   interToneGap?): void;

Defined in: src/types/media.types.ts:322

Insert DTMF tones into the audio stream

Parameters
ParameterTypeDescription
tonesstringString of DTMF tones to send (0-9, A-D, *, #)
duration?numberDuration of each tone in milliseconds (default: 100)
interToneGap?numberGap 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

typescript
const audioSender = senders.find(s => s.track?.kind === 'audio') as RTCRtpSenderWithDTMF
if (audioSender && 'dtmf' in audioSender && audioSender.dtmf) {
  // DTMF is supported
}

Extends

  • RTCRtpSender

Properties

PropertyModifierTypeDescriptionOverridesDefined in
dtmfreadonlyRTCDTMFSender | nullDTMF sender for this RTP sender (null if not supported)RTCRtpSender.dtmfsrc/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

PropertyTypeDescriptionDefined in
peerConnection?RTCPeerConnectionThe peer connection used by this sessionsrc/types/media.types.ts:362

Message

Defined in: src/types/messaging.types.ts:51

Message interface

Properties

PropertyTypeDescriptionDefined in
idstringMessage IDsrc/types/messaging.types.ts:53
directionMessageDirectionMessage directionsrc/types/messaging.types.ts:55
fromstringSender URIsrc/types/messaging.types.ts:57
tostringRecipient URIsrc/types/messaging.types.ts:59
contentstringMessage contentsrc/types/messaging.types.ts:61
contentTypeMessageContentTypeContent typesrc/types/messaging.types.ts:63
statusMessageStatusMessage statussrc/types/messaging.types.ts:65
timestampDateTimestamp when message was createdsrc/types/messaging.types.ts:67
sentAt?DateTimestamp when message was sentsrc/types/messaging.types.ts:69
deliveredAt?DateTimestamp when message was deliveredsrc/types/messaging.types.ts:71
readAt?DateTimestamp when message was readsrc/types/messaging.types.ts:73
isReadbooleanIs message readsrc/types/messaging.types.ts:75
metadata?Record<string, unknown>Custom metadatasrc/types/messaging.types.ts:77

MessageSendOptions

Defined in: src/types/messaging.types.ts:83

Message send options

Properties

PropertyTypeDescriptionDefined in
contentType?MessageContentTypeContent typesrc/types/messaging.types.ts:85
extraHeaders?string[]Custom SIP headerssrc/types/messaging.types.ts:87
requestDeliveryNotification?booleanRequest delivery notificationsrc/types/messaging.types.ts:89
requestReadNotification?booleanRequest read notificationsrc/types/messaging.types.ts:91

MessagingEvent

Defined in: src/types/messaging.types.ts:97

Messaging event

Properties

PropertyTypeDescriptionDefined in
type"failed" | "sent" | "delivered" | "read" | "received"Event typesrc/types/messaging.types.ts:99
messageMessageMessagesrc/types/messaging.types.ts:101
timestampDateTimestampsrc/types/messaging.types.ts:103
error?stringError message (if failed)src/types/messaging.types.ts:105

ComposingIndicator

Defined in: src/types/messaging.types.ts:111

Composing indicator

Properties

PropertyTypeDescriptionDefined in
uristringUser URIsrc/types/messaging.types.ts:113
isComposingbooleanIs composingsrc/types/messaging.types.ts:115
lastUpdatedDateLast updatedsrc/types/messaging.types.ts:117
idleTimeout?numberIdle timeoutsrc/types/messaging.types.ts:119

MessageFilter

Defined in: src/types/messaging.types.ts:125

Message filter options

Properties

PropertyTypeDescriptionDefined in
uri?stringFilter by URIsrc/types/messaging.types.ts:127
direction?MessageDirectionFilter by directionsrc/types/messaging.types.ts:129
status?MessageStatusFilter by statussrc/types/messaging.types.ts:131
dateFrom?DateFilter by date rangesrc/types/messaging.types.ts:133
dateTo?DateFilter by date rangesrc/types/messaging.types.ts:135
contentType?MessageContentTypeFilter by content typesrc/types/messaging.types.ts:137
searchQuery?stringSearch querysrc/types/messaging.types.ts:139

OAuth2TokenResponse

Defined in: src/types/oauth.types.ts:34

OAuth2 token response from provider

Properties

PropertyTypeDescriptionDefined in
access_tokenstringAccess token for API callssrc/types/oauth.types.ts:36
token_typestringToken type (usually 'Bearer')src/types/oauth.types.ts:38
expires_innumberToken expiration time in secondssrc/types/oauth.types.ts:40
refresh_token?stringRefresh token for obtaining new access tokenssrc/types/oauth.types.ts:42
scope?stringGranted scopessrc/types/oauth.types.ts:44
id_token?stringID token (OpenID Connect)src/types/oauth.types.ts:46

OAuth2UserInfo

Defined in: src/types/oauth.types.ts:52

OAuth2 user info from provider

Indexable

ts
[key: string]: unknown

Additional custom claims

Properties

PropertyTypeDescriptionDefined in
substringUnique user identifier from providersrc/types/oauth.types.ts:54
email?stringUser's email addresssrc/types/oauth.types.ts:56
email_verified?booleanWhether email is verifiedsrc/types/oauth.types.ts:58
name?stringUser's display namesrc/types/oauth.types.ts:60
given_name?stringUser's given (first) namesrc/types/oauth.types.ts:62
family_name?stringUser's family (last) namesrc/types/oauth.types.ts:64
preferred_username?stringUser's preferred usernamesrc/types/oauth.types.ts:66
picture?stringURL to user's profile picturesrc/types/oauth.types.ts:68
locale?stringUser's localesrc/types/oauth.types.ts:70
exp?numberToken expiration timestampsrc/types/oauth.types.ts:72
iat?numberToken issued at timestampsrc/types/oauth.types.ts:74
iss?stringToken issuersrc/types/oauth.types.ts:76
aud?string | string[]Token audiencesrc/types/oauth.types.ts:78

PKCEParams

Defined in: src/types/oauth.types.ts:86

PKCE (Proof Key for Code Exchange) parameters

Properties

PropertyTypeDescriptionDefined in
codeVerifierstringCode verifier (random string)src/types/oauth.types.ts:88
codeChallengestringCode 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

PropertyTypeDescriptionDefined in
typeOAuth2ProviderTypeProvider type identifiersrc/types/oauth.types.ts:100
clientIdstringOAuth2 client IDsrc/types/oauth.types.ts:102
clientSecret?stringOAuth2 client secret (for confidential clients - NOT for SPAs)src/types/oauth.types.ts:104
authorizationEndpointstringAuthorization endpoint URLsrc/types/oauth.types.ts:106
tokenEndpointstringToken endpoint URLsrc/types/oauth.types.ts:108
userInfoEndpoint?stringUser info endpoint URLsrc/types/oauth.types.ts:110
revocationEndpoint?stringToken revocation endpoint URLsrc/types/oauth.types.ts:112
jwksEndpoint?stringJWKS (JSON Web Key Set) endpoint URLsrc/types/oauth.types.ts:114
issuer?stringIssuer URL for token validationsrc/types/oauth.types.ts:116
redirectUristringRedirect URI after authenticationsrc/types/oauth.types.ts:118
scopesstring[]Requested OAuth2 scopessrc/types/oauth.types.ts:120
grantTypeOAuth2GrantTypeOAuth2 grant type to usesrc/types/oauth.types.ts:122
usePKCE?booleanUse PKCE for authorization code flow (recommended for SPAs)src/types/oauth.types.ts:124
additionalParams?Record<string, string>Additional authorization parameterssrc/types/oauth.types.ts:126
responseType?stringResponse 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

PropertyTypeDescriptionDefined in
usernameFieldkeyof OAuth2UserInfoField to use for SIP username (from OAuth2 user info)src/types/oauth.types.ts:210
displayNameField?keyof OAuth2UserInfoField to use for SIP display namesrc/types/oauth.types.ts:212
sipDomainstringSIP domain to usesrc/types/oauth.types.ts:214
sipRealm?stringSIP realm for authenticationsrc/types/oauth.types.ts:216
wsServerUristringWebSocket server URIsrc/types/oauth.types.ts:218
passwordStrategySipPasswordStrategyStrategy for generating SIP passwordsrc/types/oauth.types.ts:220
usernameTransformer?(userInfo) => stringCustom username transformersrc/types/oauth.types.ts:222
displayNameTransformer?(userInfo) => stringCustom display name transformersrc/types/oauth.types.ts:224

ProvisionedSipCredentials

Defined in: src/types/oauth.types.ts:244

Auto-provisioned SIP user credentials

Properties

PropertyTypeDescriptionDefined in
sipUristringSIP URI (e.g., sip:user@domain.com)src/types/oauth.types.ts:246
usernamestringSIP usernamesrc/types/oauth.types.ts:248
passwordstringSIP password or tokensrc/types/oauth.types.ts:250
displayNamestringDisplay name for callssrc/types/oauth.types.ts:252
wsServerUristringWebSocket server URIsrc/types/oauth.types.ts:254
realm?stringSIP realmsrc/types/oauth.types.ts:256
authorizationUsername?stringAuthorization username if differentsrc/types/oauth.types.ts:258
expiresAt?DateWhen credentials expire (based on token expiry)src/types/oauth.types.ts:260
oauthUserInfoOAuth2UserInfoOriginal OAuth2 user infosrc/types/oauth.types.ts:262
tokensOAuth2TokenResponseOAuth2 tokens for refreshsrc/types/oauth.types.ts:264

OAuth2Error

Defined in: src/types/oauth.types.ts:283

OAuth2 error types

Properties

PropertyTypeDescriptionDefined in
errorstringError code from providersrc/types/oauth.types.ts:285
error_description?stringHuman-readable error descriptionsrc/types/oauth.types.ts:287
error_uri?stringURI with more error informationsrc/types/oauth.types.ts:289
state?stringOAuth2 state parametersrc/types/oauth.types.ts:291

OAuth2ServiceConfig

Defined in: src/types/oauth.types.ts:297

OAuth2 service configuration

Extended by

Properties

PropertyTypeDescriptionDefined in
providerOAuth2ProviderConfigOAuth2 provider configurationsrc/types/oauth.types.ts:299
credentialMappingSipCredentialMappingSIP credential mapping configurationsrc/types/oauth.types.ts:301
autoRefresh?booleanAuto-refresh tokens before expirysrc/types/oauth.types.ts:303
refreshThreshold?numberRefresh tokens this many seconds before expirysrc/types/oauth.types.ts:305
storageKeyPrefix?stringStorage key prefix for persisting tokenssrc/types/oauth.types.ts:307
storageType?"localStorage" | "sessionStorage" | "memory"Storage type to usesrc/types/oauth.types.ts:309
debug?booleanEnable debug loggingsrc/types/oauth.types.ts:311
callbackPath?stringCallback URL path (for handling redirects)src/types/oauth.types.ts:313
postLoginRedirect?stringPost-login redirect URLsrc/types/oauth.types.ts:315
postLogoutRedirect?stringPost-logout redirect URLsrc/types/oauth.types.ts:317

UseOAuth2Return

Defined in: src/types/oauth.types.ts:323

OAuth2 service return type (for composable)

Extended by

Properties

PropertyTypeDescriptionDefined in
authStateRef<OAuth2AuthState, OAuth2AuthState>Current authentication statesrc/types/oauth.types.ts:325
isAuthenticatedComputedRef<boolean>Whether user is authenticatedsrc/types/oauth.types.ts:327
errorRef<OAuth2Error | null, OAuth2Error | null>Current error (null if none)src/types/oauth.types.ts:329
userInfoRef<OAuth2UserInfo | null, OAuth2UserInfo | null>Current OAuth2 user infosrc/types/oauth.types.ts:331
sipCredentialsRef<ProvisionedSipCredentials | null, ProvisionedSipCredentials | null>Provisioned SIP credentialssrc/types/oauth.types.ts:333
tokensRef<OAuth2TokenResponse | null, OAuth2TokenResponse | null>Current OAuth2 tokenssrc/types/oauth.types.ts:335
tokenExpiresAtRef<Date | null, Date | null>Token expiration timestampsrc/types/oauth.types.ts:337
isRefreshingRef<boolean, boolean>Whether token refresh is in progresssrc/types/oauth.types.ts:339
login(options?) => Promise<void>Initiate OAuth2 login flowsrc/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 tokenssrc/types/oauth.types.ts:347
refreshTokens() => Promise<OAuth2TokenResponse>Manually refresh tokenssrc/types/oauth.types.ts:349
getAccessToken() => Promise<string>Get current access token (auto-refresh if needed)src/types/oauth.types.ts:351
isTokenExpired() => booleanCheck if tokens are expiredsrc/types/oauth.types.ts:353
clearAuth() => voidClear stored auth datasrc/types/oauth.types.ts:355

OAuth2ProviderService

Defined in: src/types/oauth.types.ts:361

OAuth2 provider service interface

Properties

PropertyModifierTypeDescriptionDefined in
typereadonlyOAuth2ProviderTypeProvider typesrc/types/oauth.types.ts:363
configreadonlyOAuth2ProviderConfigProvider configurationsrc/types/oauth.types.ts:365

Methods

getAuthorizationUrl()
ts
getAuthorizationUrl(state, pkce?): string;

Defined in: src/types/oauth.types.ts:368

Generate authorization URL

Parameters
ParameterType
statestring
pkce?PKCEParams
Returns

string

exchangeCode()
ts
exchangeCode(code, pkce?): Promise<OAuth2TokenResponse>;

Defined in: src/types/oauth.types.ts:370

Exchange authorization code for tokens

Parameters
ParameterType
codestring
pkce?PKCEParams
Returns

Promise<OAuth2TokenResponse>

refreshToken()
ts
refreshToken(refreshToken): Promise<OAuth2TokenResponse>;

Defined in: src/types/oauth.types.ts:372

Refresh access token

Parameters
ParameterType
refreshTokenstring
Returns

Promise<OAuth2TokenResponse>

fetchUserInfo()
ts
fetchUserInfo(accessToken): Promise<OAuth2UserInfo>;

Defined in: src/types/oauth.types.ts:374

Fetch user info from provider

Parameters
ParameterType
accessTokenstring
Returns

Promise<OAuth2UserInfo>

revokeToken()
ts
revokeToken(token, tokenType?): Promise<void>;

Defined in: src/types/oauth.types.ts:376

Revoke token

Parameters
ParameterType
tokenstring
tokenType?"access_token" | "refresh_token"
Returns

Promise<void>

validateIdToken()?
ts
optional validateIdToken(idToken): Promise<OAuth2UserInfo>;

Defined in: src/types/oauth.types.ts:378

Validate ID token (if applicable)

Parameters
ParameterType
idTokenstring
Returns

Promise<OAuth2UserInfo>


UserProvisioningService

Defined in: src/types/oauth.types.ts:384

User provisioning service interface

Methods

provisionUser()
ts
provisionUser(
   userInfo, 
   tokens, 
mapping): Promise<ProvisionedSipCredentials>;

Defined in: src/types/oauth.types.ts:386

Provision SIP credentials from OAuth2 user info

Parameters
ParameterType
userInfoOAuth2UserInfo
tokensOAuth2TokenResponse
mappingSipCredentialMapping
Returns

Promise<ProvisionedSipCredentials>

updateCredentials()
ts
updateCredentials(existing, newTokens): Promise<ProvisionedSipCredentials>;

Defined in: src/types/oauth.types.ts:393

Update provisioned credentials (e.g., on token refresh)

Parameters
ParameterType
existingProvisionedSipCredentials
newTokensOAuth2TokenResponse
Returns

Promise<ProvisionedSipCredentials>

deprovisionUser()
ts
deprovisionUser(credentials): Promise<void>;

Defined in: src/types/oauth.types.ts:399

Deprovision/cleanup user credentials

Parameters
ParameterType
credentialsProvisionedSipCredentials
Returns

Promise<void>


OAuth2TokenStorage

Defined in: src/types/oauth.types.ts:405

Token storage interface

Methods

store()
ts
store(key, data): Promise<void>;

Defined in: src/types/oauth.types.ts:407

Store tokens

Parameters
ParameterType
keystring
dataOAuth2StoredData
Returns

Promise<void>

retrieve()
ts
retrieve(key): Promise<OAuth2StoredData | null>;

Defined in: src/types/oauth.types.ts:409

Retrieve tokens

Parameters
ParameterType
keystring
Returns

Promise<OAuth2StoredData | null>

remove()
ts
remove(key): Promise<void>;

Defined in: src/types/oauth.types.ts:411

Remove tokens

Parameters
ParameterType
keystring
Returns

Promise<void>

clear()
ts
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

PropertyTypeDescriptionDefined in
tokensOAuth2TokenResponseOAuth2 tokenssrc/types/oauth.types.ts:421
userInfoOAuth2UserInfoUser infosrc/types/oauth.types.ts:423
sipCredentialsProvisionedSipCredentialsProvisioned SIP credentialssrc/types/oauth.types.ts:425
storedAtstringWhen data was storedsrc/types/oauth.types.ts:427
expiresAtstringWhen tokens expiresrc/types/oauth.types.ts:429
pkceVerifier?stringPKCE verifier (for pending auth flows)src/types/oauth.types.ts:431
state?stringOAuth2 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

PropertyTypeDescriptionDefined in
oauth:state_changedobjectEmitted when authentication state changessrc/types/oauth.types.ts:441
oauth:state_changed.stateOAuth2AuthState-src/types/oauth.types.ts:441
oauth:state_changed.previousStateOAuth2AuthState-src/types/oauth.types.ts:441
oauth:authenticatedobjectEmitted on successful authenticationsrc/types/oauth.types.ts:443
oauth:authenticated.userInfoOAuth2UserInfo-src/types/oauth.types.ts:443
oauth:authenticated.credentialsProvisionedSipCredentials-src/types/oauth.types.ts:443
oauth:errorobjectEmitted on authentication errorsrc/types/oauth.types.ts:445
oauth:error.errorOAuth2Error-src/types/oauth.types.ts:445
oauth:tokens_refreshedobjectEmitted when tokens are refreshedsrc/types/oauth.types.ts:447
oauth:tokens_refreshed.tokensOAuth2TokenResponse-src/types/oauth.types.ts:447
oauth:logoutvoidEmitted on logoutsrc/types/oauth.types.ts:449
oauth:credentials_provisionedobjectEmitted when SIP credentials are provisionedsrc/types/oauth.types.ts:451
oauth:credentials_provisioned.credentialsProvisionedSipCredentials-src/types/oauth.types.ts:451

ParticipantControlsOptions

Defined in: src/types/participant-controls.types.ts:12

Participant controls options

Properties

PropertyTypeDescriptionDefined in
isModerator?Ref<boolean, boolean>Whether the current user is a moderatorsrc/types/participant-controls.types.ts:14
isPinned?Ref<boolean, boolean>Whether this participant is currently pinnedsrc/types/participant-controls.types.ts:16
initialVolume?numberInitial volume level (0-1). Default: 1src/types/participant-controls.types.ts:18
onMute?(participant) => voidCallback when participant is mutedsrc/types/participant-controls.types.ts:20
onUnmute?(participant) => voidCallback when participant is unmutedsrc/types/participant-controls.types.ts:22
onKick?(participant) => voidCallback when participant is kickedsrc/types/participant-controls.types.ts:24
onPin?(participant) => voidCallback when participant is pinnedsrc/types/participant-controls.types.ts:26
onUnpin?(participant) => voidCallback when participant is unpinnedsrc/types/participant-controls.types.ts:28
onVolumeChange?(participant, volume) => voidCallback when volume changessrc/types/participant-controls.types.ts:30

UseParticipantControlsReturn

Defined in: src/types/participant-controls.types.ts:36

Return type for useParticipantControls composable

Properties

PropertyTypeDescriptionDefined in
canMuteComputedRef<boolean>Can mute/unmute this participantsrc/types/participant-controls.types.ts:38
canKickComputedRef<boolean>Can kick this participantsrc/types/participant-controls.types.ts:40
canPinComputedRef<boolean>Can pin this participantsrc/types/participant-controls.types.ts:42
volumeRef<number>Current volume levelsrc/types/participant-controls.types.ts:44
toggleMute() => voidToggle mute statesrc/types/participant-controls.types.ts:46
kickParticipant() => voidKick participant from conferencesrc/types/participant-controls.types.ts:48
togglePin() => voidToggle pin statesrc/types/participant-controls.types.ts:50
setVolume(level) => voidSet volume levelsrc/types/participant-controls.types.ts:52

HookOptions

Defined in: src/types/plugin.types.ts:101

Hook registration options

Properties

PropertyTypeDescriptionDefined in
priority?numberPriority of this hook handlersrc/types/plugin.types.ts:103
once?booleanIf true, removes handler after first executionsrc/types/plugin.types.ts:105
condition?(context, data?) => booleanOptional condition function to determine if hook should runsrc/types/plugin.types.ts:107

HookRegistration

Defined in: src/types/plugin.types.ts:114

Hook registration details

Type Parameters

Type ParameterDefault type
TDataany
TReturnany

Properties

PropertyTypeDescriptionDefined in
namestringThe hook namesrc/types/plugin.types.ts:116
handlerHookHandler<TData, TReturn>The handler functionsrc/types/plugin.types.ts:118
optionsRequired<HookOptions>Registration optionssrc/types/plugin.types.ts:120
pluginNamestringPlugin that registered this hook (for cleanup)src/types/plugin.types.ts:122
idstringUnique ID for this registrationsrc/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

PropertyTypeDescriptionDefined in
eventBusEventBusEvent bus for global event communicationsrc/types/plugin.types.ts:134
sipClientSipClient | nullSIP client instance (may be null before initialization)src/types/plugin.types.ts:137
mediaManagerMediaManager | nullMedia manager instancesrc/types/plugin.types.ts:140
configSipClientConfig | nullCurrent SIP configurationsrc/types/plugin.types.ts:143
activeCallsMap<string, CallSession>Active call sessionssrc/types/plugin.types.ts:146
hooksobjectHook system for registering lifecycle hookssrc/types/plugin.types.ts:149
hooks.register<TData, TReturn>(name, handler, options?) => stringRegister a hook handlersrc/types/plugin.types.ts:152
hooks.unregister(hookId) => booleanUnregister a hook handler by IDsrc/types/plugin.types.ts:158
hooks.execute<TData, TReturn>(name, data?) => Promise<TReturn[]>Execute all handlers for a hooksrc/types/plugin.types.ts:161
loggerobjectLogger instancesrc/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
versionstringApplication versionsrc/types/plugin.types.ts:173

PluginMetadata

Defined in: src/types/plugin.types.ts:179

Plugin metadata

Properties

PropertyTypeDescriptionDefined in
namestringPlugin name (must be unique)src/types/plugin.types.ts:181
versionstringPlugin versionsrc/types/plugin.types.ts:183
description?stringPlugin descriptionsrc/types/plugin.types.ts:185
author?stringPlugin authorsrc/types/plugin.types.ts:187
license?stringPlugin licensesrc/types/plugin.types.ts:189
minVersion?stringMinimum VueSip version requiredsrc/types/plugin.types.ts:191
maxVersion?stringMaximum VueSip version supportedsrc/types/plugin.types.ts:193
dependencies?string[]Dependencies on other pluginssrc/types/plugin.types.ts:195

PluginConfig

Defined in: src/types/plugin.types.ts:201

Plugin configuration options

Extended by

Indexable

ts
[key: string]: unknown

Plugin-specific configuration

Properties

PropertyTypeDescriptionDefined in
enabled?booleanEnable/disable the pluginsrc/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 ParameterDefault type
TConfig extends PluginConfigPluginConfig

Properties

PropertyTypeDescriptionDefined in
metadataPluginMetadataPlugin metadatasrc/types/plugin.types.ts:215
defaultConfig?TConfigDefault configurationsrc/types/plugin.types.ts:218

Methods

install()
ts
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
ParameterTypeDescription
contextPluginContextPlugin context
config?TConfigPlugin configuration
Returns

void | Promise<void>

Promise that resolves when installation is complete

uninstall()?
ts
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
ParameterTypeDescription
contextPluginContextPlugin context
Returns

void | Promise<void>

Promise that resolves when cleanup is complete

updateConfig()?
ts
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
ParameterTypeDescription
contextPluginContextPlugin context
configTConfigNew 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 ParameterDefault type
TConfig extends PluginConfigPluginConfig

Properties

PropertyTypeDescriptionDefined in
pluginPlugin<TConfig>The plugin instancesrc/types/plugin.types.ts:276
configTConfigPlugin configurationsrc/types/plugin.types.ts:278
statePluginStateCurrent statesrc/types/plugin.types.ts:280
installedAt?DateInstallation timestampsrc/types/plugin.types.ts:282
error?ErrorError if installation failedsrc/types/plugin.types.ts:284
hookIdsstring[]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

PropertyTypeDescriptionDefined in
typestringEvent typesrc/types/plugin.types.ts:326
timestampDateEvent timestampsrc/types/plugin.types.ts:328
data?Record<string, unknown>Event datasrc/types/plugin.types.ts:330
sessionId?stringUser session IDsrc/types/plugin.types.ts:332
userId?stringUser IDsrc/types/plugin.types.ts:334

AnalyticsPluginConfig

Defined in: src/types/plugin.types.ts:340

Analytics plugin configuration

Extends

Indexable

ts
[key: string]: unknown

Plugin-specific configuration

Properties

PropertyTypeDescriptionInherited fromDefined in
enabled?booleanEnable/disable the pluginPluginConfig.enabledsrc/types/plugin.types.ts:203
endpoint?stringAnalytics endpoint URL-src/types/plugin.types.ts:342
batchEvents?booleanBatch events before sending-src/types/plugin.types.ts:344
batchSize?numberBatch size-src/types/plugin.types.ts:346
sendInterval?numberSend interval (ms)-src/types/plugin.types.ts:348
includeUserInfo?booleanInclude user information-src/types/plugin.types.ts:350
transformEvent?(event) => AnalyticsEventCustom 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?numberMaximum events in queue before dropping (prevents memory overflow)-src/types/plugin.types.ts:358
requestTimeout?numberRequest timeout in milliseconds (prevents hanging requests)-src/types/plugin.types.ts:360
maxPayloadSize?numberMaximum event payload size in bytes (prevents large payloads)-src/types/plugin.types.ts:362
validateEventData?booleanValidate 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

ts
[key: string]: unknown

Plugin-specific configuration

Properties

PropertyTypeDescriptionInherited fromDefined in
enabled?booleanEnable/disable the pluginPluginConfig.enabledsrc/types/plugin.types.ts:203
autoStart?booleanAuto-start recording on call start-src/types/plugin.types.ts:372
recordingOptions?RecordingOptionsRecording options-src/types/plugin.types.ts:374
storeInIndexedDB?booleanStore recordings in IndexedDB-src/types/plugin.types.ts:376
dbName?stringIndexedDB database name-src/types/plugin.types.ts:378
maxRecordings?numberMax recordings to keep-src/types/plugin.types.ts:380
autoDeleteOld?booleanAuto-delete old recordings-src/types/plugin.types.ts:382
onRecordingStart?(data) => voidCallback when recording starts-src/types/plugin.types.ts:384
onRecordingStop?(data) => voidCallback when recording stops-src/types/plugin.types.ts:386
onRecordingError?(error) => voidCallback 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

PropertyTypeDescriptionDefined in
colorstringCSS color class or valuesrc/types/presence.types.ts:33
iconstringIcon name or classsrc/types/presence.types.ts:35
labelstringHuman-readable labelsrc/types/presence.types.ts:37
isActivebooleanWhether the state indicates active callsrc/types/presence.types.ts:39

DialogStatus

Defined in: src/types/presence.types.ts:99

Dialog status for a specific extension

Properties

PropertyTypeDescriptionDefined in
uri?stringExtension URIsrc/types/presence.types.ts:101
stateDialogStateCurrent dialog statesrc/types/presence.types.ts:103
direction?"initiator" | "recipient"Call direction (initiator or recipient)src/types/presence.types.ts:105
remoteTag?stringRemote party tagsrc/types/presence.types.ts:107
remoteIdentity?stringRemote party identity (SIP URI)src/types/presence.types.ts:109
remoteDisplayName?stringRemote party display namesrc/types/presence.types.ts:111
callId?stringCall ID if in a callsrc/types/presence.types.ts:113
dialogId?stringDialog ID from dialog-infosrc/types/presence.types.ts:115
rawState?stringRaw state string from XMLsrc/types/presence.types.ts:117
lastUpdated?DateLast updated timestampsrc/types/presence.types.ts:119

DialogSubscription

Defined in: src/types/presence.types.ts:125

Dialog subscription info

Properties

PropertyTypeDescriptionDefined in
idstringSubscription IDsrc/types/presence.types.ts:127
targetUristringTarget extension URIsrc/types/presence.types.ts:129
state"active" | "terminated" | "pending"Subscription statesrc/types/presence.types.ts:131
expires?numberExpiry time in secondssrc/types/presence.types.ts:133
expiresAt?DateExpiry timestampsrc/types/presence.types.ts:135
lastEvent?DialogEventLast event receivedsrc/types/presence.types.ts:137
lastStatus?DialogStatusLast received statussrc/types/presence.types.ts:139

DialogEvent

Defined in: src/types/presence.types.ts:145

Dialog event from subscription

Properties

PropertyTypeDescriptionDefined in
type| "error" | "state-changed" | "subscribed" | "unsubscribed" | "updated" | "refreshed"Event typesrc/types/presence.types.ts:147
uristringExtension URIsrc/types/presence.types.ts:149
status?DialogStatusDialog statussrc/types/presence.types.ts:151
subscription?DialogSubscriptionSubscription infosrc/types/presence.types.ts:153
timestampDateTimestampsrc/types/presence.types.ts:155
error?stringError message if applicablesrc/types/presence.types.ts:157

DialogSubscriptionOptions

Defined in: src/types/presence.types.ts:163

Options for dialog subscription

Properties

PropertyTypeDescriptionDefined in
expires?numberSubscription expiry in secondssrc/types/presence.types.ts:165
extraHeaders?string[]Extra SIP headerssrc/types/presence.types.ts:167
onStateChange?(status) => voidCallback for state changessrc/types/presence.types.ts:169

PresenceDisplayConfig

Defined in: src/types/presence.types.ts:175

Presence display configuration

Properties

PropertyTypeDescriptionDefined in
mode?"emoji" | "icon" | "text"Display mode: 'emoji''icon'
animations?booleanEnable animationssrc/types/presence.types.ts:179
showIcon?booleanShow iconsrc/types/presence.types.ts:181
showLabel?booleanShow labelsrc/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 mappingsrc/types/presence.types.ts:187

PresenceStatus

Defined in: src/types/presence.types.ts:209

Presence status

Extended by

Properties

PropertyTypeDescriptionDefined in
uristringUser URIsrc/types/presence.types.ts:211
statePresenceStatePresence statesrc/types/presence.types.ts:213
statusMessage?stringCustom status messagesrc/types/presence.types.ts:215
lastUpdatedDateLast updated timestampsrc/types/presence.types.ts:217
metadata?Record<string, any>Additional metadatasrc/types/presence.types.ts:220

PresenceSubscription

Defined in: src/types/presence.types.ts:226

Presence subscription

Properties

PropertyTypeDescriptionDefined in
idstringSubscription IDsrc/types/presence.types.ts:228
targetUristringTarget URI being watchedsrc/types/presence.types.ts:230
state"active" | "terminated" | "pending"Subscription statesrc/types/presence.types.ts:232
expires?numberExpiry timesrc/types/presence.types.ts:234
lastStatus?PresenceStatusLast presence status receivedsrc/types/presence.types.ts:236

PresenceEvent

Defined in: src/types/presence.types.ts:242

Presence event

Properties

PropertyTypeDescriptionDefined in
type"error" | "subscribed" | "unsubscribed" | "updated"Event typesrc/types/presence.types.ts:244
uristringUser URIsrc/types/presence.types.ts:246
status?PresenceStatusPresence statussrc/types/presence.types.ts:248
subscription?PresenceSubscriptionSubscription informationsrc/types/presence.types.ts:250
timestampDateTimestampsrc/types/presence.types.ts:252
error?stringError message (if applicable)src/types/presence.types.ts:254

PresencePublishOptions

Defined in: src/types/presence.types.ts:260

Presence options for publishing status

Properties

PropertyTypeDescriptionDefined in
statePresenceState | "open" | "closed"Presence state - accepts enum values or raw PIDF basic status ('open''closed')
statusMessage?stringStatus messagesrc/types/presence.types.ts:264
expires?numberExpiry time in secondssrc/types/presence.types.ts:266
extraHeaders?string[]Custom headerssrc/types/presence.types.ts:268

PresenceSubscriptionOptions

Defined in: src/types/presence.types.ts:274

Presence subscription options

Properties

PropertyTypeDescriptionDefined in
expires?numberExpiry time in secondssrc/types/presence.types.ts:276
extraHeaders?string[]Custom headerssrc/types/presence.types.ts:278
onNotify?(status) => voidCallback for presence notificationssrc/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

PropertyModifierTypeDescriptionDefined in
sipConfigreadonlySipClientConfig | nullCurrent SIP configuration (readonly)src/types/provider.types.ts:21
mediaConfigreadonlyMediaConfigurationCurrent media configuration (readonly)src/types/provider.types.ts:24
userPreferencesreadonlyUserPreferencesCurrent user preferences (readonly)src/types/provider.types.ts:27
hasSipConfigreadonlybooleanWhether SIP configuration is setsrc/types/provider.types.ts:30
isConfigValidreadonlybooleanWhether configuration is validsrc/types/provider.types.ts:33
lastValidationreadonlyValidationResult | nullLast validation resultsrc/types/provider.types.ts:36

Methods

setSipConfig()
ts
setSipConfig(config, validate?): ValidationResult;

Defined in: src/types/provider.types.ts:44

Set SIP configuration

Parameters
ParameterTypeDescription
configSipClientConfigSIP client configuration
validate?booleanWhether to validate configuration (default: true)
Returns

ValidationResult

Validation result

updateSipConfig()
ts
updateSipConfig(updates, validate?): ValidationResult;

Defined in: src/types/provider.types.ts:52

Update SIP configuration (partial update)

Parameters
ParameterTypeDescription
updatesPartial<SipClientConfig>Partial SIP configuration updates
validate?booleanWhether to validate after update (default: true)
Returns

ValidationResult

Validation result

setMediaConfig()
ts
setMediaConfig(config, validate?): ValidationResult;

Defined in: src/types/provider.types.ts:60

Set media configuration

Parameters
ParameterTypeDescription
configMediaConfigurationMedia configuration
validate?booleanWhether to validate configuration (default: true)
Returns

ValidationResult

Validation result

updateMediaConfig()
ts
updateMediaConfig(updates, validate?): ValidationResult;

Defined in: src/types/provider.types.ts:68

Update media configuration (partial update)

Parameters
ParameterTypeDescription
updatesPartial<MediaConfiguration>Partial media configuration updates
validate?booleanWhether to validate after update (default: true)
Returns

ValidationResult

Validation result

setUserPreferences()
ts
setUserPreferences(preferences): void;

Defined in: src/types/provider.types.ts:74

Set user preferences

Parameters
ParameterTypeDescription
preferencesUserPreferencesUser preferences
Returns

void

updateUserPreferences()
ts
updateUserPreferences(updates): void;

Defined in: src/types/provider.types.ts:80

Update user preferences (partial update)

Parameters
ParameterTypeDescription
updatesPartial<UserPreferences>Partial user preferences updates
Returns

void

validateAll()
ts
validateAll(): ValidationResult;

Defined in: src/types/provider.types.ts:86

Validate all configurations

Returns

ValidationResult

Combined validation result

reset()
ts
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

PropertyTypeDescriptionDefined in
sipConfig?SipClientConfigInitial SIP configurationsrc/types/provider.types.ts:105
mediaConfig?MediaConfigurationInitial media configurationsrc/types/provider.types.ts:108
userPreferences?UserPreferencesInitial user preferencessrc/types/provider.types.ts:111
validateOnMount?booleanWhether to validate configuration on mount (default: true)src/types/provider.types.ts:114
autoMerge?booleanWhether 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

PropertyModifierTypeDescriptionDefined in
audioInputDevicesreadonlyreadonly MediaDevice[]Available audio input devicessrc/types/provider.types.ts:134
audioOutputDevicesreadonlyreadonly MediaDevice[]Available audio output devicessrc/types/provider.types.ts:137
videoInputDevicesreadonlyreadonly MediaDevice[]Available video input devicessrc/types/provider.types.ts:140
allDevicesreadonlyreadonly MediaDevice[]All available devicessrc/types/provider.types.ts:143
selectedAudioInputIdreadonlystring | nullSelected audio input device IDsrc/types/provider.types.ts:147
selectedAudioOutputIdreadonlystring | nullSelected audio output device IDsrc/types/provider.types.ts:150
selectedVideoInputIdreadonlystring | nullSelected video input device IDsrc/types/provider.types.ts:153
selectedAudioInputDevicereadonlyMediaDevice | undefinedSelected audio input devicesrc/types/provider.types.ts:156
selectedAudioOutputDevicereadonlyMediaDevice | undefinedSelected audio output devicesrc/types/provider.types.ts:159
selectedVideoInputDevicereadonlyMediaDevice | undefinedSelected video input devicesrc/types/provider.types.ts:162
audioPermissionreadonlyPermissionStatusAudio permission statussrc/types/provider.types.ts:166
videoPermissionreadonlyPermissionStatusVideo permission statussrc/types/provider.types.ts:169
hasAudioPermissionreadonlybooleanWhether audio permission is grantedsrc/types/provider.types.ts:172
hasVideoPermissionreadonlybooleanWhether video permission is grantedsrc/types/provider.types.ts:175
hasAudioInputDevicesreadonlybooleanWhether audio input devices are availablesrc/types/provider.types.ts:179
hasAudioOutputDevicesreadonlybooleanWhether audio output devices are availablesrc/types/provider.types.ts:182
hasVideoInputDevicesreadonlybooleanWhether video input devices are availablesrc/types/provider.types.ts:185
totalDevicesreadonlynumberTotal number of devicessrc/types/provider.types.ts:188
isEnumeratingreadonlybooleanWhether devices are being enumeratedsrc/types/provider.types.ts:192
lastErrorreadonlyError | nullLast error that occurredsrc/types/provider.types.ts:195

Methods

enumerateDevices()
ts
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()
ts
getDeviceById(deviceId): MediaDevice | undefined;

Defined in: src/types/provider.types.ts:209

Get device by ID

Parameters
ParameterTypeDescription
deviceIdstringDevice ID to find
Returns

MediaDevice | undefined

Device if found, undefined otherwise

selectAudioInput()
ts
selectAudioInput(deviceId): void;

Defined in: src/types/provider.types.ts:216

Select audio input device

Parameters
ParameterTypeDescription
deviceIdstringDevice ID to select
Returns

void

selectAudioOutput()
ts
selectAudioOutput(deviceId): void;

Defined in: src/types/provider.types.ts:222

Select audio output device

Parameters
ParameterTypeDescription
deviceIdstringDevice ID to select
Returns

void

selectVideoInput()
ts
selectVideoInput(deviceId): void;

Defined in: src/types/provider.types.ts:228

Select video input device

Parameters
ParameterTypeDescription
deviceIdstringDevice ID to select
Returns

void

requestAudioPermission()
ts
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()
ts
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()
ts
requestPermissions(audio?, video?): Promise<void>;

Defined in: src/types/provider.types.ts:248

Request permissions for audio and/or video

Parameters
ParameterTypeDescription
audio?booleanWhether to request audio permission (default: true)
video?booleanWhether to request video permission (default: false)
Returns

Promise<void>

testAudioInput()
ts
testAudioInput(deviceId?, options?): Promise<boolean>;

Defined in: src/types/provider.types.ts:257

Test audio input device

Parameters
ParameterTypeDescription
deviceId?stringOptional 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()
ts
testAudioOutput(deviceId?): Promise<boolean>;

Defined in: src/types/provider.types.ts:267

Test audio output device

Parameters
ParameterTypeDescription
deviceId?stringOptional 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

PropertyTypeDescriptionDefined in
mediaConfig?MediaConfigurationInitial media configurationsrc/types/provider.types.ts:281
autoEnumerate?booleanWhether to automatically enumerate devices on mount (default: true)src/types/provider.types.ts:284
autoRequestPermissions?booleanWhether to automatically request permissions on mount (default: false)src/types/provider.types.ts:287
requestAudio?booleanRequest audio permission on mount (only if autoRequestPermissions is true, default: true)src/types/provider.types.ts:290
requestVideo?booleanRequest video permission on mount (only if autoRequestPermissions is true, default: false)src/types/provider.types.ts:293
watchDeviceChanges?booleanWhether to automatically monitor device changes (default: true)src/types/provider.types.ts:296
autoSelectDefaults?booleanWhether 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

PropertyTypeDescriptionDefined in
recordingstringColor when recording (default: red)src/types/recording-indicator.types.ts:13
pausedstringColor when paused (default: yellow)src/types/recording-indicator.types.ts:15
inactivestringColor 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

PropertyTypeDescriptionDefined in
blinkInterval?numberBlink interval in milliseconds (default: 500ms)src/types/recording-indicator.types.ts:25
colors?Partial<RecordingIndicatorColors>Custom colors for different statessrc/types/recording-indicator.types.ts:27
initialState?RecordingIndicatorStateInitial 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

PropertyTypeDescriptionDefined in
stateRef<RecordingIndicatorState>Current recording indicator statesrc/types/recording-indicator.types.ts:37
isRecordingComputedRef<boolean>Whether currently recordingsrc/types/recording-indicator.types.ts:39
isPausedComputedRef<boolean>Whether currently pausedsrc/types/recording-indicator.types.ts:41
durationRef<number>Recording duration in millisecondssrc/types/recording-indicator.types.ts:43
formattedDurationComputedRef<string>Formatted duration string (MM:SS or HH:MM:SS)src/types/recording-indicator.types.ts:45
blinkStateRef<boolean>Blink animation statesrc/types/recording-indicator.types.ts:47
indicatorStyleComputedRef<CSSProperties>CSS styles for the indicatorsrc/types/recording-indicator.types.ts:49
setRecordingState(state) => voidSet the recording statesrc/types/recording-indicator.types.ts:51
reset() => voidReset to inactive state and clear durationsrc/types/recording-indicator.types.ts:53
unmount?() => voidCleanup function for manual unmountingsrc/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

PropertyTypeDescriptionDefined in
sessionIdstringUnique session identifiersrc/types/session-persistence.types.ts:20
remoteUristringRemote party URI (SIP address)src/types/session-persistence.types.ts:22
callDirection"inbound" | "outbound"Call directionsrc/types/session-persistence.types.ts:24
holdStatebooleanWhether the call is on holdsrc/types/session-persistence.types.ts:26
muteStateobjectMute state for audio and videosrc/types/session-persistence.types.ts:28
muteState.audiobooleanWhether audio is mutedsrc/types/session-persistence.types.ts:30
muteState.videobooleanWhether video is mutedsrc/types/session-persistence.types.ts:32
timestampnumberTime when session was saved (timestamp in milliseconds)src/types/session-persistence.types.ts:35
customData?Record<string, unknown>Custom metadata for application-specific datasrc/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

PropertyTypeDescriptionDefined in
storageKey?stringStorage key for IndexedDB (default: 'vuesip_session')src/types/session-persistence.types.ts:47
maxAge?numberMaximum age of saved session in milliseconds (default: 300000 = 5 minutes)src/types/session-persistence.types.ts:49
autoRestore?booleanAuto-restore session on initialization (default: false)src/types/session-persistence.types.ts:51
onRestoreSuccess?(state) => voidCallback when session restore succeedssrc/types/session-persistence.types.ts:53
onRestoreError?(error) => voidCallback when session restore failssrc/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

PropertyTypeDescriptionDefined in
existsbooleanWhether a saved session existssrc/types/session-persistence.types.ts:65
sessionId?stringSession identifier (if exists)src/types/session-persistence.types.ts:67
timestamp?numberTime when session was saved (if exists)src/types/session-persistence.types.ts:69
age?numberAge 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

PropertyTypeDescriptionDefined in
saveSession(state) => Promise<void>Save current session state to IndexedDBsrc/types/session-persistence.types.ts:84
loadSession() => Promise<PersistedSessionState | null>Load saved session state from IndexedDBsrc/types/session-persistence.types.ts:90
clearSession() => Promise<void>Clear saved session from IndexedDBsrc/types/session-persistence.types.ts:95
hasSavedSessionRef<boolean>Whether a saved session exists (reactive)src/types/session-persistence.types.ts:100
isLoadingRef<boolean>Whether an async operation is in progresssrc/types/session-persistence.types.ts:105
errorRef<Error | null>Error state from the last operationsrc/types/session-persistence.types.ts:110
savedSessionInfoComputedRef<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

PropertyTypeDescriptionDefined in
uristringThe 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
userstringUsername partsrc/types/sip.types.ts:15
hoststringHost/domain partsrc/types/sip.types.ts:17
port?numberPort number (optional)src/types/sip.types.ts:19
displayName?stringDisplay name (optional)src/types/sip.types.ts:21
parameters?Record<string, string>URI parameterssrc/types/sip.types.ts:23
headers?Record<string, string>URI headerssrc/types/sip.types.ts:25

Methods

toString()
ts
toString(): string;

Defined in: src/types/sip.types.ts:28

Convert to string representation

Returns

string

clone()
ts
clone(): SipUri;

Defined in: src/types/sip.types.ts:30

Clone the SIP URI

Returns

SipUri


AuthenticationChallenge

Defined in: src/types/sip.types.ts:158

Authentication challenge information

Properties

PropertyTypeDescriptionDefined in
realmstringAuthentication realmsrc/types/sip.types.ts:160
noncestringNonce valuesrc/types/sip.types.ts:162
qop?stringQuality of protectionsrc/types/sip.types.ts:164
opaque?stringOpaque valuesrc/types/sip.types.ts:166
algorithm?"MD5" | "SHA-256"Algorithm (default: MD5)src/types/sip.types.ts:168
stale?booleanStale flagsrc/types/sip.types.ts:170

AuthenticationCredentials

Defined in: src/types/sip.types.ts:176

Authentication credentials

Properties

PropertyTypeDescriptionDefined in
usernamestringUsernamesrc/types/sip.types.ts:178
password?stringPasswordsrc/types/sip.types.ts:180
ha1?stringHA1 hash (alternative to password)src/types/sip.types.ts:182
realm?stringRealmsrc/types/sip.types.ts:184

SipEvent

Defined in: src/types/sip.types.ts:190

SIP event base interface

Extended by

Properties

PropertyTypeDescriptionDefined in
typestringEvent typesrc/types/sip.types.ts:192
timestampDateTimestamp when the event occurredsrc/types/sip.types.ts:194
data?unknownAdditional event datasrc/types/sip.types.ts:196

RegistrationEvent

Defined in: src/types/sip.types.ts:202

SIP registration event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
timestampDateTimestamp when the event occurred-SipEvent.timestampsrc/types/sip.types.ts:194
data?unknownAdditional event data-SipEvent.datasrc/types/sip.types.ts:196
type"registration" | "unregistration" | "registrationFailed"Event typeSipEvent.type-src/types/sip.types.ts:203
stateRegistrationStateRegistration state--src/types/sip.types.ts:205
responseCode?SipResponseCodeResponse code--src/types/sip.types.ts:207
reasonPhrase?stringReason phrase--src/types/sip.types.ts:209
expires?numberExpiry time in seconds--src/types/sip.types.ts:211

ConnectionEvent

Defined in: src/types/sip.types.ts:217

SIP connection event

Extends

Properties

PropertyTypeDescriptionOverridesInherited fromDefined in
timestampDateTimestamp when the event occurred-SipEvent.timestampsrc/types/sip.types.ts:194
data?unknownAdditional event data-SipEvent.datasrc/types/sip.types.ts:196
type"disconnected" | "connected" | "connectionFailed"Event typeSipEvent.type-src/types/sip.types.ts:218
stateConnectionStateConnection state--src/types/sip.types.ts:220
error?stringError message if applicable--src/types/sip.types.ts:222
retryAttempt?numberRetry attempt number--src/types/sip.types.ts:224

SipMessageOptions

Defined in: src/types/sip.types.ts:230

SIP message options

Properties

PropertyTypeDescriptionDefined in
contentType?stringContent type (default: 'text/plain')src/types/sip.types.ts:232
extraHeaders?string[]Custom headerssrc/types/sip.types.ts:234
eventHandlers?objectEvent handlerssrc/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

typescript
const options: RegisterOptions = {
  expires: 3600,  // Register for 1 hour
  extraHeaders: ['X-Custom-Header: value'],
  instanceId: 'unique-device-id'
}
await sipClient.register(options)

Properties

PropertyTypeDescriptionDefined in
expires?numberRegistration expiry time in seconds Default is typically 600 seconds (10 minutes) Range: 60-3600 seconds recommendedsrc/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?stringInstance ID for multiple registrations Used to uniquely identify this client instance when multiple devices register with the same SIP URIsrc/types/sip.types.ts:284
refreshInterval?numberRegistration refresh interval in seconds How often to send re-REGISTER requests Should be less than expires valuesrc/types/sip.types.ts:291

StorageResult

Defined in: src/types/storage.types.ts:14

Storage operation result

Type Parameters

Type ParameterDefault type
Tunknown

Properties

PropertyTypeDescriptionDefined in
successbooleanWhether the operation succeededsrc/types/storage.types.ts:16
data?TThe data (if successful)src/types/storage.types.ts:18
error?stringError 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

PropertyModifierTypeDescriptionDefined in
namereadonlystringAdapter name (for debugging)src/types/storage.types.ts:30

Methods

get()
ts
get<T>(key): Promise<StorageResult<T>>;

Defined in: src/types/storage.types.ts:37

Get a value from storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<T>>

Promise resolving to the value or null if not found

set()
ts
set<T>(key, value): Promise<StorageResult<void>>;

Defined in: src/types/storage.types.ts:45

Set a value in storage

Type Parameters
Type ParameterDefault type
Tunknown
Parameters
ParameterTypeDescription
keystringStorage key
valueTValue to store
Returns

Promise<StorageResult<void>>

Promise resolving to success status

remove()
ts
remove(key): Promise<StorageResult<void>>;

Defined in: src/types/storage.types.ts:52

Remove a value from storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<StorageResult<void>>

Promise resolving to success status

clear()
ts
clear(prefix?): Promise<StorageResult<void>>;

Defined in: src/types/storage.types.ts:59

Clear all values from storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional prefix to filter keys
Returns

Promise<StorageResult<void>>

Promise resolving to success status

has()
ts
has(key): Promise<boolean>;

Defined in: src/types/storage.types.ts:66

Check if a key exists in storage

Parameters
ParameterTypeDescription
keystringStorage key
Returns

Promise<boolean>

Promise resolving to true if key exists

keys()
ts
keys(prefix?): Promise<string[]>;

Defined in: src/types/storage.types.ts:73

Get all keys in storage (with optional prefix filter)

Parameters
ParameterTypeDescription
prefix?stringOptional 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

PropertyTypeDescriptionDefined in
enabledbooleanWhether to encrypt the datasrc/types/storage.types.ts:81
algorithm?"AES-GCM" | "AES-CBC"Encryption algorithm (default: AES-GCM)src/types/storage.types.ts:83
iterations?numberKey derivation function iterations (default: 100000)src/types/storage.types.ts:85
salt?stringSalt 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

PropertyTypeDescriptionDefined in
datastringEncrypted data as base64 stringsrc/types/storage.types.ts:95
ivstringInitialization vector as base64 stringsrc/types/storage.types.ts:97
saltstringSalt used for key derivation as base64 stringsrc/types/storage.types.ts:99
algorithmstringAlgorithm usedsrc/types/storage.types.ts:101
iterationsnumberKey derivation iterationssrc/types/storage.types.ts:103
versionnumberVersion (for future migrations)src/types/storage.types.ts:105

StorageConfig

Defined in: src/types/storage.types.ts:111

Storage configuration

Properties

PropertyTypeDescriptionDefined in
prefix?stringStorage key prefix (default: 'vuesip')src/types/storage.types.ts:113
version?stringStorage version (for migrations, default: '1')src/types/storage.types.ts:115
encryption?EncryptionOptionsEncryption configuration for sensitive datasrc/types/storage.types.ts:117

StoredSipCredentials

Defined in: src/types/storage.types.ts:158

Stored SIP credentials (to be encrypted)

Properties

PropertyTypeDescriptionDefined in
usernamestringSIP usernamesrc/types/storage.types.ts:160
passwordstringSIP passwordsrc/types/storage.types.ts:162
authorizationUsername?stringAuthorization username (if different from username)src/types/storage.types.ts:164
ha1?stringHA1 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

PropertyTypeDescriptionDefined in
uristringWebSocket URIsrc/types/storage.types.ts:174
credentialsStoredSipCredentialsCredentialssrc/types/storage.types.ts:176
displayName?stringDisplay namesrc/types/storage.types.ts:178
contactUri?stringContact URIsrc/types/storage.types.ts:180
instanceId?stringInstance IDsrc/types/storage.types.ts:182

StoredMediaConfig

Defined in: src/types/storage.types.ts:188

Stored media configuration

Properties

PropertyTypeDescriptionDefined in
audio?MediaTrackConstraintsAudio constraintssrc/types/storage.types.ts:190
video?boolean | MediaTrackConstraintsVideo constraintssrc/types/storage.types.ts:192
iceServers?RTCIceServer[]STUN/TURN serverssrc/types/storage.types.ts:194

StoredUserPreferences

Defined in: src/types/storage.types.ts:200

Stored user preferences

Properties

PropertyTypeDescriptionDefined in
autoAnswer?booleanAuto-answer incoming callssrc/types/storage.types.ts:202
autoAnswerDelay?numberAuto-answer delay in millisecondssrc/types/storage.types.ts:204
enableAudio?booleanEnable audio by defaultsrc/types/storage.types.ts:206
enableVideo?booleanEnable video by defaultsrc/types/storage.types.ts:208
enableCallHistory?booleanEnable call historysrc/types/storage.types.ts:210
callHistoryMaxEntries?numberCall history max entriessrc/types/storage.types.ts:212
debug?booleanEnable debug loggingsrc/types/storage.types.ts:214

StoredDeviceSelection

Defined in: src/types/storage.types.ts:220

Stored device selection

Properties

PropertyTypeDescriptionDefined in
audioInput?stringSelected audio input device IDsrc/types/storage.types.ts:222
audioOutput?stringSelected audio output device IDsrc/types/storage.types.ts:224
videoInput?stringSelected video input device IDsrc/types/storage.types.ts:226

StoredDevicePermissions

Defined in: src/types/storage.types.ts:232

Stored device permissions

Properties

PropertyTypeDescriptionDefined in
microphone"granted" | "denied" | "prompt" | "not-requested"Microphone permission statussrc/types/storage.types.ts:234
camera"granted" | "denied" | "prompt" | "not-requested"Camera permission statussrc/types/storage.types.ts:236
speaker"granted" | "denied" | "prompt" | "not-requested"Speaker permission statussrc/types/storage.types.ts:238
lastUpdatednumberLast updated timestampsrc/types/storage.types.ts:240

TranscriptEntry

Defined in: src/types/transcription.types.ts:25

A single transcript entry representing finalized speech

Properties

PropertyTypeDescriptionDefined in
idstringUnique identifier for this entrysrc/types/transcription.types.ts:27
participantIdstringUnique participant identifiersrc/types/transcription.types.ts:29
participantName?stringDisplay name of the speaker (if available)src/types/transcription.types.ts:31
speakerSpeakerTypeWhether this is local or remote audiosrc/types/transcription.types.ts:33
textstringThe transcribed textsrc/types/transcription.types.ts:35
timestampnumberUnix timestamp when speech startedsrc/types/transcription.types.ts:37
confidence?numberConfidence score from provider (0-1)src/types/transcription.types.ts:39
isFinalbooleanWhether this is a final or interim resultsrc/types/transcription.types.ts:41
language?stringDetected or configured language codesrc/types/transcription.types.ts:43
words?WordTimestamp[]Word-level timestamps if supported by providersrc/types/transcription.types.ts:45

WordTimestamp

Defined in: src/types/transcription.types.ts:51

Word-level timing information

Properties

PropertyTypeDefined in
wordstringsrc/types/transcription.types.ts:52
startTimenumbersrc/types/transcription.types.ts:53
endTimenumbersrc/types/transcription.types.ts:54
confidence?numbersrc/types/transcription.types.ts:55

ParticipantConfig

Defined in: src/types/transcription.types.ts:65

Configuration for a participant's transcription

Properties

PropertyTypeDescriptionDefined in
idstringUnique participant identifiersrc/types/transcription.types.ts:67
name?stringDisplay namesrc/types/transcription.types.ts:69
enabledbooleanWhether transcription is enabled for this participantsrc/types/transcription.types.ts:71
language?stringLanguage code for this participant (overrides default)src/types/transcription.types.ts:73
audioSource?MediaStream | AudioNodeAudio source for this participantsrc/types/transcription.types.ts:75

ProviderCapabilities

Defined in: src/types/transcription.types.ts:85

Capabilities supported by a transcription provider

Properties

PropertyTypeDescriptionDefined in
streamingbooleanSupports real-time streaming transcriptionsrc/types/transcription.types.ts:87
interimResultsbooleanProvides interim results while speakingsrc/types/transcription.types.ts:89
languageDetectionbooleanCan auto-detect languagesrc/types/transcription.types.ts:91
multiChannelbooleanSupports multiple audio channelssrc/types/transcription.types.ts:93
punctuationbooleanAdds punctuation automaticallysrc/types/transcription.types.ts:95
speakerDiarizationbooleanCan identify different speakerssrc/types/transcription.types.ts:97
wordTimestampsbooleanProvides word-level timestampssrc/types/transcription.types.ts:99
supportedLanguagesstring[]List of supported language codessrc/types/transcription.types.ts:101

TranscriptResult

Defined in: src/types/transcription.types.ts:107

Result from a transcription provider

Properties

PropertyTypeDefined in
textstringsrc/types/transcription.types.ts:108
isFinalbooleansrc/types/transcription.types.ts:109
confidence?numbersrc/types/transcription.types.ts:110
language?stringsrc/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

PropertyTypeDescriptionDefined in
streamMediaStreamThe media stream to transcribesrc/types/transcription.types.ts:120
idstringIdentifier for this audio sourcesrc/types/transcription.types.ts:122
typeSpeakerTypeType of speakersrc/types/transcription.types.ts:124

ProviderOptions

Defined in: src/types/transcription.types.ts:130

Provider-specific configuration options

Extended by

Indexable

ts
[key: string]: unknown

Additional provider-specific options

Properties

PropertyTypeDescriptionDefined in
apiKey?stringAPI key (for cloud providers)src/types/transcription.types.ts:132
language?stringLanguage codesrc/types/transcription.types.ts:134
interimResults?booleanEnable interim resultssrc/types/transcription.types.ts:136
endpoint?stringCustom endpoint URLsrc/types/transcription.types.ts:138

TranscriptionProvider

Defined in: src/types/transcription.types.ts:146

Interface that all transcription providers must implement

Properties

PropertyModifierTypeDescriptionDefined in
namereadonlystringProvider identifiersrc/types/transcription.types.ts:148
capabilitiesreadonlyProviderCapabilitiesProvider capabilitiessrc/types/transcription.types.ts:150

Methods

initialize()
ts
initialize(options): Promise<void>;

Defined in: src/types/transcription.types.ts:153

Initialize the provider with options

Parameters
ParameterType
optionsProviderOptions
Returns

Promise<void>

dispose()
ts
dispose(): void;

Defined in: src/types/transcription.types.ts:155

Clean up provider resources

Returns

void

startStream()
ts
startStream(audioSource): void;

Defined in: src/types/transcription.types.ts:158

Start transcribing an audio source

Parameters
ParameterType
audioSourceAudioSource
Returns

void

stopStream()
ts
stopStream(): void;

Defined in: src/types/transcription.types.ts:160

Stop transcribing

Returns

void

onInterim()
ts
onInterim(callback): void;

Defined in: src/types/transcription.types.ts:163

Register callback for interim results

Parameters
ParameterType
callback(text, sourceId) => void
Returns

void

onFinal()
ts
onFinal(callback): void;

Defined in: src/types/transcription.types.ts:165

Register callback for final results

Parameters
ParameterType
callback(result, sourceId) => void
Returns

void

onError()
ts
onError(callback): void;

Defined in: src/types/transcription.types.ts:167

Register callback for errors

Parameters
ParameterType
callback(error) => void
Returns

void

detectLanguage()?
ts
optional detectLanguage(audio): Promise<string>;

Defined in: src/types/transcription.types.ts:170

Detect language from audio sample (optional)

Parameters
ParameterType
audioAudioBuffer
Returns

Promise<string>

getSupportedLanguages()?
ts
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

PropertyTypeDescriptionDefined in
idstringUnique identifier for this rulesrc/types/transcription.types.ts:184
phrasestring | RegExpExact phrase or regex pattern to matchsrc/types/transcription.types.ts:186
actionstringAction identifier to trigger on matchsrc/types/transcription.types.ts:188
speakerFilter?SpeakerTypeOnly match specific speakerssrc/types/transcription.types.ts:190
caseSensitive?booleanCase-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

PropertyTypeDescriptionDefined in
ruleKeywordRuleThe rule that matchedsrc/types/transcription.types.ts:200
matchedTextstringThe matched textsrc/types/transcription.types.ts:202
entryTranscriptEntryThe full transcript entry containing the matchsrc/types/transcription.types.ts:204
positionobjectPosition of match in the textsrc/types/transcription.types.ts:206
position.startnumber-src/types/transcription.types.ts:206
position.endnumber-src/types/transcription.types.ts:206

RedactionConfig

Defined in: src/types/transcription.types.ts:229

Configuration for PII redaction

Properties

PropertyTypeDescriptionDefined in
enabledbooleanEnable PII redactionsrc/types/transcription.types.ts:231
patternsPIIType[]Types of PII to detectsrc/types/transcription.types.ts:233
replacement?stringReplacement text for redacted contentsrc/types/transcription.types.ts:235
customPatterns?RegExp[]Custom regex patterns for 'custom' typesrc/types/transcription.types.ts:237
onRedacted?(type, original, entry) => voidCallback when PII is redactedsrc/types/transcription.types.ts:239

RedactionResult

Defined in: src/types/transcription.types.ts:245

Result of PII redaction

Properties

PropertyTypeDescriptionDefined in
originalstringOriginal textsrc/types/transcription.types.ts:247
redactedstringRedacted textsrc/types/transcription.types.ts:249
detectionsobject[]Detected PII instancessrc/types/transcription.types.ts:251

ExportOptions

Defined in: src/types/transcription.types.ts:270

Options for transcript export

Properties

PropertyTypeDescriptionDefined in
includeTimestamps?booleanInclude timestampssrc/types/transcription.types.ts:272
includeSpeakers?booleanInclude speaker namessrc/types/transcription.types.ts:274
includeConfidence?booleanInclude confidence scoressrc/types/transcription.types.ts:276
speakerFilter?SpeakerTypeFilter by speaker typesrc/types/transcription.types.ts:278
timeRange?objectFilter by time rangesrc/types/transcription.types.ts:280
timeRange.startnumber-src/types/transcription.types.ts:280
timeRange.endnumber-src/types/transcription.types.ts:280

TranscriptionOptions

Defined in: src/types/transcription.types.ts:290

Options for useTranscription composable

Properties

PropertyTypeDescriptionDefined in
provider?stringProvider to use (default: 'web-speech')src/types/transcription.types.ts:292
providerOptions?ProviderOptionsProvider-specific optionssrc/types/transcription.types.ts:294
language?stringDefault language codesrc/types/transcription.types.ts:296
autoDetectLanguage?booleanEnable auto language detectionsrc/types/transcription.types.ts:298
supportedLanguages?string[]Limit auto-detection to these languagessrc/types/transcription.types.ts:300
localEnabled?booleanEnable local audio transcriptionsrc/types/transcription.types.ts:302
remoteEnabled?booleanEnable remote audio transcriptionsrc/types/transcription.types.ts:304
localName?stringDisplay name for local participantsrc/types/transcription.types.ts:306
remoteName?stringDisplay name for remote participantsrc/types/transcription.types.ts:308
keywords?KeywordRule[]Keyword detection rulessrc/types/transcription.types.ts:310
redaction?RedactionConfigPII redaction configurationsrc/types/transcription.types.ts:312
onTranscript?(entry) => voidCallback when transcript entry is addedsrc/types/transcription.types.ts:314
onKeywordDetected?(match) => voidCallback when keyword is detectedsrc/types/transcription.types.ts:316
onLanguageDetected?(language, participantId) => voidCallback when language is detectedsrc/types/transcription.types.ts:318
onError?(error) => voidCallback when error occurssrc/types/transcription.types.ts:320

UseTranscriptionReturn

Defined in: src/types/transcription.types.ts:326

Return type for useTranscription composable

Properties

PropertyTypeDescriptionDefined in
stateComputedRef<TranscriptionState>Current transcription statesrc/types/transcription.types.ts:329
isTranscribingComputedRef<boolean>Whether transcription is activesrc/types/transcription.types.ts:331
transcriptRef<TranscriptEntry[]>Full transcript historysrc/types/transcription.types.ts:333
currentUtteranceRef<string>Current interim text (not yet finalized)src/types/transcription.types.ts:335
errorRef<Error | null>Last error that occurredsrc/types/transcription.types.ts:337
participantsRef<Map<string, ParticipantConfig>>Map of participant configurationssrc/types/transcription.types.ts:341
enableParticipant(id) => voidEnable transcription for a participantsrc/types/transcription.types.ts:343
disableParticipant(id) => voidDisable transcription for a participantsrc/types/transcription.types.ts:345
setParticipantLanguage(id, language) => voidSet language for a participantsrc/types/transcription.types.ts:347
setParticipantName(id, name) => voidSet display name for a participantsrc/types/transcription.types.ts:349
start() => Promise<void>Start transcriptionsrc/types/transcription.types.ts:353
stop() => voidStop transcriptionsrc/types/transcription.types.ts:355
clear() => voidClear transcript historysrc/types/transcription.types.ts:357
localEnabledRef<boolean>Enable/disable local audio transcriptionsrc/types/transcription.types.ts:361
remoteEnabledRef<boolean>Enable/disable remote audio transcriptionsrc/types/transcription.types.ts:363
detectedLanguageRef<string | null>Detected language (if auto-detect enabled)src/types/transcription.types.ts:367
lockLanguage(language) => voidLock language (stop auto-detection)src/types/transcription.types.ts:369
providerComputedRef<string>Current provider namesrc/types/transcription.types.ts:373
switchProvider(name, options?) => Promise<void>Switch to a different providersrc/types/transcription.types.ts:375
getCapabilities() => ProviderCapabilities | nullGet provider capabilitiessrc/types/transcription.types.ts:377
addKeyword(rule) => stringAdd a keyword rulesrc/types/transcription.types.ts:381
removeKeyword(id) => voidRemove a keyword rulesrc/types/transcription.types.ts:383
getKeywords() => KeywordRule[]Get all keyword rulessrc/types/transcription.types.ts:385
exportTranscript(format, options?) => stringExport transcript in specified formatsrc/types/transcription.types.ts:389
searchTranscript(query, options?) => TranscriptEntry[]Search transcript for textsrc/types/transcription.types.ts:391
onTranscript(callback) => () => voidRegister callback for new transcript entriessrc/types/transcription.types.ts:395
onKeywordDetected(callback) => () => voidRegister callback for keyword matchessrc/types/transcription.types.ts:397

TransferOptions

Defined in: src/types/transfer.types.ts:39

Transfer options

Properties

PropertyTypeDescriptionDefined in
typeTransferTypeTransfer typesrc/types/transfer.types.ts:41
targetstringTarget URI for transfersrc/types/transfer.types.ts:43
consultationCallId?stringConsultation call ID (required for attended transfer)src/types/transfer.types.ts:45
extraHeaders?string[]Custom SIP headerssrc/types/transfer.types.ts:47

TransferEvent

Defined in: src/types/transfer.types.ts:53

Transfer event

Properties

PropertyTypeDescriptionDefined in
type?stringEvent typesrc/types/transfer.types.ts:55
transferIdstringTransfer IDsrc/types/transfer.types.ts:57
state?TransferStateTransfer statesrc/types/transfer.types.ts:59
transferType?TransferTypeTransfer typesrc/types/transfer.types.ts:61
target?stringTarget URIsrc/types/transfer.types.ts:63
callId?stringCall ID being transferredsrc/types/transfer.types.ts:65
consultationCallId?stringConsultation call ID (for attended transfer)src/types/transfer.types.ts:67
timestampDateTimestampsrc/types/transfer.types.ts:69
error?stringError message (if failed)src/types/transfer.types.ts:71

TransferProgress

Defined in: src/types/transfer.types.ts:77

Transfer progress information

Properties

PropertyTypeDescriptionDefined in
idstringTransfer IDsrc/types/transfer.types.ts:79
stateTransferStateCurrent statesrc/types/transfer.types.ts:81
typeTransferTypeTransfer typesrc/types/transfer.types.ts:83
targetstringTarget URIsrc/types/transfer.types.ts:85
progress?numberProgress percentage (0-100)src/types/transfer.types.ts:87

TransferResult

Defined in: src/types/transfer.types.ts:93

Transfer result

Properties

PropertyTypeDescriptionDefined in
successbooleanWhether transfer was successfulsrc/types/transfer.types.ts:95
transferId?stringTransfer IDsrc/types/transfer.types.ts:97
error?stringError message if failedsrc/types/transfer.types.ts:99
stateTransferStateTransfer statesrc/types/transfer.types.ts:101

ErrorContext

Defined in: src/utils/errorContext.ts:37

Error context structure

Properties

PropertyTypeDescriptionDefined in
operationstringOperation being performed when error occurredsrc/utils/errorContext.ts:39
componentstringComponent or module where error occurredsrc/utils/errorContext.ts:41
severityErrorSeverityError severity levelsrc/utils/errorContext.ts:43
timestampDateTimestamp when error occurredsrc/utils/errorContext.ts:45
duration?numberDuration of operation before error (ms)src/utils/errorContext.ts:47
context?Record<string, unknown>Additional context datasrc/utils/errorContext.ts:49
state?Record<string, unknown>Current state snapshotsrc/utils/errorContext.ts:51
userId?stringUser ID or session identifiersrc/utils/errorContext.ts:53
stack?stringStack trace (if available)src/utils/errorContext.ts:55

ErrorLogEntry

Defined in: src/utils/errorContext.ts:61

Formatted error log entry

Properties

PropertyTypeDescriptionDefined in
messagestringError messagesrc/utils/errorContext.ts:63
contextErrorContextError contextsrc/utils/errorContext.ts:65
error?unknownOriginal error objectsrc/utils/errorContext.ts:67

Type Aliases

InsetPosition

ts
type InsetPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";

Defined in: src/composables/useVideoInset.ts:6

Position options for the inset video


InsetSize

ts
type InsetSize = "small" | "medium" | "large" | "custom";

Defined in: src/composables/useVideoInset.ts:11

Size presets for the inset video


StorageType

ts
type StorageType = "local" | "session" | "none";

Defined in: src/providers/types.ts:85

Storage options for credentials


BlockReason

ts
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

ts
type BlockAction = "hangup" | "busy" | "congestion" | "voicemail" | "announcement";

Defined in: src/types/blacklist.types.ts:26

Action to take when blocked call is received


QualityGrade

ts
type QualityGrade = "A" | "B" | "C" | "D" | "F";

Defined in: src/types/call-quality.types.ts:17

Quality grade assignment based on overall score


QualityTrendDirection

ts
type QualityTrendDirection = "improving" | "stable" | "degrading";

Defined in: src/types/call-quality.types.ts:70

Quality trend direction


NetworkQualityLevel

ts
type NetworkQualityLevel = "excellent" | "good" | "fair" | "poor" | "critical" | "unknown";

Defined in: src/types/call-quality.types.ts:159

Network quality level for visual indicators


SignalBars

ts
type SignalBars = 1 | 2 | 3 | 4 | 5;

Defined in: src/types/call-quality.types.ts:164

Signal bar count (1-5)


NetworkQualityIcon

ts
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

ts
type NetworkQualityColors = Record<NetworkQualityLevel, string>;

Defined in: src/types/call-quality.types.ts:214

Color scheme for network quality levels


BandwidthAction

ts
type BandwidthAction = "upgrade" | "maintain" | "downgrade" | "critical";

Defined in: src/types/call-quality.types.ts:302

Bandwidth adaptation action


RecommendationPriority

ts
type RecommendationPriority = "low" | "medium" | "high" | "critical";

Defined in: src/types/call-quality.types.ts:307

Priority level for recommendations


SuggestionType

ts
type SuggestionType = "video" | "audio" | "network" | "codec";

Defined in: src/types/call-quality.types.ts:312

Suggestion type for bandwidth adaptation


HoldDirection

ts
type HoldDirection = "sendrecv" | "sendonly" | "recvonly" | "inactive";

Defined in: src/types/call.types.ts:365

SDP direction values for hold state


CallbackPriority

ts
type CallbackPriority = "low" | "normal" | "high" | "urgent";

Defined in: src/types/callback.types.ts:20

Callback priority levels


RecoveryState

ts
type RecoveryState = "stable" | "monitoring" | "recovering" | "failed";

Defined in: src/types/connection-recovery.types.ts:25

Connection recovery state


RecoveryStrategy

ts
type RecoveryStrategy = "ice-restart" | "reconnect" | "none";

Defined in: src/types/connection-recovery.types.ts:34

Recovery strategy to use


EventPayload

ts
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()

ts
type EventHandler<T> = (event) => void | Promise<void>;

Defined in: src/types/events.types.ts:85

Event handler type

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterType
eventT

Returns

void | Promise<void>


SafeEventHandler()

ts
type SafeEventHandler<T> = (event) => void;

Defined in: src/types/events.types.ts:90

Event handler with error boundary

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterType
eventT

Returns

void


EventName

ts
type EventName = typeof EventNames[keyof typeof EventNames];

Defined in: src/types/events.types.ts:179

Event name type


WildcardPattern

ts
type WildcardPattern = `${string}:*` | "*";

Defined in: src/types/events.types.ts:184

Wildcard event pattern


GalleryLayoutMode

ts
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

ts
type AudioDevice = MediaDevice;

Defined in: src/types/media.types.ts:36

Audio device (alias for MediaDevice for backward compatibility)


OAuth2ProviderType

ts
type OAuth2ProviderType = 
  | "google"
  | "microsoft"
  | "github"
  | "okta"
  | "auth0"
  | "keycloak"
  | "custom";

Defined in: src/types/oauth.types.ts:13

Supported OAuth2 providers


OAuth2GrantType

ts
type OAuth2GrantType = 
  | "authorization_code"
  | "authorization_code_pkce"
  | "implicit"
  | "client_credentials";

Defined in: src/types/oauth.types.ts:25

OAuth2 grant types supported


SipPasswordStrategy

ts
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

ts
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

ts
type HookName = 
  | typeof HOOK_NAMES[keyof typeof HOOK_NAMES]
  | string;

Defined in: src/types/plugin.types.ts:84

Hook name type


HookHandler()

ts
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 ParameterDefault type
TDataany
TReturnany

Parameters

ParameterType
contextPluginContext
data?TData

Returns

TReturn | Promise<TReturn>


RecordingIndicatorState

ts
type RecordingIndicatorState = "inactive" | "recording" | "paused" | "stopped";

Defined in: src/types/recording-indicator.types.ts:6

Recording indicator state enumeration


StorageKey

ts
type StorageKey = typeof STORAGE_KEYS[keyof typeof STORAGE_KEYS];

Defined in: src/types/storage.types.ts:153

Storage key type


SpeakerType

ts
type SpeakerType = "local" | "remote";

Defined in: src/types/transcription.types.ts:15

Identifies the source of transcribed speech


TranscriptionState

ts
type TranscriptionState = "idle" | "starting" | "active" | "stopping" | "error";

Defined in: src/types/transcription.types.ts:20

Current state of the transcription system


PIIType

ts
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

ts
type ExportFormat = "json" | "txt" | "srt" | "vtt" | "csv";

Defined in: src/types/transcription.types.ts:265

Supported export formats


LogLevel

ts
type LogLevel = typeof LOG_LEVELS[number];

Defined in: src/utils/logger.ts:15

Log level type


LogHandler()

ts
type LogHandler = (level, namespace, message, ...args) => void;

Defined in: src/utils/logger.ts:80

Custom log handler function

Parameters

ParameterType
levelLogLevel
namespacestring
messagestring
...argsunknown[]

Returns

void

Variables

REGISTRATION_CONSTANTS

ts
const REGISTRATION_CONSTANTS: object;

Defined in: src/composables/constants.ts:13

Registration configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
DEFAULT_EXPIRES600600Default registration expiry time in secondssrc/composables/constants.ts:15
DEFAULT_MAX_RETRIES33Default maximum retry attemptssrc/composables/constants.ts:18
REFRESH_PERCENTAGE0.90.9Registration refresh percentage (refresh at 90% of expiry time)src/composables/constants.ts:21
EXPIRING_SOON_THRESHOLD3030Seconds threshold for "expiring soon" warningsrc/composables/constants.ts:24
BASE_RETRY_DELAY10001000Base retry delay in millisecondssrc/composables/constants.ts:27
MAX_RETRY_DELAY3000030000Maximum retry delay in milliseconds (30 seconds)src/composables/constants.ts:30

PRESENCE_CONSTANTS

ts
const PRESENCE_CONSTANTS: object;

Defined in: src/composables/constants.ts:36

Presence configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
DEFAULT_EXPIRES36003600Default presence publish expiry in secondssrc/composables/constants.ts:38
SUBSCRIPTION_REFRESH_PERCENTAGE0.90.9Subscription refresh percentage (refresh at 90% of expiry time)src/composables/constants.ts:41
DEFAULT_SUBSCRIPTION_EXPIRES36003600Default subscription expiry in secondssrc/composables/constants.ts:44

MESSAGING_CONSTANTS

ts
const MESSAGING_CONSTANTS: object;

Defined in: src/composables/constants.ts:50

Messaging configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
COMPOSING_IDLE_TIMEOUT1000010000Composing indicator idle timeout in millisecondssrc/composables/constants.ts:52
COMPOSING_TIMEOUT_SECONDS1010Composing indicator timeout in secondssrc/composables/constants.ts:55

CONFERENCE_CONSTANTS

ts
const CONFERENCE_CONSTANTS: object;

Defined in: src/composables/constants.ts:61

Conference configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
DEFAULT_MAX_PARTICIPANTS1010Default maximum participants in a conferencesrc/composables/constants.ts:63
AUDIO_LEVEL_INTERVAL100100Audio level monitoring interval in millisecondssrc/composables/constants.ts:66
STATE_TRANSITION_DELAY20002000Conference state transition delay in millisecondssrc/composables/constants.ts:69

TRANSFER_CONSTANTS

ts
const TRANSFER_CONSTANTS: object;

Defined in: src/composables/constants.ts:75

Transfer configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
COMPLETION_DELAY20002000Transfer completion delay in millisecondssrc/composables/constants.ts:77
CANCELLATION_DELAY10001000Transfer cancellation delay in millisecondssrc/composables/constants.ts:80

HISTORY_CONSTANTS

ts
const HISTORY_CONSTANTS: object;

Defined in: src/composables/constants.ts:86

Call history configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
DEFAULT_LIMIT1010Default call history limitsrc/composables/constants.ts:88
DEFAULT_OFFSET00Default offset for paginationsrc/composables/constants.ts:91
DEFAULT_SORT_ORDER"desc"-Default sort ordersrc/composables/constants.ts:94
DEFAULT_SORT_BY"startTime"-Default sort fieldsrc/composables/constants.ts:97
TOP_FREQUENT_CONTACTS1010Top N frequent contacts to returnsrc/composables/constants.ts:100

TIMEOUTS

ts
const TIMEOUTS: object;

Defined in: src/composables/constants.ts:106

Common timeout values (in milliseconds)

Type Declaration

NameTypeDefault valueDescriptionDefined in
SHORT_DELAY10001000Short delay for UI updatessrc/composables/constants.ts:108
MEDIUM_DELAY20002000Medium delay for operationssrc/composables/constants.ts:111
LONG_DELAY50005000Long delay for cleanupsrc/composables/constants.ts:114

CALL_CONSTANTS

ts
const CALL_CONSTANTS: object;

Defined in: src/composables/constants.ts:120

Call configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
MAX_CONCURRENT_CALLS55Maximum concurrent callssrc/composables/constants.ts:122
CALL_TIMEOUT3000030000Call timeout in millisecondssrc/composables/constants.ts:125
RING_TIMEOUT6000060000Ring timeout in millisecondssrc/composables/constants.ts:128

MEDIA_CONSTANTS

ts
const MEDIA_CONSTANTS: object;

Defined in: src/composables/constants.ts:134

Media configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
ENUMERATION_RETRY_DELAY10001000Device enumeration retry delay in millisecondssrc/composables/constants.ts:136
DEFAULT_TEST_DURATION20002000Device test duration in millisecondssrc/composables/constants.ts:139
AUDIO_LEVEL_THRESHOLD0.010.01Audio level threshold for device test (0-1)src/composables/constants.ts:142

DTMF_CONSTANTS

ts
const DTMF_CONSTANTS: object;

Defined in: src/composables/constants.ts:148

DTMF configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
DEFAULT_DURATION100100Default DTMF tone duration in millisecondssrc/composables/constants.ts:150
DEFAULT_INTER_TONE_GAP7070Default inter-tone gap in millisecondssrc/composables/constants.ts:153
MIN_DURATION4040Minimum allowed duration in millisecondssrc/composables/constants.ts:156
MAX_DURATION60006000Maximum allowed duration in millisecondssrc/composables/constants.ts:159
MAX_QUEUE_SIZE100100Maximum DTMF queue size (prevents unbounded memory growth)src/composables/constants.ts:162

RETRY_CONFIG

ts
const RETRY_CONFIG: object;

Defined in: src/composables/constants.ts:168

Retry configuration

Type Declaration

NameTypeDefault valueDescriptionDefined in
calculateBackoff()( attempt, baseDelay, maxDelay) => number-Calculate exponential backoff delaysrc/composables/constants.ts:170
BACKOFF_MULTIPLIER22Default exponential backoff multipliersrc/composables/constants.ts:176

version

ts
const version: "1.0.0" = '1.0.0';

Defined in: src/index.ts:520

VueSip library version.


metadata

ts
const metadata: object;

Defined in: src/index.ts:527

VueSip library metadata.

Type Declaration

NameTypeDefault valueDescriptionDefined in
namestring'VueSip'-src/index.ts:528
versionstring-VueSip library version.src/index.ts:529
descriptionstring'A headless Vue.js component library for SIP/VoIP applications'-src/index.ts:530
authorstring'VueSip Team'-src/index.ts:531
licensestring'MIT'-src/index.ts:532
repositorystring'https://github.com/ironyh/VueSIP'-src/index.ts:533
homepagestring'https://vuesip.com'-src/index.ts:534
bugsstring'https://github.com/ironyh/VueSIP/issues'-src/index.ts:535

default

ts
default: object;

Defined in: src/index.ts:623

Default export for convenience.

Type Declaration

NameTypeDefault valueDescriptionDefined in
versionstring-VueSip library version.src/index.ts:624
metadataobject-VueSip library metadata.src/index.ts:625
metadata.namestring'VueSip'-src/index.ts:528
metadata.versionstring-VueSip library version.src/index.ts:529
metadata.descriptionstring'A headless Vue.js component library for SIP/VoIP applications'-src/index.ts:530
metadata.authorstring'VueSip Team'-src/index.ts:531
metadata.licensestring'MIT'-src/index.ts:532
metadata.repositorystring'https://github.com/ironyh/VueSIP'-src/index.ts:533
metadata.homepagestring'https://vuesip.com'-src/index.ts:534
metadata.bugsstring'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 infosrc/index.ts:626
install(app, ...options) => any | undefined--src/index.ts:627

Example

typescript
import VueSip from 'vuesip'

app.use(VueSip.createVueSip())

ConfigProvider

ts
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

ts
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

ts
const OAuth2ProviderKey: InjectionKey<OAuth2ProviderContext>;

Defined in: src/providers/OAuth2Provider.ts:120

Injection key for OAuth2 provider context


OAuth2AuthStateKey

ts
const OAuth2AuthStateKey: InjectionKey<Ref<OAuth2AuthState>>;

Defined in: src/providers/OAuth2Provider.ts:125

Injection key for authentication state


OAuth2CredentialsKey

ts
const OAuth2CredentialsKey: InjectionKey<Ref<ProvisionedSipCredentials | null>>;

Defined in: src/providers/OAuth2Provider.ts:130

Injection key for SIP credentials


OAuth2Provider

ts
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

ts
const SipClientProviderKey: InjectionKey<SipClientProviderContext>;

Defined in: src/providers/SipClientProvider.ts:99

Injection key for complete provider context


SipClientProvider

ts
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

ts
import { useSipClientProvider } from 'vuesip'

// In child component
const { client, eventBus, isReady } = useSipClientProvider()

watchEffect(() => {
  if (isReady.value) {
    console.log('SIP client is ready!')
  }
})

adapters

ts
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

ts
const twilioAdapter: ProviderAdapter;

Defined in: src/providers/adapters/twilio.ts:27

Twilio provider adapter

This is a placeholder adapter. Full Twilio integration requires:

  1. Installing @twilio/voice-sdk
  2. Server-side token generation endpoint
  3. TwiML application configuration

elks46Provider

ts
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

ts
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:

  1. own-pbx - Generic SIP (default, most flexible)
  2. 46elks - Swedish VoIP provider
  3. telnyx - Cloud communications platform
  4. voipms - Wholesale VoIP provider (requires gateway)

ownPbxProvider

ts
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

ts
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

ts
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

ts
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

NameTypeDescriptionDefined in
get activeCallsReadonlyMap<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 mapsrc/stores/callStore.ts:106
get incomingCallQueuereadonly string[]Get readonly reference to incoming call queuesrc/stores/callStore.ts:113
get callHistoryreadonly object[]Get readonly reference to call historysrc/stores/callStore.ts:120
get activeCallsArrayobject[]Get all active calls as an arraysrc/stores/callStore.ts:127
get activeCallCountnumberGet number of active callssrc/stores/callStore.ts:134
get incomingCallCountnumberGet number of incoming callssrc/stores/callStore.ts:141
get isAtMaxCallsbooleanCheck if at max concurrent callssrc/stores/callStore.ts:148
get incomingCallsCallSession[]Get all incoming callssrc/stores/callStore.ts:155
get establishedCallsobject[]Get all established (non-incoming) callssrc/stores/callStore.ts:162
get totalHistoryCallsnumberGet total history call countsrc/stores/callStore.ts:169
get missedCallsCountnumberGet missed calls countsrc/stores/callStore.ts:176
setMaxConcurrentCalls()(max) => voidSet maximum concurrent callssrc/stores/callStore.ts:189
setMaxHistoryEntries()(max) => voidSet maximum history entriessrc/stores/callStore.ts:203
addCall()(call) => booleanAdd a call to the active calls registrysrc/stores/callStore.ts:228
updateCall()(call) => voidUpdate a call in the active calls registrysrc/stores/callStore.ts:262
removeCall()(callId) => CallSession | undefinedRemove a call from the active calls registrysrc/stores/callStore.ts:278
addActiveCall()(call) => booleanAdd a call to active calls (alias for addCall) Provided for backward compatibility with composablessrc/stores/callStore.ts:306
removeActiveCall()(callId) => booleanRemove a call from active calls (alias for removeCall) Provided for backward compatibility with composablessrc/stores/callStore.ts:317
getCall()(callId) => CallSession | undefinedGet a call by IDsrc/stores/callStore.ts:328
findCalls()(predicate) => CallSession[]Find calls matching a predicatesrc/stores/callStore.ts:338
hasCall()(callId) => booleanCheck if a call existssrc/stores/callStore.ts:348
clearActiveCalls()() => voidClear all active calls (use with caution)src/stores/callStore.ts:355
getNextIncomingCall()() => CallSession | undefinedGet the next incoming call from the queuesrc/stores/callStore.ts:371
removeFromIncomingQueue()(callId) => voidRemove a call from the incoming queue (but keep in active calls)src/stores/callStore.ts:381
addToHistory()(entry) => voidAdd a call to historysrc/stores/callStore.ts:398
createHistoryEntry()(call) => CallHistoryEntryCreate a history entry from a call sessionsrc/stores/callStore.ts:416
getHistory()(filter?) => CallHistoryEntry[]Get call history with optional filteringsrc/stores/callStore.ts:448
searchHistory()(filter?) => HistorySearchResultSearch call historysrc/stores/callStore.ts:537
deleteHistoryEntry()(entryId) => booleanDelete a specific history entrysrc/stores/callStore.ts:558
clearHistory()() => voidClear all call historysrc/stores/callStore.ts:573
clearHistoryByFilter()(filter) => numberClear history entries matching a filtersrc/stores/callStore.ts:585
reset()() => voidReset the entire store to initial statesrc/stores/callStore.ts:604
getStatistics()() => objectGet store statisticssrc/stores/callStore.ts:618

configStore

ts
const configStore: object;

Defined in: src/stores/configStore.ts:112

Configuration Store

Manages application configuration with validation and reactive state.

Type Declaration

NameTypeDescriptionDefined 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; }; } | nullGet SIP configuration (readonly)src/stores/configStore.ts:120
get mediaConfigobjectGet media configuration (readonly)src/stores/configStore.ts:127
get userPreferencesobjectGet user preferences (readonly)src/stores/configStore.ts:134
get lastValidation| { valid: boolean; errors?: string[]; warnings?: string[]; } | nullGet last validation resultsrc/stores/configStore.ts:141
get configTimestampDate | nullGet configuration timestampsrc/stores/configStore.ts:148
get hasSipConfigbooleanCheck if has SIP configurationsrc/stores/configStore.ts:155
get isConfigValidbooleanCheck if configuration is validsrc/stores/configStore.ts:162
get hasValidationErrorsbooleanCheck if has validation errorssrc/stores/configStore.ts:169
get hasValidationWarningsbooleanCheck if has validation warningssrc/stores/configStore.ts:176
get mergedMediaConstraintsMediaStreamConstraintsGet merged media constraintssrc/stores/configStore.ts:183
setSipConfig()(config, validate) => ValidationResultSet SIP configurationsrc/stores/configStore.ts:198
updateSipConfig()(updates, validate) => ValidationResultUpdate SIP configuration (partial update)src/stores/configStore.ts:230
setMediaConfig()(config, validate) => ValidationResultSet media configurationsrc/stores/configStore.ts:254
updateMediaConfig()(updates, validate) => ValidationResultUpdate media configuration (partial update)src/stores/configStore.ts:285
setUserPreferences()(preferences) => voidSet user preferencessrc/stores/configStore.ts:298
updateUserPreferences()(updates) => voidUpdate user preferences (partial update)src/stores/configStore.ts:309
clearSipConfig()() => voidClear SIP configurationsrc/stores/configStore.ts:318
validateSipConfig()() => ValidationResultValidate current SIP configurationsrc/stores/configStore.ts:333
validateMediaConfig()() => ValidationResultValidate current media configurationsrc/stores/configStore.ts:353
validateAll()() => ValidationResultValidate all configurationssrc/stores/configStore.ts:362
getWebSocketUri()() => string | nullGet WebSocket URIsrc/stores/configStore.ts:392
getSipUri()() => string | nullGet SIP URIsrc/stores/configStore.ts:401
getDisplayName()() => string | nullGet display namesrc/stores/configStore.ts:410
getRegistrationExpires()() => numberGet registration expiressrc/stores/configStore.ts:419
getMaxConcurrentCalls()() => numberGet max concurrent callssrc/stores/configStore.ts:428
isDebugMode()() => booleanCheck if debug mode is enabledsrc/stores/configStore.ts:437
isAutoRegisterEnabled()() => booleanCheck if auto-register is enabledsrc/stores/configStore.ts:446
isAutoAnswerEnabled()() => booleanCheck if auto-answer is enabledsrc/stores/configStore.ts:455
getAutoAnswerDelay()() => numberGet auto-answer delaysrc/stores/configStore.ts:464
exportConfig()(includeCredentials) => stringExport configuration as JSONsrc/stores/configStore.ts:478
importConfig()(json, validate) => ValidationResultImport configuration from JSONsrc/stores/configStore.ts:504
reset()() => voidReset the store to initial statesrc/stores/configStore.ts:542
getStatistics()() => objectGet store statisticssrc/stores/configStore.ts:566

deviceStore

ts
const deviceStore: object;

Defined in: src/stores/deviceStore.ts:149

Device Store

Manages media devices with reactive state and device change handling.

Type Declaration

NameTypeDescriptionDefined in
get audioInputDevicesreadonly object[]Get audio input devices Returns readonly wrapper to prevent direct mutation, but preserves reactivitysrc/stores/deviceStore.ts:158
get audioOutputDevicesreadonly object[]Get audio output devicessrc/stores/deviceStore.ts:166
get videoInputDevicesreadonly object[]Get video input devicessrc/stores/deviceStore.ts:173
get selectedAudioInputIdstring | nullGet selected audio input device IDsrc/stores/deviceStore.ts:180
get selectedAudioOutputIdstring | nullGet selected audio output device IDsrc/stores/deviceStore.ts:187
get selectedVideoInputIdstring | nullGet selected video input device IDsrc/stores/deviceStore.ts:194
get selectedAudioInputDeviceMediaDevice | undefinedGet selected audio input devicesrc/stores/deviceStore.ts:201
get selectedAudioOutputDeviceMediaDevice | undefinedGet selected audio output devicesrc/stores/deviceStore.ts:208
get selectedVideoInputDeviceMediaDevice | undefinedGet selected video input devicesrc/stores/deviceStore.ts:215
get audioPermissionPermissionStatusGet audio permission statussrc/stores/deviceStore.ts:222
get videoPermissionPermissionStatusGet video permission statussrc/stores/deviceStore.ts:229
get hasAudioPermissionbooleanCheck if has audio permissionsrc/stores/deviceStore.ts:236
get hasVideoPermissionbooleanCheck if has video permissionsrc/stores/deviceStore.ts:243
get hasAnyPermissionbooleanCheck if has any permissionsrc/stores/deviceStore.ts:250
get isAudioPermissionDeniedbooleanCheck if audio permission deniedsrc/stores/deviceStore.ts:257
get isVideoPermissionDeniedbooleanCheck if video permission deniedsrc/stores/deviceStore.ts:264
get lastEnumerationTimeDate | nullGet last enumeration timesrc/stores/deviceStore.ts:271
get hasAudioInputDevicesbooleanCheck if has audio input devicessrc/stores/deviceStore.ts:278
get hasAudioOutputDevicesbooleanCheck if has audio output devicessrc/stores/deviceStore.ts:285
get hasVideoInputDevicesbooleanCheck if has video input devicessrc/stores/deviceStore.ts:292
get totalDevicesnumberGet total device countsrc/stores/deviceStore.ts:299
setAudioInputDevices()(devices) => voidSet audio input devicessrc/stores/deviceStore.ts:312
setAudioOutputDevices()(devices) => voidSet audio output devicessrc/stores/deviceStore.ts:334
setVideoInputDevices()(devices) => voidSet video input devicessrc/stores/deviceStore.ts:356
updateDevices()(devices) => voidUpdate all devices from MediaDeviceInfo arraysrc/stores/deviceStore.ts:378
selectAudioInput()(deviceId) => booleanSelect audio input devicesrc/stores/deviceStore.ts:424
selectAudioOutput()(deviceId) => booleanSelect audio output devicesrc/stores/deviceStore.ts:442
selectVideoInput()(deviceId) => booleanSelect video input devicesrc/stores/deviceStore.ts:460
clearAudioInputSelection()() => voidClear audio input selectionsrc/stores/deviceStore.ts:475
clearAudioOutputSelection()() => voidClear audio output selectionsrc/stores/deviceStore.ts:483
clearVideoInputSelection()() => voidClear video input selectionsrc/stores/deviceStore.ts:491
setAudioPermission()(status) => voidSet audio permission statussrc/stores/deviceStore.ts:505
setVideoPermission()(status) => voidSet video permission statussrc/stores/deviceStore.ts:515
updatePermissions()(audio, video) => voidUpdate permissions based on getUserMedia resultsrc/stores/deviceStore.ts:526
denyAudioPermission()() => voidMark audio permission as deniedsrc/stores/deviceStore.ts:539
denyVideoPermission()() => voidMark video permission as deniedsrc/stores/deviceStore.ts:547
setDeviceChangeListenerAttached()() => voidMark that device change listener is attachedsrc/stores/deviceStore.ts:559
setDeviceChangeListenerDetached()() => voidMark that device change listener is detachedsrc/stores/deviceStore.ts:567
hasDeviceChangeListener()() => booleanCheck if device change listener is attachedsrc/stores/deviceStore.ts:575
findDeviceById()(deviceId) => MediaDevice | undefinedFind a device by ID across all device typessrc/stores/deviceStore.ts:589
isDeviceSelected()(deviceId) => booleanCheck if a device is currently selectedsrc/stores/deviceStore.ts:603
reset()() => voidReset the store to initial statesrc/stores/deviceStore.ts:614
getStatistics()() => objectGet store statisticssrc/stores/deviceStore.ts:633
setDevices()(devices) => voidSet all devices at once (bulk update) Uses the individual setters to ensure auto-selection logic runssrc/stores/deviceStore.ts:655

storePersistence

ts
const storePersistence: StorePersistenceManager;

Defined in: src/stores/persistence.ts:461


registrationStore

ts
const registrationStore: object;

Defined in: src/stores/registrationStore.ts:112

Registration Store

Manages SIP registration state with auto-refresh capabilities.

Type Declaration

NameTypeDescriptionDefined in
get stateRegistrationStateGet current registration statesrc/stores/registrationStore.ts:120
get registeredUristring | nullGet registered URIsrc/stores/registrationStore.ts:127
get expiresnumberGet registration expiry in secondssrc/stores/registrationStore.ts:134
get lastRegistrationTimeDate | nullGet last registration timesrc/stores/registrationStore.ts:141
get expiryTimeDate | nullGet expiry timesrc/stores/registrationStore.ts:148
get retryCountnumberGet retry countsrc/stores/registrationStore.ts:155
get lastErrorstring | nullGet last errorsrc/stores/registrationStore.ts:162
get isRegisteredbooleanCheck if registeredsrc/stores/registrationStore.ts:169
get isRegisteringbooleanCheck if registeringsrc/stores/registrationStore.ts:176
get isUnregisteringbooleanCheck if unregisteringsrc/stores/registrationStore.ts:183
get hasRegistrationFailedbooleanCheck if registration failedsrc/stores/registrationStore.ts:190
get secondsUntilExpirynumberGet seconds until expirysrc/stores/registrationStore.ts:197
get isExpiringSoonbooleanCheck if expiring soonsrc/stores/registrationStore.ts:204
get hasExpiredbooleanCheck if expiredsrc/stores/registrationStore.ts:211
setRegistering()(uri) => voidSet registration state to Registeringsrc/stores/registrationStore.ts:224
setRegistered()(uri, expires?) => voidSet registration state to Registeredsrc/stores/registrationStore.ts:237
setRegistrationFailed()(error) => voidSet registration state to RegistrationFailedsrc/stores/registrationStore.ts:260
setUnregistering()() => voidSet registration state to Unregisteringsrc/stores/registrationStore.ts:275
setUnregistered()() => voidSet registration state to Unregisteredsrc/stores/registrationStore.ts:287
setupAutoRefresh()() => voidSetup 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()() => voidClear auto-refresh timersrc/stores/registrationStore.ts:334
manualRefresh()() => voidManually 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) => voidSet default expiry timesrc/stores/registrationStore.ts:377
resetRetryCount()() => voidReset retry countsrc/stores/registrationStore.ts:393
incrementRetryCount()() => numberIncrement retry countsrc/stores/registrationStore.ts:403
reset()() => voidReset the store to initial statesrc/stores/registrationStore.ts:412
_triggerTimeUpdate()() => voidTrigger time-based computed properties to re-evaluate (Internal method for testing with fake timers)src/stores/registrationStore.ts:429
getStatistics()() => objectGet store statisticssrc/stores/registrationStore.ts:438

providerRegistry

ts
const providerRegistry: ProviderRegistry;

Defined in: src/transcription/providers/registry.ts:119

Global provider registry singleton


DEFAULT_QUALITY_WEIGHTS

ts
const DEFAULT_QUALITY_WEIGHTS: QualityScoreWeights;

Defined in: src/types/call-quality.types.ts:59

Default quality score weights


DEFAULT_NETWORK_COLORS

ts
const DEFAULT_NETWORK_COLORS: NetworkQualityColors;

Defined in: src/types/call-quality.types.ts:219

Default colors for network quality levels


DEFAULT_NETWORK_THRESHOLDS

ts
const DEFAULT_NETWORK_THRESHOLDS: NetworkQualityThresholds;

Defined in: src/types/call-quality.types.ts:243

Default network quality thresholds


VIDEO_RESOLUTIONS

ts
const VIDEO_RESOLUTIONS: VideoResolution[];

Defined in: src/types/call-quality.types.ts:358

Standard video resolutions


DEFAULT_BANDWIDTH_CONSTRAINTS

ts
const DEFAULT_BANDWIDTH_CONSTRAINTS: Required<BandwidthConstraints>;

Defined in: src/types/call-quality.types.ts:391

Default bandwidth constraints


EventNames

ts
const EventNames: object;

Defined in: src/types/events.types.ts:107

Event names constants

Type Declaration

NameTypeDefault valueDefined 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

ts
const OAuth2ProviderTemplates: Record<OAuth2ProviderType, Partial<OAuth2ProviderConfig>>;

Defined in: src/types/oauth.types.ts:136

Pre-configured OAuth2 provider templates


HOOK_NAMES

ts
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

NameTypeDefault valueDefined 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

ts
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

ts
const CONFIG_PROVIDER_KEY: InjectionKey<ConfigProviderContext>;

Defined in: src/types/provider.types.ts:97

Injection key for ConfigProvider


MEDIA_PROVIDER_KEY

ts
const MEDIA_PROVIDER_KEY: InjectionKey<MediaProviderContext>;

Defined in: src/types/provider.types.ts:273

Injection key for MediaProvider


STORAGE_KEYS

ts
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

NameTypeDefault valueDescriptionDefined 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 configurationsrc/types/storage.types.ts:131
USER_PREFERENCES"user:preferences"'user:preferences'User preferencessrc/types/storage.types.ts:133
DEVICE_AUDIO_INPUT"device:audio-input"'device:audio-input'Selected audio input devicesrc/types/storage.types.ts:135
DEVICE_AUDIO_OUTPUT"device:audio-output"'device:audio-output'Selected audio output devicesrc/types/storage.types.ts:137
DEVICE_VIDEO_INPUT"device:video-input"'device:video-input'Selected video input devicesrc/types/storage.types.ts:139
DEVICE_PERMISSIONS"device:permissions"'device:permissions'Device permissions statussrc/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 statesrc/types/storage.types.ts:145
REGISTRATION_LAST_TIME"registration:last-time"'registration:last-time'Last registration timesrc/types/storage.types.ts:147

defaultLogger

ts
const defaultLogger: Logger;

Defined in: src/utils/logger.ts:396

Default logger instance (for global use)

Functions

useActiveSpeaker()

ts
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

ParameterTypeDescription
participantsRef<Participant[]>Reactive reference to conference participants array
optionsActiveSpeakerOptionsConfiguration options for active speaker detection

Returns

UseActiveSpeakerReturn

Object containing active speaker state and control methods

Since

1.0.0

Examples

typescript
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`)
  }
})
typescript
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()

ts
function useAmi(): UseAmiReturn;

Defined in: src/composables/useAmi.ts:96

AMI Composable

Provides reactive AMI functionality for Vue components.

Returns

UseAmiReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiAgentLoginOptionsConfiguration options

Returns

UseAmiAgentLoginReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientRef<AmiClient | null>AMI client instance
optionsUseAmiAgentStatsOptionsConfiguration options

Returns

UseAmiAgentStatsReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance
optionsUseAmiBlacklistOptionsConfiguration options

Returns

UseAmiBlacklistReturn

Example

typescript
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()

ts
function useAmiCDR(amiClientRef, options): UseAmiCDRReturn;

Defined in: src/composables/useAmiCDR.ts:543

AMI CDR Composable

Provides reactive CDR processing for Vue components.

Parameters

ParameterTypeDescription
amiClientRef| Ref<AmiClient | null, AmiClient | null> | ComputedRef<AmiClient | null>Ref to AMI client instance
optionsUseAmiCDROptionsConfiguration options

Returns

UseAmiCDRReturn


useAmiCallback()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiCallbackOptionsConfiguration options

Returns

UseAmiCallbackReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiCallsOptionsConfiguration options with sensible defaults

Returns

UseAmiCallsReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiDatabaseOptionsConfiguration options with sensible defaults

Returns

UseAmiDatabaseReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiFeatureCodesOptionsConfiguration options

Returns

UseAmiFeatureCodesReturn

Example

typescript
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()

ts
function useAmiIVR(client, options): UseAmiIVRReturn;

Defined in: src/composables/useAmiIVR.ts:151

AMI IVR Composable

Parameters

ParameterTypeDescription
clientRef<AmiClient | null>Ref to AMI client instance
optionsUseAmiIVROptionsConfiguration options

Returns

UseAmiIVRReturn

IVR management interface


useAmiPaging()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiPagingOptionsConfiguration options with sensible defaults

Returns

UseAmiPagingReturn

Example

typescript
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()

ts
function useAmiParking(amiClientRef, options): UseAmiParkingReturn;

Defined in: src/composables/useAmiParking.ts:100

AMI Parking Composable

Provides reactive call parking functionality for Vue components.

Parameters

ParameterTypeDescription
amiClientRefRef<AmiClient | null>Ref to AMI client instance
optionsUseAmiParkingOptionsConfiguration options

Returns

UseAmiParkingReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiPeersOptionsConfiguration options with sensible defaults

Returns

UseAmiPeersReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiQueuesOptionsConfiguration options with sensible defaults

Returns

UseAmiQueuesReturn

Example

typescript
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()

ts
function useAmiRecording(clientRef, options): UseAmiRecordingReturn;

Defined in: src/composables/useAmiRecording.ts:147

useAmiRecording composable for call recording management

Parameters

ParameterTypeDescription
clientRef| Ref<AmiClient | null, AmiClient | null> | ComputedRef<AmiClient | null>Reactive reference to AmiClient instance
optionsUseAmiRecordingOptionsRecording options

Returns

UseAmiRecordingReturn

Recording management interface


useAmiRingGroups()

ts
function useAmiRingGroups(client, options): UseAmiRingGroupsReturn;

Defined in: src/composables/useAmiRingGroups.ts:147

AMI Ring Groups Composable

Parameters

ParameterTypeDescription
clientRef<AmiClient | null>Ref to AMI client instance
optionsUseAmiRingGroupsOptionsConfiguration options

Returns

UseAmiRingGroupsReturn

Ring group management interface


useAmiSupervisor()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance (from useAmi().getClient())
optionsUseAmiSupervisorOptionsConfiguration options with sensible defaults

Returns

UseAmiSupervisorReturn

Example

typescript
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()

ts
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

ParameterTypeDescription
clientAmiClient | nullAMI client instance
optionsUseAmiTimeConditionsOptionsConfiguration options

Returns

UseAmiTimeConditionsReturn

Example

typescript
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()

ts
function useAmiVoicemail(amiClientRef, options): UseAmiVoicemailReturn;

Defined in: src/composables/useAmiVoicemail.ts:91

AMI Voicemail Composable

Provides reactive voicemail/MWI functionality for Vue components.

Parameters

ParameterTypeDescription
amiClientRefRef<AmiClient | null>Ref to AMI client instance
optionsUseAmiVoicemailOptionsConfiguration options

Returns

UseAmiVoicemailReturn

Example

typescript
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()

ts
function useAudioDevices(): UseAudioDevicesReturn;

Defined in: src/composables/useAudioDevices.ts:60

Returns

UseAudioDevicesReturn


useBandwidthAdaptation()

ts
function useBandwidthAdaptation(options): UseBandwidthAdaptationReturn;

Defined in: src/composables/useBandwidthAdaptation.ts:152

Bandwidth adaptation composable

Parameters

ParameterTypeDescription
optionsBandwidthAdaptationOptionsConfiguration options

Returns

UseBandwidthAdaptationReturn

Reactive bandwidth adaptation state and controls


useCallControls()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance

Returns

UseCallControlsReturn

Call control state and methods

Example

typescript
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()

ts
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

UseCallHistoryReturn

Call history state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sessionRef<CallSession | null>Active call session reference

Returns

UseCallHoldReturn

Call hold state and methods

Example

typescript
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()

ts
function useCallQualityScore(options): UseCallQualityScoreReturn;

Defined in: src/composables/useCallQualityScore.ts:373

Composable for calculating comprehensive call quality scores

Parameters

ParameterTypeDescription
optionsCallQualityScoreOptionsConfiguration options

Returns

UseCallQualityScoreReturn

Quality scoring interface

Example

ts
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()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance
mediaManager?Ref<MediaManager | null, MediaManager | null>Media manager instance (optional, will create if not provided)

Returns

UseCallSessionReturn

Call session state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sessionRef<CallSession | null>Active call session reference

Returns

UseCallTransferReturn

Call transfer state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>Reactive reference to the SIP client instance

Returns

UseConferenceReturn

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 isActive before performing conference operations
  • Use the onConferenceEvent listener 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 isActive first
  • Don't call removeParticipant to leave - use endConference instead
  • Remember that participantCount includes yourself (the local participant)
  • Conference state transitions are asynchronous - watch the state property
  • Muting yourself vs muting others uses different underlying mechanisms

Since

1.0.0

Examples

typescript
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()
typescript
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`)
}
typescript
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')
typescript
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()
typescript
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()

ts
function useConnectionRecovery(options): UseConnectionRecoveryReturn;

Defined in: src/composables/useConnectionRecovery.ts:103

Composable for managing connection recovery with ICE restart

Parameters

ParameterTypeDescription
optionsConnectionRecoveryOptionsConfiguration options

Returns

UseConnectionRecoveryReturn

Connection recovery state and methods

Example

ts
const { state, isRecovering, recover, monitor } = useConnectionRecovery({
  maxAttempts: 3,
  onRecoverySuccess: () => console.log('Recovered!')
})

// Start monitoring a peer connection
monitor(peerConnection)

useDTMF()

ts
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

ParameterTypeDescription
sessionRef<CallSession | null>Call session instance

Returns

UseDTMFReturn

DTMF state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance

Returns

UseDialogReturn

Dialog state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
initialConfig?FreePBXPresenceBridgeConfigOptional initial bridge configuration

Returns

UseFreePBXPresenceReturn

Presence state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
participantCountRef<number>Reactive reference to number of participants
optionsGalleryLayoutOptionsConfiguration options

Returns

UseGalleryLayoutReturn

Object containing layout state and control methods

Since

1.0.0

Examples

typescript
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;"
typescript
const containerSize = ref({ width: 1920, height: 1080 })
const { tileDimensions, gridStyle } = useGalleryLayout(participantCount, {
  containerSize,
  gap: 16,
})

// tileDimensions.value = { width: 624, height: 351 }
typescript
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()

ts
function useLocalRecording(options): UseLocalRecordingReturn;

Defined in: src/composables/useLocalRecording.ts:47

Vue composable for client-side audio/video recording using MediaRecorder API

Parameters

ParameterTypeDescription
optionsLocalRecordingOptionsConfiguration options for recording

Returns

UseLocalRecordingReturn

Recording controls and reactive state

Example

html
<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()

ts
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

ParameterTypeDescription
mediaManager?Ref<MediaManager | null, MediaManager | null>Media manager instance (optional)
options?{ autoEnumerate?: boolean; autoMonitor?: boolean; }Options
options.autoEnumerate?booleanAuto-enumerate on mount (default: true)
options.autoMonitor?booleanAuto-monitor device changes (default: true)

Returns

UseMediaDevicesReturn

Media devices state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance

Returns

UseMessagingReturn

Messaging state and methods

Example

typescript
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()

ts
function useMultiLine(config?): UseMultiLineReturn;

Defined in: src/composables/useMultiLine.ts:93

Create multi-line composable

Parameters

ParameterTypeDescription
config?Partial<MultiLineConfig>Optional multi-line configuration

Returns

UseMultiLineReturn

Multi-line state and methods

Example

typescript
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()

ts
function useNetworkQualityIndicator(options): UseNetworkQualityIndicatorReturn;

Defined in: src/composables/useNetworkQualityIndicator.ts:181

Network quality indicator composable

Parameters

ParameterTypeDescription
optionsNetworkQualityIndicatorOptionsConfiguration options

Returns

UseNetworkQualityIndicatorReturn

Reactive network quality indicator state and controls


useOAuth2()

ts
function useOAuth2(options): UseOAuth2ComposableReturn;

Defined in: src/composables/useOAuth2.ts:100

Vue composable for OAuth2 authentication

Parameters

ParameterType
optionsUseOAuth2Options

Returns

UseOAuth2ComposableReturn


createGoogleOAuth2Config()

ts
function createGoogleOAuth2Config(params): OAuth2ServiceConfig;

Defined in: src/composables/useOAuth2.ts:176

Create OAuth2 configuration for Google

Parameters

ParameterType
params{ clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; scopes?: string[]; }
params.clientIdstring
params.redirectUristring
params.sipDomainstring
params.wsServerUristring
params.scopes?string[]

Returns

OAuth2ServiceConfig


createMicrosoftOAuth2Config()

ts
function createMicrosoftOAuth2Config(params): OAuth2ServiceConfig;

Defined in: src/composables/useOAuth2.ts:211

Create OAuth2 configuration for Microsoft/Azure AD

Parameters

ParameterType
params{ clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; tenantId?: string; scopes?: string[]; }
params.clientIdstring
params.redirectUristring
params.sipDomainstring
params.wsServerUristring
params.tenantId?string
params.scopes?string[]

Returns

OAuth2ServiceConfig


createGitHubOAuth2Config()

ts
function createGitHubOAuth2Config(params): OAuth2ServiceConfig;

Defined in: src/composables/useOAuth2.ts:246

Create OAuth2 configuration for GitHub

Parameters

ParameterType
params{ clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; scopes?: string[]; }
params.clientIdstring
params.redirectUristring
params.sipDomainstring
params.wsServerUristring
params.scopes?string[]

Returns

OAuth2ServiceConfig


createOktaOAuth2Config()

ts
function createOktaOAuth2Config(params): OAuth2ServiceConfig;

Defined in: src/composables/useOAuth2.ts:287

Create OAuth2 configuration for Okta

Parameters

ParameterType
params{ clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; oktaDomain: string; scopes?: string[]; }
params.clientIdstring
params.redirectUristring
params.sipDomainstring
params.wsServerUristring
params.oktaDomainstring
params.scopes?string[]

Returns

OAuth2ServiceConfig


createAuth0OAuth2Config()

ts
function createAuth0OAuth2Config(params): OAuth2ServiceConfig;

Defined in: src/composables/useOAuth2.ts:323

Create OAuth2 configuration for Auth0

Parameters

ParameterType
params{ clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; auth0Domain: string; audience?: string; scopes?: string[]; }
params.clientIdstring
params.redirectUristring
params.sipDomainstring
params.wsServerUristring
params.auth0Domainstring
params.audience?string
params.scopes?string[]

Returns

OAuth2ServiceConfig


createKeycloakOAuth2Config()

ts
function createKeycloakOAuth2Config(params): OAuth2ServiceConfig;

Defined in: src/composables/useOAuth2.ts:366

Create OAuth2 configuration for Keycloak

Parameters

ParameterType
params{ clientId: string; redirectUri: string; sipDomain: string; wsServerUri: string; keycloakUrl: string; realm: string; scopes?: string[]; }
params.clientIdstring
params.redirectUristring
params.sipDomainstring
params.wsServerUristring
params.keycloakUrlstring
params.realmstring
params.scopes?string[]

Returns

OAuth2ServiceConfig


useParticipantControls()

ts
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

ParameterTypeDescription
participant| Ref<Participant, Participant> | ComputedRef<Participant>The participant to control (ref or computed ref)
optionsParticipantControlsOptionsControl options and callbacks

Returns

UseParticipantControlsReturn

Control state and methods

Example

typescript
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()

ts
function usePictureInPicture(videoRef, options): UsePictureInPictureReturn;

Defined in: src/composables/usePictureInPicture.ts:84

Composable for managing Picture-in-Picture mode for video elements

Parameters

ParameterTypeDescription
videoRefRef<HTMLVideoElement | null>Ref to the HTMLVideoElement to use for PiP
optionsPictureInPictureOptionsConfiguration options

Returns

UsePictureInPictureReturn

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

typescript
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()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance

Returns

UsePresenceReturn

Presence state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
optionsRecordingIndicatorOptionsConfiguration options

Returns

UseRecordingIndicatorReturn

Recording indicator controls and reactive state

Example

html
<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()

ts
function useSessionPersistence(options): UseSessionPersistenceReturn;

Defined in: src/composables/useSessionPersistence.ts:87

Composable for managing call session persistence

Parameters

ParameterTypeDescription
optionsSessionPersistenceOptionsConfiguration options

Returns

UseSessionPersistenceReturn

Session persistence state and methods

Example

ts
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()

ts
function useSipAutoAnswer(options): UseSipAutoAnswerReturn;

Defined in: src/composables/useSipAutoAnswer.ts:227

Vue composable for automatic call answering

Parameters

ParameterTypeDescription
optionsUseSipAutoAnswerOptionsConfiguration options

Returns

UseSipAutoAnswerReturn

Auto-answer state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
initialConfig?SipClientConfigOptional initial SIP client configuration
options?{ eventBus?: EventBus; autoConnect?: boolean; autoCleanup?: boolean; reconnectDelay?: number; connectionTimeout?: number; }Optional composable options
options.eventBus?EventBusShared event bus instance
options.autoConnect?booleanAuto-connect on mount
options.autoCleanup?booleanAuto-cleanup on unmount
options.reconnectDelay?numberReconnect delay in milliseconds (default: 1000)
options.connectionTimeout?numberConnection timeout in milliseconds (default: 30000)

Returns

UseSipClientReturn

Composable interface with reactive state and methods

Example

ts
const {
  isConnected,
  isRegistered,
  connect,
  disconnect,
  register
} = useSipClient(config)

// Connect and register
await connect()

useSipDtmf()

ts
function useSipDtmf(currentSession): UseSipDtmfReturn;

Defined in: src/composables/useSipDtmf.ts:28

Composable for sending DTMF tones during an active call

Parameters

ParameterTypeDescription
currentSessionRef<any>Reference to the current JsSIP RTCSession (typed as any due to lack of JsSIP types)

Returns

UseSipDtmfReturn

Object with sendDtmf and sendDtmfSequence methods


useSipE911()

ts
function useSipE911(
   client, 
   eventBus?, 
   options?): UseSipE911Return;

Defined in: src/composables/useSipE911.ts:179

E911 Emergency Call Handling Composable

Parameters

ParameterTypeDescription
clientRef<SipClient | null>Ref to SIP client instance
eventBus?EventBus | nullOptional EventBus for subscribing to SIP events
options?UseSipE911OptionsConfiguration options

Returns

UseSipE911Return

E911 management interface


useSipRegistration()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance
optionsRegistrationOptionsRegistration options

Returns

UseSipRegistrationReturn

Registration state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sipClientRef<SipClient | null>SIP client instance ref
mediaManager?Ref<MediaManager | null, MediaManager | null>Media manager instance ref (optional)
options?UseSipSecondLineOptionsConfiguration options

Returns

UseSipSecondLineReturn

Multi-line state and methods

Example

typescript
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()

ts
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

ParameterTypeDescription
sessionRefRef<CallSession | null>Ref to CallSession instance
optionsUseSipWebRTCStatsOptionsConfiguration options

Returns

UseSipWebRTCStatsReturn

Example

typescript
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()

ts
function useTranscription(options): UseTranscriptionReturn;

Defined in: src/composables/useTranscription.ts:65

Composable for real-time voice transcription

Parameters

ParameterTypeDescription
optionsTranscriptionOptionsTranscription configuration options

Returns

UseTranscriptionReturn

Transcription state and controls

Example

ts
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()

ts
function useVideoInset(options): UseVideoInsetReturn;

Defined in: src/composables/useVideoInset.ts:185

Composable for managing picture-in-picture style video inset layouts

Parameters

ParameterTypeDescription
optionsVideoInsetOptionsConfiguration options

Returns

UseVideoInsetReturn

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

html
<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()

ts
function createAmiClient(config): AmiClient;

Defined in: src/core/AmiClient.ts:1295

Create AMI client instance

Parameters

ParameterType
configAmiConfig

Returns

AmiClient


createVueSip()

ts
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

ParameterTypeDescription
optionsVueSipOptionsPlugin configuration options

Returns

Plugin

Vue plugin object

Examples

Basic usage:

typescript
import { createApp } from 'vue'
import { createVueSip } from 'vuesip'

const app = createApp(App)
app.use(createVueSip({
  debug: true,
  logLevel: 'info'
}))

With global configuration:

typescript
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

createAnalyticsPlugin()

ts
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

AnalyticsPlugin

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:

  1. Create instance using this factory function
  2. Register with PluginManager
  3. PluginManager calls install() with configuration
  4. Plugin becomes operational and tracks events

Examples

typescript
import { createAnalyticsPlugin } from './plugins/AnalyticsPlugin'

const analyticsPlugin = createAnalyticsPlugin()
// Plugin instance created, ready to register
typescript
import { 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
typescript
// 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()

ts
function createRecordingPlugin(): RecordingPlugin;

Defined in: src/plugins/RecordingPlugin.ts:3091

Create recording plugin instance

Returns

RecordingPlugin

Recording plugin


useConfigProvider()

ts
function useConfigProvider(): ConfigProviderContext;

Defined in: src/providers/ConfigProvider.ts:317

Type-safe inject helper for ConfigProvider

Returns

ConfigProviderContext

Throws

If used outside of ConfigProvider

Example

ts
import { useConfigProvider } from 'vuesip'

const config = useConfigProvider()
console.log(config.sipConfig)

useMediaProvider()

ts
function useMediaProvider(): MediaProviderContext;

Defined in: src/providers/MediaProvider.ts:482

Type-safe inject helper for MediaProvider

Returns

MediaProviderContext

Throws

If used outside of MediaProvider

Example

ts
import { useMediaProvider } from 'vuesip'

const media = useMediaProvider()
console.log(media.audioInputDevices)

useOAuth2Provider()

ts
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

OAuth2ProviderContext

Throws

If used outside of OAuth2Provider

Example

html
<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()

ts
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()

ts
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

SipClientProviderContext

Throws

If used outside of SipClientProvider

Example

html
<script setup>
import { useSipClientProvider } from 'vuesip'

const { client, eventBus, isReady, connectionState } = useSipClientProvider()

watchEffect(() => {
  console.log('Connection state:', connectionState.value)
})
</script>

createCredentialStorage()

ts
function createCredentialStorage(type, options): CredentialStorage;

Defined in: src/providers/credentialStorage.ts:34

Create a credential storage instance

Parameters

ParameterTypeDescription
typeStorageTypeStorage type ('local', 'session', or 'none')
optionsStorageOptionsStorage configuration options

Returns

CredentialStorage

Credential storage interface


registerProvider()

ts
function registerProvider(config, options): void;

Defined in: src/providers/providerRegistry.ts:25

Register a provider configuration

Parameters

ParameterTypeDescription
configProviderConfigProvider configuration to register
optionsProviderRegisterOptionsRegistration options

Returns

void

Throws

Error if provider ID already exists and force is not true


getProvider()

ts
function getProvider(id): ProviderConfig | undefined;

Defined in: src/providers/providerRegistry.ts:37

Get a provider by ID

Parameters

ParameterTypeDescription
idstringProvider ID to lookup

Returns

ProviderConfig | undefined

Provider configuration or undefined if not found


getAllProviders()

ts
function getAllProviders(): ProviderConfig[];

Defined in: src/providers/providerRegistry.ts:45

Get all registered providers

Returns

ProviderConfig[]

Array of all registered provider configurations


removeProvider()

ts
function removeProvider(id): boolean;

Defined in: src/providers/providerRegistry.ts:54

Remove a provider by ID

Parameters

ParameterTypeDescription
idstringProvider ID to remove

Returns

boolean

true if provider was removed, false if it didn't exist


resetRegistry()

ts
function resetRegistry(): void;

Defined in: src/providers/providerRegistry.ts:62

Reset the registry (clear all providers) Primarily used for testing

Returns

void


useProviderSelector()

ts
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

ParameterTypeDescription
optionsProviderSelectorOptionsConfiguration options

Returns

UseProviderSelectorReturn

Provider selector state and methods

Example

html
<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()

ts
function generatePKCE(): Promise<PKCEParams>;

Defined in: src/services/OAuth2Service.ts:60

Generate PKCE parameters (code verifier and challenge)

Returns

Promise<PKCEParams>


generateState()

ts
function generateState(): string;

Defined in: src/services/OAuth2Service.ts:73

Generate a random state parameter for CSRF protection

Returns

string


createPersistence()

ts
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

ParameterTypeDescription
optionsPersistenceOptions<T>Persistence options

Returns

PersistenceManager<T>

Persistence manager instance

Example

typescript
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()

ts
function initializeStorePersistence(config?): Promise<void>;

Defined in: src/stores/persistence.ts:481

Initialize store persistence

Parameters

ParameterTypeDescription
config?PersistenceConfigPersistence configuration

Returns

Promise<void>

Example

typescript
// Initialize with default settings
await initializeStorePersistence()

// Initialize with custom settings
await initializeStorePersistence({
  storage: { prefix: 'myapp', version: '2' },
  encryptionPassword: 'secure-password',
  debounce: 500
})

saveAllStores()

ts
function saveAllStores(): Promise<void>;

Defined in: src/stores/persistence.ts:488

Save all store states manually

Returns

Promise<void>


loadAllStores()

ts
function loadAllStores(): Promise<void>;

Defined in: src/stores/persistence.ts:495

Load all store states manually

Returns

Promise<void>


clearAllStores()

ts
function clearAllStores(): Promise<void>;

Defined in: src/stores/persistence.ts:502

Clear all persisted store data

Returns

Promise<void>


destroyStorePersistence()

ts
function destroyStorePersistence(): void;

Defined in: src/stores/persistence.ts:509

Destroy store persistence

Returns

void


getStorageQuota()

ts
function getStorageQuota(): Promise<StorageQuotaInfo>;

Defined in: src/stores/persistence.ts:516

Get storage quota information

Returns

Promise<StorageQuotaInfo>


getStorageUsageSummary()

ts
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()

ts
function checkStorageWarning(threshold): Promise<boolean>;

Defined in: src/stores/persistence.ts:532

Check if storage usage is above warning threshold

Parameters

ParameterTypeDefault valueDescription
thresholdnumber80Warning threshold percentage (default: 80)

Returns

Promise<boolean>


clearOldCallHistory()

ts
function clearOldCallHistory(targetReduction): Promise<number>;

Defined in: src/stores/persistence.ts:541

Clear old call history to free up storage space

Parameters

ParameterTypeDefault valueDescription
targetReductionnumber20Percentage of entries to remove (default: 20)

Returns

Promise<number>


createAbortError()

ts
function createAbortError(message): DOMException;

Defined in: src/utils/abortController.ts:11

Create a standard abort error

Parameters

ParameterTypeDefault valueDescription
messagestring'Operation aborted'Error message

Returns

DOMException

DOMException with 'AbortError' name


isAbortError()

ts
function isAbortError(error): error is DOMException;

Defined in: src/utils/abortController.ts:20

Check if an error is an abort error

Parameters

ParameterTypeDescription
errorunknownError to check

Returns

error is DOMException

True if error is an AbortError


abortableSleep()

ts
function abortableSleep(ms, signal?): Promise<void>;

Defined in: src/utils/abortController.ts:41

Sleep for a duration with abort support

Parameters

ParameterTypeDescription
msnumberMilliseconds to sleep
signal?AbortSignalOptional abort signal

Returns

Promise<void>

Promise that resolves after the duration or rejects if aborted

Example

typescript
const controller = new AbortController()
try {
  await abortableSleep(1000, controller.signal)
} catch (error) {
  if (isAbortError(error)) {
    console.log('Sleep was aborted')
  }
}

throwIfAborted()

ts
function throwIfAborted(signal?): void;

Defined in: src/utils/abortController.ts:68

Throw if signal is aborted

Parameters

ParameterTypeDescription
signal?AbortSignalOptional abort signal

Returns

void

Throws

DOMException if signal is aborted


isCryptoAvailable()

ts
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()

ts
function encrypt<T>(
   data, 
   password, 
options): Promise<EncryptedData>;

Defined in: src/utils/encryption.ts:168

Encrypt data using AES-GCM

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterTypeDescription
dataTData to encrypt (will be JSON.stringified)
passwordstringPassword for encryption
optionsPartial<EncryptionOptions>Encryption options

Returns

Promise<EncryptedData>

Encrypted data structure

Throws

Error if encryption fails or crypto is not available


decrypt()

ts
function decrypt<T>(encryptedData, password): Promise<T>;

Defined in: src/utils/encryption.ts:225

Decrypt data using AES-GCM

Type Parameters

Type ParameterDefault type
Tunknown

Parameters

ParameterTypeDescription
encryptedDataEncryptedDataEncrypted data structure
passwordstringPassword for decryption

Returns

Promise<T>

Decrypted data

Throws

Error if decryption fails or crypto is not available


generateEncryptionKey()

ts
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

ParameterTypeDefault valueDescription
lengthnumber32Key length in bytes (default: 32)

Returns

string

Random key as base64 string

Throws

Error if crypto is not available


hashPassword()

ts
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

ParameterTypeDescription
passwordstringPassword to hash

Returns

Promise<string>

Hashed password as hex string

Throws

Error if crypto is not available


createErrorContext()

ts
function createErrorContext(
   operation, 
   component, 
   severity, 
   options): ErrorContext;

Defined in: src/utils/errorContext.ts:88

Create a structured error context

Parameters

ParameterTypeDescription
operationstringOperation being performed
componentstringComponent or module name
severityErrorSeverityError 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

ErrorContext

Structured error context

Example

typescript
const ctx = createErrorContext('makeCall', 'useCallSession', ErrorSeverity.HIGH, {
  context: { target: 'sip:user@domain.com' },
  state: { connectionState: 'connected', hasSession: false },
  duration: 1234
})

formatError()

ts
function formatError(
   message, 
   error, 
   context): ErrorLogEntry;

Defined in: src/utils/errorContext.ts:136

Format an error with context for logging

Parameters

ParameterTypeDescription
messagestringError message
errorunknownOriginal error object
contextErrorContextError context

Returns

ErrorLogEntry

Formatted error log entry

Example

typescript
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()

ts
function createOperationTimer(): object;

Defined in: src/utils/errorContext.ts:161

Create an operation timer for tracking duration

Returns

object

Object with elapsed() function

NameTypeDefined in
elapsed()() => numbersrc/utils/errorContext.ts:161

Example

typescript
const timer = createOperationTimer()
// ... perform operation ...
const duration = timer.elapsed()
// Use duration in error context

sanitizeContext()

ts
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

ParameterTypeDescription
dataRecord<string, unknown>Data to sanitize
seenWeakSet<object>WeakSet to track visited objects (for circular reference detection)

Returns

Record<string, unknown>

Sanitized data

Example

typescript
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()

ts
function extractErrorInfo(error): object;

Defined in: src/utils/errorContext.ts:251

Extract relevant error information from various error types

Parameters

ParameterTypeDescription
errorunknownError object (can be Error, DOMException, or unknown)

Returns

object

Extracted error information

NameTypeDefined in
namestringsrc/utils/errorContext.ts:252
messagestringsrc/utils/errorContext.ts:253
code?string | numbersrc/utils/errorContext.ts:254
stack?stringsrc/utils/errorContext.ts:255

Example

typescript
const info = extractErrorInfo(error)
// { name: 'TypeError', message: 'Cannot read...', code: undefined, stack: '...' }

logErrorWithContext()

ts
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

ParameterTypeDescription
logger{ error: (message, ...args) => void; }Logger instance (must have error method)
logger.error(message, ...args) => void-
messagestringError message
errorunknownOriginal error
operationstringOperation being performed
componentstringComponent name
severityErrorSeverityError 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

typescript
logErrorWithContext(
  log,
  'Failed to make call',
  error,
  'makeCall',
  'useCallSession',
  ErrorSeverity.HIGH,
  {
    context: { target: 'sip:user@domain.com' },
    state: { isConnected: true },
    duration: 1234
  }
)

formatDuration()

ts
function formatDuration(seconds): string;

Defined in: src/utils/formatters.ts:25

Formats a duration in seconds to HH:MM:SS format

Parameters

ParameterTypeDescription
secondsnumberDuration in seconds

Returns

string

Formatted duration string

Example

typescript
formatDuration(65) // "00:01:05"
formatDuration(3665) // "01:01:05"

formatDurationShort()

ts
function formatDurationShort(seconds): string;

Defined in: src/utils/formatters.ts:52

Formats a duration in seconds to a short human-readable format

Parameters

ParameterTypeDescription
secondsnumberDuration in seconds

Returns

string

Short formatted duration (e.g., "5m 30s", "1h 5m")

Example

typescript
formatDurationShort(65) // "1m 5s"
formatDurationShort(3665) // "1h 1m"
formatDurationShort(30) // "30s"

formatSipUri()

ts
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

ParameterTypeDefault valueDescription
uristringundefinedSIP URI to format
includeSchemebooleanfalseWhether to include sip: or sips: prefix

Returns

string

Formatted SIP URI

Example

typescript
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()

ts
function parseSipUri(uri): Partial<SipUri> | null;

Defined in: src/utils/formatters.ts:129

Parses a SIP URI into its components

Parameters

ParameterTypeDescription
uristringSIP URI to parse

Returns

Partial<SipUri> | null

Parsed SIP URI object or null if invalid

Example

typescript
const parsed = parseSipUri('sips:alice@example.com:5061')
// {
//   scheme: 'sips',
//   user: 'alice',
//   host: 'example.com',
//   port: 5061
// }

extractDisplayName()

ts
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

ParameterTypeDescription
uristringSIP URI with optional display name

Returns

string | null | undefined

Display name or null if not present

Example

typescript
extractDisplayName('"Alice Smith" <sip:alice@example.com>') // "Alice Smith"
extractDisplayName('sip:alice@example.com') // null

formatPhoneNumber()

ts
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

ParameterTypeDescription
numberstringE.164 phone number (+country code + number)

Returns

string

Formatted phone number

Example

typescript
formatPhoneNumber('+14155551234') // "+1 (415) 555-1234"
formatPhoneNumber('+442071234567') // "+44 20 7123 4567"

formatCallTime()

ts
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

ParameterTypeDescription
dateDateDate to format
nowDateCurrent date (for testing)

Returns

string

Formatted date string

Example

typescript
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()

ts
function formatDateTime(date): string;

Defined in: src/utils/formatters.ts:301

Formats a date and time for detailed call history

Parameters

ParameterTypeDescription
dateDateDate to format

Returns

string

Formatted date and time string

Example

typescript
formatDateTime(new Date('2024-01-15T14:30:00'))
// "Jan 15, 2024 at 2:30 PM"

formatIsoTimestamp()

ts
function formatIsoTimestamp(date): string;

Defined in: src/utils/formatters.ts:336

Formats a timestamp to ISO 8601 format

Parameters

ParameterTypeDescription
dateDateDate to format

Returns

string

ISO 8601 formatted string

Example

typescript
formatIsoTimestamp(new Date('2024-01-15T14:30:00'))
// "2024-01-15T14:30:00.000Z"

formatBytes()

ts
function formatBytes(bytes, decimals): string;

Defined in: src/utils/formatters.ts:358

Formats bytes to human-readable size

Parameters

ParameterTypeDefault valueDescription
bytesnumberundefinedNumber of bytes
decimalsnumber1Number of decimal places

Returns

string

Formatted size string

Example

typescript
formatBytes(1024) // "1 KB"
formatBytes(1536) // "1.5 KB"
formatBytes(1048576) // "1 MB"

formatBitrate()

ts
function formatBitrate(bitsPerSecond, decimals): string;

Defined in: src/utils/formatters.ts:387

Formats a bitrate to human-readable format

Parameters

ParameterTypeDefault valueDescription
bitsPerSecondnumberundefinedBitrate in bits per second
decimalsnumber1Number of decimal places

Returns

string

Formatted bitrate string

Example

typescript
formatBitrate(128000) // "128 kbps"
formatBitrate(1536000) // "1.5 Mbps"

truncate()

ts
function truncate(
   str, 
   maxLength, 
   ellipsis): string;

Defined in: src/utils/formatters.ts:417

Truncates a string to a maximum length with ellipsis

Parameters

ParameterTypeDefault valueDescription
strstringundefinedString to truncate
maxLengthnumberundefinedMaximum length
ellipsisstring'...'Ellipsis string to append

Returns

string

Truncated string

Example

typescript
truncate('This is a long string', 10) // "This is a..."
truncate('Short', 10) // "Short"

formatCallStatus()

ts
function formatCallStatus(status): string;

Defined in: src/utils/formatters.ts:441

Formats a call status for display

Parameters

ParameterTypeDescription
statusstringCall status

Returns

string

Human-readable status

Example

typescript
formatCallStatus('completed') // "Completed"
formatCallStatus('missed') // "Missed"

formatCallDirection()

ts
function formatCallDirection(direction): string;

Defined in: src/utils/formatters.ts:466

Formats a call direction for display

Parameters

ParameterTypeDescription
directionstringCall direction

Returns

string

Human-readable direction

Example

typescript
formatCallDirection('incoming') // "Incoming"
formatCallDirection('outgoing') // "Outgoing"

createLogger()

ts
function createLogger(namespace): Logger;

Defined in: src/utils/logger.ts:297

Creates a new logger instance

Parameters

ParameterTypeDescription
namespacestringLogger namespace

Returns

Logger

Logger instance

Example

typescript
import { createLogger } from './utils/logger'

const logger = createLogger('MyComponent')
logger.info('Component initialized')

configureLogger()

ts
function configureLogger(config): void;

Defined in: src/utils/logger.ts:317

Configures the global logger

Parameters

ParameterTypeDescription
configPartial<LoggerConfig>Logger configuration

Returns

void

Example

typescript
import { configureLogger } from './utils/logger'

configureLogger({
  level: 'debug',
  enabled: true,
  showTimestamp: true
})

getLoggerConfig()

ts
function getLoggerConfig(): Readonly<LoggerConfig>;

Defined in: src/utils/logger.ts:329

Gets the current logger configuration

Returns

Readonly<LoggerConfig>

Current logger configuration


enableLogging()

ts
function enableLogging(): void;

Defined in: src/utils/logger.ts:336

Enables logging

Returns

void


disableLogging()

ts
function disableLogging(): void;

Defined in: src/utils/logger.ts:343

Disables logging

Returns

void


setLogLevel()

ts
function setLogLevel(level): void;

Defined in: src/utils/logger.ts:358

Sets the minimum log level

Parameters

ParameterTypeDescription
level"error" | "debug" | "info" | "warn"Minimum log level

Returns

void

Example

typescript
setLogLevel('debug') // Show all logs
setLogLevel('error') // Show only errors

getLogLevel()

ts
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()

ts
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

ParameterTypeDescription
handlerLogHandler | undefinedCustom log handler function

Returns

void

Example

typescript
setLogHandler((level, namespace, message, ...args) => {
  // Send to server
  fetch('/api/logs', {
    method: 'POST',
    body: JSON.stringify({ level, namespace, message, args })
  })
})

validateSipUri()

ts
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

ParameterTypeDescription
uristringThe SIP URI to validate

Returns

SimpleValidationResult

Validation result with normalized URI

Example

typescript
const result = validateSipUri('sip:alice@example.com')
if (result.valid) {
  console.log('Normalized URI:', result.normalized)
}

validatePhoneNumber()

ts
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

ParameterTypeDescription
numberstringThe phone number to validate

Returns

SimpleValidationResult

Validation result with normalized number

Example

typescript
const result = validatePhoneNumber('+14155551234')
if (result.valid) {
  console.log('Valid E.164 number:', result.normalized)
}

validateSipConfig()

ts
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

ParameterTypeDescription
configPartial<SipClientConfig>The SIP client configuration to validate

Returns

ValidationResult

Validation result

Example

typescript
const config: SipClientConfig = {
  uri: 'wss://sip.example.com:7443',
  sipUri: 'sip:alice@example.com',
  password: 'secret'
}
const result = validateSipConfig(config)

validateMediaConfig()

ts
function validateMediaConfig(config): ValidationResult;

Defined in: src/utils/validators.ts:333

Validates a media configuration

Checks media constraints and device settings.

Parameters

ParameterTypeDescription
configPartial<MediaConfiguration>The media configuration to validate

Returns

ValidationResult

Validation result

Example

typescript
const config: MediaConfiguration = {
  audio: true,
  video: false,
  echoCancellation: true,
  noiseSuppression: true
}
const result = validateMediaConfig(config)

validateWebSocketUrl()

ts
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

ParameterTypeDescription
urlstringThe WebSocket URL to validate

Returns

SimpleValidationResult

Validation result

Example

typescript
const result = validateWebSocketUrl('wss://sip.example.com:7443')

validateDtmfTone()

ts
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

ParameterTypeDescription
tonestringThe DTMF tone to validate

Returns

SimpleValidationResult

Validation result

Example

typescript
const result = validateDtmfTone('1')

validateDtmfSequence()

ts
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

ParameterTypeDescription
sequencestringThe DTMF sequence to validate

Returns

SimpleValidationResult

Validation result

Example

typescript
const result = validateDtmfSequence('1234*#')

Released under the MIT License.