ue-softphone-sdk 1.2.0 → 2.0.0
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/index.d.ts +36 -108
- package/dist/ue-softphone-sdk.js +1 -1
- package/package.json +3 -3
- package/src/index.ts +1947 -1788
- package/src/webrtc.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**package.json 版本号 */
|
|
2
2
|
export declare const ueSdkVersion: any;
|
|
3
|
-
type DebugType =
|
|
4
|
-
type ExtenType =
|
|
3
|
+
type DebugType = "trace" | "debug" | "log" | "warn" | "error" | "all";
|
|
4
|
+
type ExtenType = "PSTN" | "SIP" | "WEBRTC";
|
|
5
5
|
interface AudioInfo {
|
|
6
6
|
notOpenAudioMsg: string;
|
|
7
7
|
notOpenAudioCode: number;
|
|
@@ -11,22 +11,21 @@ interface AudioInfo {
|
|
|
11
11
|
forbiddenAudioMsgEn: string;
|
|
12
12
|
}
|
|
13
13
|
interface InitOptions {
|
|
14
|
-
debug?: DebugType | DebugType[] | boolean;
|
|
15
|
-
dependencies?: any;
|
|
16
14
|
accountId?: string;
|
|
17
15
|
agentNumber?: string;
|
|
18
|
-
loginType?: ExtenType;
|
|
19
16
|
password?: string;
|
|
20
|
-
|
|
17
|
+
loginType?: ExtenType;
|
|
18
|
+
debug?: DebugType | DebugType[] | boolean;
|
|
21
19
|
success?: Function;
|
|
20
|
+
error?: Function;
|
|
22
21
|
server?: string;
|
|
23
|
-
loginStatus?: string;
|
|
24
|
-
signAuth?: any;
|
|
25
|
-
hasMonitor?: boolean;
|
|
26
|
-
sdkMonitorType?: any;
|
|
27
|
-
isStrongHint?: Boolean;
|
|
28
22
|
audioInfo?: AudioInfo;
|
|
29
23
|
}
|
|
24
|
+
interface OnCallEventParams {
|
|
25
|
+
success?: Function;
|
|
26
|
+
message?: Function;
|
|
27
|
+
error?: Function;
|
|
28
|
+
}
|
|
30
29
|
interface DialoutParams {
|
|
31
30
|
agentNumber?: String;
|
|
32
31
|
accountId: String;
|
|
@@ -38,13 +37,8 @@ interface DialoutParams {
|
|
|
38
37
|
agentDisNumber?: String;
|
|
39
38
|
customerDisNumber?: String;
|
|
40
39
|
extras?: any;
|
|
41
|
-
group?: string;
|
|
42
|
-
groupRule?: Number;
|
|
43
|
-
groupareaCode?: String;
|
|
44
40
|
success?: Function;
|
|
45
41
|
fail?: Function;
|
|
46
|
-
encryptionAlgorithm?: String;
|
|
47
|
-
encryptionFields?: String;
|
|
48
42
|
}
|
|
49
43
|
interface HangupParams {
|
|
50
44
|
success?: Function;
|
|
@@ -73,7 +67,6 @@ interface UpdateLoginTypeParams {
|
|
|
73
67
|
loginNumber?: String;
|
|
74
68
|
success?: Function;
|
|
75
69
|
fail?: Function;
|
|
76
|
-
isStrongHint?: Boolean;
|
|
77
70
|
}
|
|
78
71
|
interface GetAgentPhoneBarParams {
|
|
79
72
|
success?: Function;
|
|
@@ -83,18 +76,13 @@ interface GetQueueOnlineAgentsParams {
|
|
|
83
76
|
success?: Function;
|
|
84
77
|
fail?: Function;
|
|
85
78
|
}
|
|
86
|
-
interface getIvrListParams {
|
|
87
|
-
success?: Function;
|
|
88
|
-
fail?: Function;
|
|
89
|
-
types: string[];
|
|
90
|
-
}
|
|
91
79
|
interface AgentOfflineParams {
|
|
92
80
|
success?: Function;
|
|
93
81
|
fail?: Function;
|
|
94
82
|
toAnswerOffline?: String;
|
|
95
83
|
}
|
|
96
84
|
interface UpdateAgentStatusParams {
|
|
97
|
-
|
|
85
|
+
stateNumber: String;
|
|
98
86
|
success?: Function;
|
|
99
87
|
fail?: Function;
|
|
100
88
|
}
|
|
@@ -139,45 +127,7 @@ interface meetingParams {
|
|
|
139
127
|
success?: Function;
|
|
140
128
|
fail?: Function;
|
|
141
129
|
}
|
|
142
|
-
interface listenParams {
|
|
143
|
-
agentNumber: String;
|
|
144
|
-
success?: Function;
|
|
145
|
-
fail?: Function;
|
|
146
|
-
}
|
|
147
|
-
interface lootParams {
|
|
148
|
-
agentNumber: String;
|
|
149
|
-
success?: Function;
|
|
150
|
-
fail?: Function;
|
|
151
|
-
}
|
|
152
|
-
interface whisperParams {
|
|
153
|
-
agentNumber: String;
|
|
154
|
-
success?: Function;
|
|
155
|
-
fail?: Function;
|
|
156
|
-
}
|
|
157
|
-
interface forcedHangupParams {
|
|
158
|
-
agentNumber: String;
|
|
159
|
-
success?: Function;
|
|
160
|
-
fail?: Function;
|
|
161
|
-
}
|
|
162
|
-
interface signinParams {
|
|
163
|
-
agentNumber: String;
|
|
164
|
-
loginType: String;
|
|
165
|
-
success?: Function;
|
|
166
|
-
fail?: Function;
|
|
167
|
-
}
|
|
168
|
-
interface signoutParams {
|
|
169
|
-
agentNumber: String;
|
|
170
|
-
success?: Function;
|
|
171
|
-
fail?: Function;
|
|
172
|
-
}
|
|
173
|
-
interface breakinParams {
|
|
174
|
-
agentNumber: String;
|
|
175
|
-
success?: Function;
|
|
176
|
-
fail?: Function;
|
|
177
|
-
}
|
|
178
130
|
export default class ueSoftphone {
|
|
179
|
-
private attachEventCallbacks;
|
|
180
|
-
private attachMonitorEventCallbacks;
|
|
181
131
|
static ueTimer: any;
|
|
182
132
|
static loginToken: String | undefined;
|
|
183
133
|
static agentInfo: any;
|
|
@@ -186,81 +136,59 @@ export default class ueSoftphone {
|
|
|
186
136
|
static callApiUrl: String;
|
|
187
137
|
static agentextras: any;
|
|
188
138
|
static Socketinstance: any;
|
|
189
|
-
static MonitorSocketinstance: any;
|
|
190
|
-
constructor(options?: InitOptions);
|
|
191
|
-
private init;
|
|
192
|
-
static createMonitorEventHandle(callbacks?: any): void;
|
|
193
|
-
static createEventHandle(callbacks?: any): void;
|
|
194
|
-
private login;
|
|
195
139
|
static noop(): void;
|
|
196
|
-
static debug: (
|
|
197
|
-
static log: (
|
|
198
|
-
static warn: (
|
|
199
|
-
static error: (
|
|
200
|
-
static trace: (
|
|
140
|
+
static debug: (msg: any) => void;
|
|
141
|
+
static log: (msg: any) => void;
|
|
142
|
+
static warn: (msg: any) => void;
|
|
143
|
+
static error: (msg: any) => void;
|
|
144
|
+
static trace: (msg: any) => void;
|
|
201
145
|
static newWebSocket: (server: string, proto: any) => any;
|
|
202
146
|
static request: (server: string, proto: any) => any;
|
|
147
|
+
private attachEventCallbacks;
|
|
148
|
+
constructor(options?: InitOptions);
|
|
149
|
+
private init;
|
|
150
|
+
private login;
|
|
151
|
+
static createEventHandle(callbacks?: any): void;
|
|
203
152
|
private getWebrtcInfo;
|
|
204
|
-
private initMonitorAttachEvent;
|
|
205
153
|
private initAttachEvent;
|
|
206
|
-
private static initWebrtcEvent;
|
|
207
|
-
private openMediaAudio;
|
|
208
|
-
attachEvent: (callbacks: any) => void;
|
|
209
|
-
attachMonitorEvent: (callbacks: any) => void;
|
|
210
154
|
static useDefaultDependencies(deps: any): {
|
|
211
155
|
newWebSocket(server: string, proto: any): any;
|
|
212
156
|
request(url: string, options: any): any;
|
|
213
157
|
};
|
|
214
|
-
|
|
215
|
-
|
|
158
|
+
private static initWebrtcEvent;
|
|
159
|
+
private openMediaAudio;
|
|
160
|
+
listenCallEvent: (callbacks: OnCallEventParams) => void;
|
|
161
|
+
get agent(): {
|
|
162
|
+
switchLoginType(params: UpdateLoginTypeParams): Promise<void>;
|
|
163
|
+
findPhoneBarList(params: GetAgentPhoneBarParams): void;
|
|
164
|
+
switchPhoneBar(params: UpdateAgentStatusParams): void;
|
|
165
|
+
logout(params: AgentOfflineParams): void;
|
|
166
|
+
findIdleAgentsForQueue(params: GetQueueOnlineAgentsParams): void;
|
|
216
167
|
getAvailableSipNumberList(params: any): void;
|
|
217
|
-
getAgentPhoneBarList(params: GetAgentPhoneBarParams): void;
|
|
218
|
-
updateAgentStatus(params: UpdateAgentStatusParams): void;
|
|
219
|
-
offline(params: AgentOfflineParams): void;
|
|
220
|
-
setAnswerOffline(params: AgentOfflineParams): void;
|
|
221
|
-
getQueueOnlineAgents(params: GetQueueOnlineAgentsParams): void;
|
|
222
|
-
getIvrList(params: getIvrListParams): void;
|
|
223
|
-
};
|
|
224
|
-
get monitorApi(): {
|
|
225
|
-
listen(params: listenParams): void;
|
|
226
|
-
loot(params: lootParams): void;
|
|
227
|
-
whisper(params: whisperParams): void;
|
|
228
|
-
breakin(params: breakinParams): void;
|
|
229
|
-
forcedHangup(params: forcedHangupParams): void;
|
|
230
|
-
signin(params: signinParams): void;
|
|
231
|
-
signout(params: signoutParams): void;
|
|
232
168
|
};
|
|
233
|
-
get
|
|
169
|
+
get webrtc(): {
|
|
234
170
|
accept(): void;
|
|
235
171
|
connect(): void;
|
|
236
172
|
disconnect(): void;
|
|
237
173
|
isConnected(): boolean;
|
|
238
174
|
sendDTMF(tone: string): void;
|
|
239
175
|
};
|
|
240
|
-
get
|
|
241
|
-
|
|
176
|
+
get call(): {
|
|
177
|
+
callout(params: DialoutParams): Promise<void>;
|
|
242
178
|
hangup(params: HangupParams): void;
|
|
243
179
|
holdOrUnHold(params: HoldOrUnHoldParams): void;
|
|
244
180
|
muteOrUnMute(params: MuteOrUnMuteParams): void;
|
|
245
181
|
transfer(params: TransferParams): void;
|
|
246
182
|
consult(params: consultParams): void;
|
|
247
183
|
cancelconsult(params: cancleConsultParams): void;
|
|
248
|
-
|
|
249
|
-
|
|
184
|
+
endConsult(params: stopConsultParams): void;
|
|
185
|
+
callbackConsult(params: resumeConsultParams): void;
|
|
250
186
|
consultTransfer(params: consultTransferParams): void;
|
|
251
187
|
threeWayCall(params: threeWayCallParams): void;
|
|
252
|
-
|
|
188
|
+
evaluate(params: satisfactionParams): void;
|
|
253
189
|
meeting(params: meetingParams): void;
|
|
254
|
-
listen(params: listenParams): void;
|
|
255
|
-
loot(params: lootParams): void;
|
|
256
|
-
whisper(params: whisperParams): void;
|
|
257
|
-
breakin(params: breakinParams): void;
|
|
258
|
-
forcedHangup(params: forcedHangupParams): void;
|
|
259
|
-
signin(params: signinParams): void;
|
|
260
|
-
signout(params: signoutParams): void;
|
|
261
190
|
};
|
|
262
191
|
private _callApi;
|
|
263
|
-
private _monitorApi;
|
|
264
192
|
private _agentApi;
|
|
265
193
|
_webPhoneApi: () => {
|
|
266
194
|
accept(): void;
|