An open API service indexing awesome lists of open source software.

https://github.com/mozhn/capacitor-callkit-voip


https://github.com/mozhn/capacitor-callkit-voip

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# capacitor-callkit-voip

voip

## Install

```bash
npm install capacitor-callkit-voip
npx cap sync
```

## API

* [`register(...)`](#register)
* [`incomingCall(...)`](#incomingcall)
* [`addListener('registration', ...)`](#addlistenerregistration)
* [`addListener('callAnswered', ...)`](#addlistenercallanswered)
* [`addListener('callStarted', ...)`](#addlistenercallstarted)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

### register(...)

```typescript
register(options: { topic: string; }) => Promise
```

| Param | Type |
| ------------- | ------------------------------- |
| **`options`** | { topic: string; } |

--------------------

### incomingCall(...)

```typescript
incomingCall(options: { from: string; }) => Promise
```

| Param | Type |
| ------------- | ------------------------------ |
| **`options`** | { from: string; } |

--------------------

### addListener('registration', ...)

```typescript
addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => Promise & PluginListenerHandle
```

| Param | Type |
| ------------------ | ----------------------------------------------------------- |
| **`eventName`** | 'registration' |
| **`listenerFunc`** | (token: Token) => void |

**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle

--------------------

### addListener('callAnswered', ...)

```typescript
addListener(eventName: 'callAnswered', listenerFunc: (callDate: CallData) => void) => Promise & PluginListenerHandle
```

| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| **`eventName`** | 'callAnswered' |
| **`listenerFunc`** | (callDate: CallData) => void |

**Returns:** Promise<PluginListenerHandle> & PluginListenerHandle

--------------------

### addListener('callStarted', ...)

```typescript
addListener(eventName: 'callStarted', listenerFunc: (callDate: CallData) => void) => Promise & 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