react-sip-kit 0.7.1 → 0.7.3

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/dist/manager.d.ts CHANGED
@@ -51,19 +51,19 @@ export declare class SipManager {
51
51
  receiveSession: (invitation: import("./store/types").SipInvitationType) => void;
52
52
  answerAudioSession: (lineKey: LineType["lineKey"]) => void;
53
53
  answerVideoSession: (lineKey: LineType["lineKey"], enableVideo?: boolean) => void;
54
- makeAudioSession: (lineObj: LineType, dialledNumber: string, extraHeaders?: Array<string>) => void;
55
- makeVideoSession: (lineObj: LineType, dialledNumber: string, extraHeaders?: Array<string>) => void;
54
+ makeAudioSession: (lineObj: LineType, dialledNumber: string, request?: import(".").DialRequestDelegate, extraHeaders?: Array<string>) => import(".").DialRequestDelegate | undefined;
55
+ makeVideoSession: (lineObj: LineType, dialledNumber: string, request?: import(".").DialRequestDelegate, extraHeaders?: Array<string>) => void;
56
56
  toggleLocalVideoTrack: (lineKey: LineType["lineKey"]) => Promise<void>;
57
57
  toggleShareScreen: (lineKey: LineType["lineKey"]) => Promise<void>;
58
58
  rejectSession: (lineKey: LineType["lineKey"]) => void;
59
- dialByNumber: (type: Extract<import("./types").CallType, "audio" | "video">, dialNumber: string, extraHeaders?: Array<string>) => void;
59
+ dialByNumber: (type: Extract<import("./types").CallType, "audio" | "video">, dialNumber: string, request?: import(".").DialRequestDelegate, extraHeaders?: Array<string>) => void;
60
60
  endSession: (lineKey: LineType["lineKey"]) => void;
61
61
  recordSession: (lineKey: LineType["lineKey"]) => {
62
62
  start: () => Promise<void>;
63
63
  stop: () => void;
64
64
  };
65
65
  toggleMuteSession: (lineKey: LineType["lineKey"]) => void;
66
- toggleHoldSession: (lineKey: LineType["lineKey"], forcedValue?: boolean) => void;
66
+ toggleHoldSession: (lineKey: LineType["lineKey"], forcedValue?: boolean) => Promise<void>;
67
67
  makeTransferSession: (lineKey: LineType["lineKey"], transferNumber: LineType["lineKey"]) => void;
68
68
  cancelTransferSession: (lineKey: LineType["lineKey"], transferNumber: LineType["lineKey"]) => void;
69
69
  cancelSession: (lineKey: LineType["lineKey"]) => void;
@@ -1,26 +1,26 @@
1
1
  import { SipConfigs } from '../../configs/types';
2
2
  import { LineType, SipInvitationType } from '../../store/types';
3
3
  import { CallType } from '../../types';
4
- import { SendMessageSessionEnum, SendMessageSessionValueType } from './types';
4
+ import { DialRequestDelegate, SendMessageSessionEnum, SendMessageSessionValueType } from './types';
5
5
  export declare const sessionMethods: ({ configKey }: {
6
6
  configKey: SipConfigs["key"];
7
7
  }) => {
8
8
  receiveSession: (invitation: SipInvitationType) => void;
9
9
  answerAudioSession: (lineKey: LineType["lineKey"]) => void;
10
10
  answerVideoSession: (lineKey: LineType["lineKey"], enableVideo?: boolean) => void;
11
- makeAudioSession: (lineObj: LineType, dialledNumber: string, extraHeaders?: Array<string>) => void;
12
- makeVideoSession: (lineObj: LineType, dialledNumber: string, extraHeaders?: Array<string>) => void;
11
+ makeAudioSession: (lineObj: LineType, dialledNumber: string, request?: DialRequestDelegate, extraHeaders?: Array<string>) => DialRequestDelegate | undefined;
12
+ makeVideoSession: (lineObj: LineType, dialledNumber: string, request?: DialRequestDelegate, extraHeaders?: Array<string>) => void;
13
13
  toggleLocalVideoTrack: (lineKey: LineType["lineKey"]) => Promise<void>;
14
14
  toggleShareScreen: (lineKey: LineType["lineKey"]) => Promise<void>;
15
15
  rejectSession: (lineKey: LineType["lineKey"]) => void;
16
- dialByNumber: (type: Extract<CallType, "audio" | "video">, dialNumber: string, extraHeaders?: Array<string>) => void;
16
+ dialByNumber: (type: Extract<CallType, "audio" | "video">, dialNumber: string, request?: DialRequestDelegate, extraHeaders?: Array<string>) => void;
17
17
  endSession: (lineKey: LineType["lineKey"]) => void;
18
18
  recordSession: (lineKey: LineType["lineKey"]) => {
19
19
  start: () => Promise<void>;
20
20
  stop: () => void;
21
21
  };
22
22
  toggleMuteSession: (lineKey: LineType["lineKey"]) => void;
23
- toggleHoldSession: (lineKey: LineType["lineKey"], forcedValue?: boolean) => void;
23
+ toggleHoldSession: (lineKey: LineType["lineKey"], forcedValue?: boolean) => Promise<void>;
24
24
  makeTransferSession: (lineKey: LineType["lineKey"], transferNumber: LineType["lineKey"]) => void;
25
25
  cancelTransferSession: (lineKey: LineType["lineKey"], transferNumber: LineType["lineKey"]) => void;
26
26
  cancelSession: (lineKey: LineType["lineKey"]) => void;
@@ -1,4 +1,6 @@
1
+ import { IncomingResponse } from 'sip.js/lib/core';
1
2
  import { sessionMethods } from '.';
3
+ import { LineType } from '../../store/types';
2
4
  export declare enum SendMessageSessionEnum {
3
5
  'SOUND_TOGGLE' = "SOUND_TOGGLE",
4
6
  'VIDEO_TOGGLE' = "VIDEO_TOGGLE",
@@ -45,3 +47,11 @@ export type SPDOptionsType = Record<'sessionDescriptionHandlerOptions', SessionD
45
47
  extraHeaders: string[];
46
48
  }>;
47
49
  export type SessionMethods = ReturnType<typeof sessionMethods>;
50
+ export type DialRequestDelegate = {
51
+ onAccept?: (lineKey: LineType['lineKey'], response: DialResponse) => void;
52
+ onProgress?: (lineKey: LineType['lineKey'], response: DialResponse) => void;
53
+ onRedirect?: (lineKey: LineType['lineKey'], response: DialResponse) => void;
54
+ onReject?: (lineKey: LineType['lineKey'], response: DialResponse) => void;
55
+ onTrying?: (lineKey: LineType['lineKey'], response: DialResponse) => void;
56
+ };
57
+ export type DialResponse = IncomingResponse;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-sip-kit",
3
3
  "private": false,
4
- "version": "0.7.1",
4
+ "version": "0.7.3",
5
5
  "type": "module",
6
6
  "author": {
7
7
  "name": "Shervin Ghajar",
@@ -1,16 +0,0 @@
1
- export declare enum SendMessageSessionEnum {
2
- 'SOUND_TOGGLE' = "SOUND_TOGGLE",
3
- 'VIDEO_TOGGLE' = "VIDEO_TOGGLE",
4
- 'SCREEN_SHARE_TOGGLE' = "SCREEN_SHARE_TOGGLE",
5
- 'VIDEO_TOGGLE_ACK' = "VIDEO_TOGGLE_ACK"
6
- }
7
- export type SendMessageSessionValueType = {
8
- [SendMessageSessionEnum.SOUND_TOGGLE]: boolean;
9
- [SendMessageSessionEnum.VIDEO_TOGGLE]: boolean;
10
- [SendMessageSessionEnum.SCREEN_SHARE_TOGGLE]: boolean;
11
- [SendMessageSessionEnum.VIDEO_TOGGLE_ACK]: null | undefined | '';
12
- };
13
- export type SendMessageRequestBody<T extends SendMessageSessionEnum = SendMessageSessionEnum.SOUND_TOGGLE> = {
14
- type: T;
15
- value: SendMessageSessionValueType[T];
16
- };