@tmsoft/webphone 2.0.35 → 2.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -18
- package/dist/lib/types.d.ts +5 -0
- package/dist/src/components/WebPhone.vue.d.ts +3 -0
- package/dist/webphone.component.js +27 -27
- package/dist/webphone.es.js +294 -227
- package/dist/webphone.umd.js +18 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @tmsoft/webphone
|
|
1
|
+
# @tmsoft/webphone
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tmsoft/webphone)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -35,26 +35,30 @@ import { WebPhone } from '@tmsoft/webphone'
|
|
|
35
35
|
|
|
36
36
|
## Props
|
|
37
37
|
|
|
38
|
-
| Prop
|
|
39
|
-
|
|
|
40
|
-
| `host`
|
|
41
|
-
| `wsUrl`
|
|
42
|
-
| `extension` | `string`
|
|
43
|
-
| `password`
|
|
44
|
-
| `mode`
|
|
45
|
-
| `logo`
|
|
46
|
-
| `to`
|
|
47
|
-
| `contacts`
|
|
38
|
+
| Prop | Type | Required | Default | Description |
|
|
39
|
+
| --- | --- | --- | --- | --- |
|
|
40
|
+
| `host` | `string` | No\* | — | SIP server hostname. WebSocket URL: `wss://<host>:8089/asterisk/ws` |
|
|
41
|
+
| `wsUrl` | `string` | No\* | — | Custom WebSocket URL. Takes precedence over `host` |
|
|
42
|
+
| `extension` | `string` | Yes | — | SIP extension |
|
|
43
|
+
| `password` | `string` | Yes | — | SIP password |
|
|
44
|
+
| `mode` | `'webcall' \| 'call' \| 'video'` | No | `'call'` | Operating mode |
|
|
45
|
+
| `logo` | `string` | No | — | Logo URL for `webcall` mode |
|
|
46
|
+
| `to` | `string` | No | — | Auto-dial number for `webcall` mode |
|
|
47
|
+
| `contacts` | `WebPhoneContact[]` | No | `[]` | Contact list |
|
|
48
|
+
| `enablePictureInPicture` | `boolean` | No | `true` | Enables Document Picture-in-Picture |
|
|
49
|
+
| `onAnswer` | `(video: boolean) => void \| Promise<void>` | No | — | Custom handler for answer action (incoming call) |
|
|
50
|
+
| `onHangup` | `() => void \| Promise<void>` | No | — | Custom handler for hangup action |
|
|
51
|
+
| `onReject` | `() => void \| Promise<void>` | No | — | Custom handler for reject action (incoming call) |
|
|
48
52
|
|
|
49
53
|
> \* Either `host` or `wsUrl` must be provided.
|
|
50
54
|
|
|
51
55
|
## Modes
|
|
52
56
|
|
|
53
|
-
| Mode
|
|
54
|
-
|
|
|
55
|
-
| `call`
|
|
56
|
-
| `video`
|
|
57
|
-
| `webcall` | Click-to-call widget. Requires `to` and `logo`
|
|
57
|
+
| Mode | Description |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `call` | Standard softphone with keypad and call history |
|
|
60
|
+
| `video` | Softphone with video support |
|
|
61
|
+
| `webcall` | Click-to-call widget. Requires `to` and `logo` |
|
|
58
62
|
|
|
59
63
|
## Types
|
|
60
64
|
|
|
@@ -66,10 +70,14 @@ interface WebPhoneContact {
|
|
|
66
70
|
}
|
|
67
71
|
```
|
|
68
72
|
|
|
73
|
+
### Action handlers
|
|
74
|
+
|
|
75
|
+
If `onAnswer`, `onHangup` or `onReject` are provided, the component will call those props instead of executing the internal SIP action for that button.
|
|
76
|
+
|
|
69
77
|
## Events
|
|
70
78
|
|
|
71
|
-
| Event
|
|
72
|
-
|
|
|
79
|
+
| Event | Description |
|
|
80
|
+
| --- | --- |
|
|
73
81
|
| `back` | Back button pressed |
|
|
74
82
|
|
|
75
83
|
## License
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -5,12 +5,17 @@ export interface WebPhoneContact {
|
|
|
5
5
|
}
|
|
6
6
|
export interface WebPhoneProps {
|
|
7
7
|
host?: string;
|
|
8
|
+
wsUrl?: string;
|
|
8
9
|
extension?: string;
|
|
9
10
|
password?: string;
|
|
10
11
|
to?: string;
|
|
11
12
|
mode?: 'webcall' | 'call' | 'video';
|
|
12
13
|
logo?: string;
|
|
13
14
|
contacts?: WebPhoneContact[];
|
|
15
|
+
enablePictureInPicture?: boolean;
|
|
16
|
+
onAnswer?: (video: boolean) => void | Promise<void>;
|
|
17
|
+
onHangup?: () => void | Promise<void>;
|
|
18
|
+
onReject?: () => void | Promise<void>;
|
|
14
19
|
}
|
|
15
20
|
export interface WebPhoneEmits {
|
|
16
21
|
back: () => void;
|
|
@@ -17,6 +17,9 @@ type __VLS_Props = {
|
|
|
17
17
|
}[];
|
|
18
18
|
position?: WebPhonePosition;
|
|
19
19
|
enablePictureInPicture?: boolean;
|
|
20
|
+
onAnswer?: (video: boolean) => void | Promise<void>;
|
|
21
|
+
onHangup?: () => void | Promise<void>;
|
|
22
|
+
onReject?: () => void | Promise<void>;
|
|
20
23
|
};
|
|
21
24
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
22
25
|
contacts: {
|