react-sip-kit 0.2.0 → 0.2.1
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/LICENSE +21 -21
- package/README.md +105 -107
- package/dist/constructors/audioBlobs.d.ts +1 -1
- package/dist/constructors/index.d.ts +0 -1
- package/dist/constructors/line.d.ts +7 -9
- package/dist/hooks/useSessionMethods/index.d.ts +2 -2
- package/dist/index.cjs +1 -19616
- package/dist/index.d.ts +17 -52
- package/dist/index.mjs +1 -19611
- package/dist/store/types.d.ts +15 -50
- package/package.json +98 -98
- package/dist/constructors/buddy.d.ts +0 -26
package/dist/store/types.d.ts
CHANGED
|
@@ -7,13 +7,7 @@ import { IncomingInviteRequest } from 'sip.js/lib/core';
|
|
|
7
7
|
export interface SipStoreStateType {
|
|
8
8
|
configs: SipConfigs;
|
|
9
9
|
userAgent?: SipUserAgent;
|
|
10
|
-
buddies: Array<BuddyType>;
|
|
11
|
-
selectedBuddy: Array<any>;
|
|
12
|
-
selectedLine: Array<any>;
|
|
13
10
|
lines: Array<LineType>;
|
|
14
|
-
newLineNumber: number;
|
|
15
|
-
SipUsername: string;
|
|
16
|
-
SipDomain: string;
|
|
17
11
|
audioBlobs: AudioBlobs['audioBlobs'];
|
|
18
12
|
devicesInfo: DevicesInfoType;
|
|
19
13
|
setSipStore: (state: Partial<SipStoreStateType>) => void;
|
|
@@ -21,13 +15,10 @@ export interface SipStoreStateType {
|
|
|
21
15
|
addLine: (line: LineType) => void;
|
|
22
16
|
updateLine: (line: LineType) => void;
|
|
23
17
|
removeLine: (lineNum: LineType['lineNumber']) => void;
|
|
24
|
-
addBuddy: (buddy: BuddyType) => void;
|
|
25
|
-
findBuddyByDid: (did: string) => BuddyType | null;
|
|
26
|
-
findBuddyByIdentity: (indentity: BuddyType['identity']) => BuddyType | null;
|
|
27
18
|
findLineByNumber: (lineNum: LineType['lineNumber']) => LineType | null;
|
|
28
|
-
getSession: (did: string) => SipSessionType | null;
|
|
29
19
|
getSessions: () => SipUserAgent['sessions'] | null;
|
|
30
|
-
|
|
20
|
+
getNewLineNumber: () => number;
|
|
21
|
+
countIdSessions: (id: string) => number;
|
|
31
22
|
}
|
|
32
23
|
export interface SipInvitationType extends Omit<Invitation, 'incomingInviteRequest' | 'sessionDescriptionHandler'> {
|
|
33
24
|
data: Partial<SipSessionDataType>;
|
|
@@ -49,28 +40,26 @@ export interface SipSessionDescriptionHandler extends SessionDescriptionHandler
|
|
|
49
40
|
peerConnection: RTCPeerConnection;
|
|
50
41
|
peerConnectionDelegate: any;
|
|
51
42
|
}
|
|
52
|
-
export interface LineType {
|
|
43
|
+
export interface LineType<T extends object = object> {
|
|
53
44
|
lineNumber: number;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
IsSelected: boolean;
|
|
57
|
-
BuddyObj: BuddyType | null;
|
|
45
|
+
displayNumber: string;
|
|
46
|
+
metaData: Partial<T>;
|
|
58
47
|
sipSession: SipInvitationType | SipInviterType | null;
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
localSoundMeter: any;
|
|
49
|
+
remoteSoundMeter: any;
|
|
61
50
|
}
|
|
62
51
|
export interface SipSessionType extends Session {
|
|
63
52
|
data: SipSessionDataType;
|
|
64
53
|
}
|
|
65
54
|
export interface SipSessionDataType {
|
|
66
55
|
line: number;
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
callDirection: 'inbound' | 'outbound';
|
|
57
|
+
terminateBy: string;
|
|
69
58
|
src: string;
|
|
70
|
-
|
|
59
|
+
metaData: LineType['metaData'];
|
|
71
60
|
callstart: string;
|
|
72
61
|
earlyReject: boolean;
|
|
73
|
-
|
|
62
|
+
withVideo: boolean;
|
|
74
63
|
reasonCode: number;
|
|
75
64
|
reasonText: string;
|
|
76
65
|
teardownComplete: boolean;
|
|
@@ -88,15 +77,15 @@ export interface SipSessionDataType {
|
|
|
88
77
|
}>;
|
|
89
78
|
isMute: boolean;
|
|
90
79
|
videoChannelNames: Array<Record<'mid' | 'channel', string>>;
|
|
91
|
-
|
|
80
|
+
dialledNumber: string;
|
|
92
81
|
transfer: Array<SipSessionTransferType>;
|
|
93
|
-
|
|
82
|
+
audioSourceTrack: any;
|
|
94
83
|
earlyMedia: any;
|
|
95
84
|
ringerObj: {
|
|
96
85
|
[key: string]: any;
|
|
97
86
|
} | null;
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
confBridgeChannels: Array<any>;
|
|
88
|
+
confBridgeEvents: Array<any>;
|
|
100
89
|
videoSourceDevice: string | null;
|
|
101
90
|
audioSourceDevice: string | null;
|
|
102
91
|
audioOutputDevice: string | null;
|
|
@@ -114,30 +103,6 @@ export interface SipSessionTransferType {
|
|
|
114
103
|
};
|
|
115
104
|
onCancle?: Function;
|
|
116
105
|
}
|
|
117
|
-
export interface BuddyType {
|
|
118
|
-
type: 'extension' | 'xmpp' | 'contact' | 'group';
|
|
119
|
-
identity: string;
|
|
120
|
-
CallerIDName: string;
|
|
121
|
-
ExtNo: string;
|
|
122
|
-
MobileNumber?: string;
|
|
123
|
-
ContactNumber1?: string;
|
|
124
|
-
ContactNumber2?: string;
|
|
125
|
-
lastActivity: string;
|
|
126
|
-
Desc: string;
|
|
127
|
-
Email: string;
|
|
128
|
-
jid?: string;
|
|
129
|
-
devState: string;
|
|
130
|
-
presence: string;
|
|
131
|
-
missed: number;
|
|
132
|
-
IsSelected: boolean;
|
|
133
|
-
imageObjectURL: string;
|
|
134
|
-
presenceText: string;
|
|
135
|
-
EnableDuringDnd: boolean;
|
|
136
|
-
EnableSubscribe: boolean;
|
|
137
|
-
SubscribeUser: string;
|
|
138
|
-
AllowAutoDelete: boolean;
|
|
139
|
-
Pinned: boolean;
|
|
140
|
-
}
|
|
141
106
|
interface DevicesInfoType {
|
|
142
107
|
hasVideoDevice: boolean;
|
|
143
108
|
hasAudioDevice: boolean;
|
package/package.json
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-sip-kit",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "0.2.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"author": {
|
|
7
|
-
"name": "Shervin Ghajar",
|
|
8
|
-
"email": "ssghajar.work@gmail.com"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://github.com/shervin-ghajar/react-sip-kit#readme",
|
|
11
|
-
"keywords": [
|
|
12
|
-
"react",
|
|
13
|
-
"sip",
|
|
14
|
-
"sipjs",
|
|
15
|
-
"jssip",
|
|
16
|
-
"voip",
|
|
17
|
-
"communication",
|
|
18
|
-
"webRTC",
|
|
19
|
-
"telephony",
|
|
20
|
-
"react-hooks",
|
|
21
|
-
"sip.js",
|
|
22
|
-
"react-sip",
|
|
23
|
-
"react-sip-provider",
|
|
24
|
-
"real-time",
|
|
25
|
-
"session-initiation-protocol",
|
|
26
|
-
"frontend",
|
|
27
|
-
"javascript",
|
|
28
|
-
"typescript",
|
|
29
|
-
"npm",
|
|
30
|
-
"library",
|
|
31
|
-
"utility",
|
|
32
|
-
"responsive",
|
|
33
|
-
"design",
|
|
34
|
-
"state-management",
|
|
35
|
-
"zustand"
|
|
36
|
-
],
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "https://github.com/shervin-ghajar/react-sip-kit.git"
|
|
40
|
-
},
|
|
41
|
-
"license": "MIT",
|
|
42
|
-
"main": "dist/index.cjs",
|
|
43
|
-
"module": "dist/index.mjs",
|
|
44
|
-
"types": "dist/index.d.ts",
|
|
45
|
-
"exports": {
|
|
46
|
-
".": {
|
|
47
|
-
"import": "./dist/index.mjs",
|
|
48
|
-
"require": "./dist/index.cjs",
|
|
49
|
-
"types": "./dist/index.d.ts"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"scripts": {
|
|
53
|
-
"build": "rollup -c",
|
|
54
|
-
"lint": "eslint .",
|
|
55
|
-
"format": "prettier --write --cache . --plugin=prettier-plugin-organize-imports"
|
|
56
|
-
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"clone": "^2.1.2",
|
|
59
|
-
"dayjs": "^1.11.13",
|
|
60
|
-
"sip.js": "0.21.2",
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"@
|
|
67
|
-
"
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"@types/
|
|
71
|
-
"@types/react
|
|
72
|
-
"@
|
|
73
|
-
"@typescript-eslint/
|
|
74
|
-
"eslint": "^
|
|
75
|
-
"eslint
|
|
76
|
-
"eslint-
|
|
77
|
-
"eslint-plugin-
|
|
78
|
-
"eslint-plugin-react-
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"rollup": "^
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
},
|
|
90
|
-
"peerDependencies": {
|
|
91
|
-
"react": ">=17.0.0"
|
|
92
|
-
},
|
|
93
|
-
"files": [
|
|
94
|
-
"dist",
|
|
95
|
-
"README.md",
|
|
96
|
-
"LICENSE"
|
|
97
|
-
]
|
|
98
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-sip-kit",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.2.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Shervin Ghajar",
|
|
8
|
+
"email": "ssghajar.work@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/shervin-ghajar/react-sip-kit#readme",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"react",
|
|
13
|
+
"sip",
|
|
14
|
+
"sipjs",
|
|
15
|
+
"jssip",
|
|
16
|
+
"voip",
|
|
17
|
+
"communication",
|
|
18
|
+
"webRTC",
|
|
19
|
+
"telephony",
|
|
20
|
+
"react-hooks",
|
|
21
|
+
"sip.js",
|
|
22
|
+
"react-sip",
|
|
23
|
+
"react-sip-provider",
|
|
24
|
+
"real-time",
|
|
25
|
+
"session-initiation-protocol",
|
|
26
|
+
"frontend",
|
|
27
|
+
"javascript",
|
|
28
|
+
"typescript",
|
|
29
|
+
"npm",
|
|
30
|
+
"library",
|
|
31
|
+
"utility",
|
|
32
|
+
"responsive",
|
|
33
|
+
"design",
|
|
34
|
+
"state-management",
|
|
35
|
+
"zustand"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/shervin-ghajar/react-sip-kit.git"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"main": "dist/index.cjs",
|
|
43
|
+
"module": "dist/index.mjs",
|
|
44
|
+
"types": "dist/index.d.ts",
|
|
45
|
+
"exports": {
|
|
46
|
+
".": {
|
|
47
|
+
"import": "./dist/index.mjs",
|
|
48
|
+
"require": "./dist/index.cjs",
|
|
49
|
+
"types": "./dist/index.d.ts"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "rollup -c",
|
|
54
|
+
"lint": "eslint .",
|
|
55
|
+
"format": "prettier --write --cache . --plugin=prettier-plugin-organize-imports"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"clone": "^2.1.2",
|
|
59
|
+
"dayjs": "^1.11.13",
|
|
60
|
+
"sip.js": "0.21.2",
|
|
61
|
+
"zustand": "^5.0.1"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@eslint/js": "9.13.0",
|
|
65
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
66
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
67
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
68
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
69
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
70
|
+
"@types/clone": "^2.1.4",
|
|
71
|
+
"@types/react": "18.3.12",
|
|
72
|
+
"@types/react-dom": "18.3.1",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.15.0",
|
|
74
|
+
"@typescript-eslint/parser": "^8.15.0",
|
|
75
|
+
"eslint": "^9.15.0",
|
|
76
|
+
"eslint-config-prettier": "^9.1.0",
|
|
77
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
78
|
+
"eslint-plugin-react-hooks": "5.0.0",
|
|
79
|
+
"eslint-plugin-react-refresh": "0.4.14",
|
|
80
|
+
"globals": "15.11.0",
|
|
81
|
+
"prettier": "^3.3.3",
|
|
82
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
83
|
+
"react-dom": "18.3.1",
|
|
84
|
+
"rollup": "^4.41.1",
|
|
85
|
+
"rollup-plugin-delete": "^3.0.1",
|
|
86
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
87
|
+
"typescript": "~5.6.2",
|
|
88
|
+
"typescript-eslint": "8.11.0"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": ">=17.0.0"
|
|
92
|
+
},
|
|
93
|
+
"files": [
|
|
94
|
+
"dist",
|
|
95
|
+
"README.md",
|
|
96
|
+
"LICENSE"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BuddyType } from '../store/types';
|
|
2
|
-
export declare class Buddy implements BuddyType {
|
|
3
|
-
type: 'extension' | 'xmpp' | 'contact' | 'group';
|
|
4
|
-
identity: string;
|
|
5
|
-
CallerIDName: string;
|
|
6
|
-
ExtNo: string;
|
|
7
|
-
MobileNumber?: string;
|
|
8
|
-
ContactNumber1?: string;
|
|
9
|
-
ContactNumber2?: string;
|
|
10
|
-
lastActivity: string;
|
|
11
|
-
Desc: string;
|
|
12
|
-
Email: string;
|
|
13
|
-
jid?: string;
|
|
14
|
-
devState: string;
|
|
15
|
-
presence: string;
|
|
16
|
-
missed: number;
|
|
17
|
-
IsSelected: boolean;
|
|
18
|
-
imageObjectURL: string;
|
|
19
|
-
presenceText: string;
|
|
20
|
-
EnableDuringDnd: boolean;
|
|
21
|
-
EnableSubscribe: boolean;
|
|
22
|
-
SubscribeUser: string;
|
|
23
|
-
AllowAutoDelete: boolean;
|
|
24
|
-
Pinned: boolean;
|
|
25
|
-
constructor(type: 'extension' | 'xmpp' | 'contact' | 'group', identity: string, CallerIDName: string | undefined, ExtNo: string, MobileNumber?: string, ContactNumber1?: string, ContactNumber2?: string, lastActivity?: string, Desc?: string, Email?: string, jid?: string, EnableDuringDnd?: boolean, EnableSubscribe?: boolean, subscription?: string | null, AllowAutoDelete?: boolean, Pinned?: boolean);
|
|
26
|
-
}
|