@tmsoft/webphone 2.0.34 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- # @tmsoft/webphone
1
+ # @tmsoft/webphone
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@tmsoft/webphone.svg)](https://www.npmjs.com/package/@tmsoft/webphone)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -35,26 +35,30 @@ import { WebPhone } from '@tmsoft/webphone'
35
35
 
36
36
  ## Props
37
37
 
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 |
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 | Description |
54
- | --------- | ----------------------------------------------- |
55
- | `call` | Standard softphone with keypad and call history |
56
- | `video` | Softphone with video support |
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 | Description |
72
- | ------ | ------------------- |
79
+ | Event | Description |
80
+ | --- | --- |
73
81
  | `back` | Back button pressed |
74
82
 
75
83
  ## License
@@ -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;
@@ -16,6 +16,10 @@ type __VLS_Props = {
16
16
  type?: 'tool' | 'extension' | 'contact' | 'voicemail';
17
17
  }[];
18
18
  position?: WebPhonePosition;
19
+ enablePictureInPicture?: boolean;
20
+ onAnswer?: (video: boolean) => void | Promise<void>;
21
+ onHangup?: () => void | Promise<void>;
22
+ onReject?: () => void | Promise<void>;
19
23
  };
20
24
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
21
25
  contacts: {
@@ -25,6 +29,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
25
29
  }[];
26
30
  mode: "webcall" | "call" | "video";
27
31
  position: WebPhonePosition;
32
+ enablePictureInPicture: boolean;
28
33
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
29
34
  phoneRef: HTMLDivElement;
30
35
  remoteVideoRef: HTMLVideoElement;