capacitor-voip-kit
v1.0.0
Published
Capacitor plugin for VoIP apps
Downloads
1
Readme
capacitor-voip-kit
Capacitor plugin for VoIP apps
Install
npm install capacitor-voip-kit
npx cap sync
API
register()
incomingCall(...)
addListener('registration', ...)
addListener('incomingCall', ...)
addListener('callAnswered', ...)
addListener('callStarted', ...)
- Interfaces
- Type Aliases
register()
register() => Promise<{ token: string; }>
Returns: Promise<{ token: string; }>
incomingCall(...)
incomingCall(options: { from: string; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------ |
| options
| { from: string; } |
addListener('registration', ...)
addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ----------------------------------------------------------- |
| eventName
| 'registration' |
| listenerFunc
| (token: Token) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('incomingCall', ...)
addListener(eventName: 'incomingCall', listenerFunc: (token: Token) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ----------------------------------------------------------- |
| eventName
| 'incomingCall' |
| listenerFunc
| (token: Token) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('callAnswered', ...)
addListener(eventName: 'callAnswered', listenerFunc: (callDate: CallData) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| eventName
| 'callAnswered' |
| listenerFunc
| (callDate: CallData) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener('callStarted', ...)
addListener(eventName: 'callStarted', listenerFunc: (callDate: CallData) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| eventName
| 'callStarted' |
| listenerFunc
| (callDate: CallData) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Token
| Prop | Type |
| ----------- | ------------------- |
| token
| string |
CallData
| Prop | Type |
| ------------------ | ------------------- |
| connectionId
| string |
| username
| string |
MessageCallData
| Prop | Type |
| ---------------- | ---------------------- |
| type
| 'message' |
| callbackId
| string |
| pluginId
| string |
| methodName
| string |
| options
| any |
ErrorCallData
| Prop | Type |
| ----------- | ---------------------------------------------------------------------------------------------- |
| type
| 'js.error' |
| error
| { message: string; url: string; line: number; col: number; errorObject: string; } |
Type Aliases
CallData
MessageCallData | ErrorCallData