ue-softphone-sdk-beta 3.0.16
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/.babelrc +12 -0
- package/.gitlab-ci.yml +3 -0
- package/Dockerfile +21 -0
- package/README.md +8 -0
- package/dist/lib/types/config.d.ts +11 -0
- package/dist/lib/types/index.d.ts +220 -0
- package/dist/lib/ue-soft-phone.min.js +22 -0
- package/dist/types/config.d.ts +11 -0
- package/dist/types/index.d.ts +220 -0
- package/dist/ue-softphone-sdk.js +7 -0
- package/index.html/index.html +104 -0
- package/nginx.conf +56 -0
- package/package.json +36 -0
- package/rollup-new.config.mjs +20 -0
- package/rollup.config.js +45 -0
- package/sdkdemo/hangup.wav +0 -0
- package/sdkdemo/img/wifi1.b7af5ed5.svg +10 -0
- package/sdkdemo/img/wifi2.1648a543.svg +4 -0
- package/sdkdemo/img/wifi3.ec030889.svg +4 -0
- package/sdkdemo/img/wifi4.101d572a.svg +4 -0
- package/sdkdemo/ring.wav +0 -0
- package/sdkdemo/ue-load.min.js +119 -0
- package/sdkdemo/ue.global.js +15361 -0
- package/sdkdemo/ue.lib.css +1 -0
- package/sdkdemo/ue.min.js +49 -0
- package/sdkdemo/webphone_ez.html +60 -0
- package/src/config.ts +19 -0
- package/src/index.ts +2407 -0
- package/src/lib/socket.io.esm.min.js +7 -0
- package/tsconfig.json +21 -0
package/.babelrc
ADDED
package/.gitlab-ci.yml
ADDED
package/Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
FROM ue-test.harbor.useasy.net/base/node:14.20.0-pm2-adduser as ue-builder
|
|
2
|
+
ENV NODE_OPTIONS=--max_old_space_size=4096
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
COPY package.json .
|
|
5
|
+
RUN npm install
|
|
6
|
+
COPY . .
|
|
7
|
+
RUN npm run build
|
|
8
|
+
RUN npm publish
|
|
9
|
+
RUN npm run build:js
|
|
10
|
+
|
|
11
|
+
FROM nginx:1.16.0
|
|
12
|
+
COPY nginx.conf /etc/nginx/nginx.conf
|
|
13
|
+
COPY --from=ue-builder /app/dist /usr/share/nginx/html
|
|
14
|
+
COPY sdkdemo/ue.global.js /usr/share/nginx/html/
|
|
15
|
+
COPY sdkdemo/ue-load.min.js /usr/share/nginx/html/
|
|
16
|
+
COPY sdkdemo/ue.lib.css /usr/share/nginx/html/
|
|
17
|
+
COPY sdkdemo/ue.min.js /usr/share/nginx/html/
|
|
18
|
+
COPY sdkdemo/ring.wav /usr/share/nginx/html/
|
|
19
|
+
COPY sdkdemo/hangup.wav /usr/share/nginx/html/
|
|
20
|
+
EXPOSE 3000
|
|
21
|
+
RUN echo 'echo init ok!!'
|
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const NOT_OPEN_AUDIO: {
|
|
2
|
+
notOpenAudioMsg: string;
|
|
3
|
+
notOpenAudioCode: number;
|
|
4
|
+
notOpenAudioMsgEn: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const AUDIO_FORBIDDEN: {
|
|
7
|
+
forbiddenAudioMsg: string;
|
|
8
|
+
forbiddenAudioCode: number;
|
|
9
|
+
forbiddenAudioMsgEn: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const DENIED = "denied";
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
type DebugType = "trace" | "debug" | "log" | "warn" | "error" | "all";
|
|
2
|
+
type ExtenType = "PSTN" | "SIP" | "WEBRTC";
|
|
3
|
+
interface AudioInfo {
|
|
4
|
+
notOpenAudioMsg: string;
|
|
5
|
+
notOpenAudioCode: number;
|
|
6
|
+
notOpenAudioMsgEn: string;
|
|
7
|
+
forbiddenAudioMsg: string;
|
|
8
|
+
forbiddenAudioCode: number;
|
|
9
|
+
forbiddenAudioMsgEn: string;
|
|
10
|
+
}
|
|
11
|
+
interface InitOptions {
|
|
12
|
+
accountId?: string;
|
|
13
|
+
agentNumber?: string;
|
|
14
|
+
password?: string;
|
|
15
|
+
loginType?: ExtenType;
|
|
16
|
+
debug?: DebugType | DebugType[] | boolean;
|
|
17
|
+
success?: Function;
|
|
18
|
+
error?: Function;
|
|
19
|
+
server?: string;
|
|
20
|
+
audioInfo?: AudioInfo;
|
|
21
|
+
isOpenNetwork?: boolean;
|
|
22
|
+
pushHangupStatistics?: boolean;
|
|
23
|
+
pushCallinRingStatistics?: boolean;
|
|
24
|
+
isOpenCallQueue?: boolean;
|
|
25
|
+
openNlsTranslation?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface OnCallEventParams {
|
|
28
|
+
success?: Function;
|
|
29
|
+
message?: Function;
|
|
30
|
+
error?: Function;
|
|
31
|
+
event?: Function;
|
|
32
|
+
}
|
|
33
|
+
interface DialoutParams {
|
|
34
|
+
agentNumber?: String;
|
|
35
|
+
accountId: String;
|
|
36
|
+
agentId: String;
|
|
37
|
+
loginType?: String;
|
|
38
|
+
customerNumber: String;
|
|
39
|
+
agentTimeout?: String;
|
|
40
|
+
customerTimeout?: String;
|
|
41
|
+
agentDisNumber?: String;
|
|
42
|
+
customerDisNumber?: String;
|
|
43
|
+
extras?: any;
|
|
44
|
+
success?: Function;
|
|
45
|
+
fail?: Function;
|
|
46
|
+
numberGroupId?: String;
|
|
47
|
+
numberGroupName?: String;
|
|
48
|
+
}
|
|
49
|
+
interface HangupParams {
|
|
50
|
+
success?: Function;
|
|
51
|
+
fail?: Function;
|
|
52
|
+
}
|
|
53
|
+
interface HoldOrUnHoldParams {
|
|
54
|
+
type: String;
|
|
55
|
+
success?: Function;
|
|
56
|
+
fail?: Function;
|
|
57
|
+
}
|
|
58
|
+
interface MuteOrUnMuteParams {
|
|
59
|
+
type: String;
|
|
60
|
+
direction: String;
|
|
61
|
+
success?: Function;
|
|
62
|
+
fail?: Function;
|
|
63
|
+
}
|
|
64
|
+
interface TransferParams {
|
|
65
|
+
type: String;
|
|
66
|
+
number: String;
|
|
67
|
+
agentNumber?: String;
|
|
68
|
+
success?: Function;
|
|
69
|
+
fail?: Function;
|
|
70
|
+
}
|
|
71
|
+
interface UpdateLoginTypeParams {
|
|
72
|
+
loginType: ExtenType;
|
|
73
|
+
loginNumber?: String;
|
|
74
|
+
success?: Function;
|
|
75
|
+
fail?: Function;
|
|
76
|
+
}
|
|
77
|
+
interface GetAgentPhoneBarParams {
|
|
78
|
+
success?: Function;
|
|
79
|
+
fail?: Function;
|
|
80
|
+
}
|
|
81
|
+
interface GetQueueOnlineAgentsParams {
|
|
82
|
+
success?: Function;
|
|
83
|
+
fail?: Function;
|
|
84
|
+
}
|
|
85
|
+
interface AgentOfflineParams {
|
|
86
|
+
success?: Function;
|
|
87
|
+
fail?: Function;
|
|
88
|
+
toAnswerOffline?: String;
|
|
89
|
+
}
|
|
90
|
+
interface UpdateAgentStatusParams {
|
|
91
|
+
stateNumber: String;
|
|
92
|
+
success?: Function;
|
|
93
|
+
fail?: Function;
|
|
94
|
+
}
|
|
95
|
+
interface consultParams {
|
|
96
|
+
mode: String;
|
|
97
|
+
number: String;
|
|
98
|
+
agentNumber: String;
|
|
99
|
+
success?: Function;
|
|
100
|
+
fail?: Function;
|
|
101
|
+
}
|
|
102
|
+
interface cancleConsultParams {
|
|
103
|
+
success?: Function;
|
|
104
|
+
fail?: Function;
|
|
105
|
+
}
|
|
106
|
+
interface stopConsultParams {
|
|
107
|
+
success?: Function;
|
|
108
|
+
fail?: Function;
|
|
109
|
+
}
|
|
110
|
+
interface resumeConsultParams {
|
|
111
|
+
success?: Function;
|
|
112
|
+
fail?: Function;
|
|
113
|
+
}
|
|
114
|
+
interface consultTransferParams {
|
|
115
|
+
success?: Function;
|
|
116
|
+
fail?: Function;
|
|
117
|
+
}
|
|
118
|
+
interface threeWayCallParams {
|
|
119
|
+
success?: Function;
|
|
120
|
+
fail?: Function;
|
|
121
|
+
}
|
|
122
|
+
interface satisfactionParams {
|
|
123
|
+
type: String;
|
|
124
|
+
success?: Function;
|
|
125
|
+
fail?: Function;
|
|
126
|
+
}
|
|
127
|
+
interface meetingParams {
|
|
128
|
+
number: String;
|
|
129
|
+
success?: Function;
|
|
130
|
+
fail?: Function;
|
|
131
|
+
}
|
|
132
|
+
export default class ueSoftphone {
|
|
133
|
+
static ueTimer: any;
|
|
134
|
+
static loginToken: String | undefined;
|
|
135
|
+
static agentInfo: any;
|
|
136
|
+
static initOptions: InitOptions;
|
|
137
|
+
static webPhone: any;
|
|
138
|
+
static callApiUrl: String;
|
|
139
|
+
static agentextras: any;
|
|
140
|
+
static Socketinstance: any;
|
|
141
|
+
static AudioTask: any;
|
|
142
|
+
static MonitorSocketinstance: any;
|
|
143
|
+
static UserConfig: any;
|
|
144
|
+
static noop(): void;
|
|
145
|
+
static debug: (msg: any) => void;
|
|
146
|
+
static log: (msg: any) => void;
|
|
147
|
+
static warn: (msg: any) => void;
|
|
148
|
+
static error: (msg: any) => void;
|
|
149
|
+
static trace: (msg: any) => void;
|
|
150
|
+
static newWebSocket: (server: string, proto: any) => any;
|
|
151
|
+
static request: (server: string, proto: any) => any;
|
|
152
|
+
private attachEventCallbacks;
|
|
153
|
+
private attachMonitorEventCallbacks;
|
|
154
|
+
private attachNlsTranslationEventCallbacks;
|
|
155
|
+
constructor(options?: InitOptions);
|
|
156
|
+
private init;
|
|
157
|
+
private login;
|
|
158
|
+
/**
|
|
159
|
+
* 座席互踢后调用退出登录方法
|
|
160
|
+
*/
|
|
161
|
+
static exitLogOut(): void;
|
|
162
|
+
static createEventHandle(callbacks?: any): void;
|
|
163
|
+
private getWebrtcInfo;
|
|
164
|
+
private initAttachEvent;
|
|
165
|
+
private attachNetworkCallbacks;
|
|
166
|
+
private initnNetworkMonitoring;
|
|
167
|
+
listenCallNetork: (callbacks: OnCallEventParams) => void;
|
|
168
|
+
private initAgentQueue;
|
|
169
|
+
private initQueue;
|
|
170
|
+
static createQueueMonitorEventHandle(callbacks?: any): void;
|
|
171
|
+
listenCallQueueEvent: (callbacks: any) => void;
|
|
172
|
+
listenTranslationEvent: (callbacks: any) => void;
|
|
173
|
+
static useDefaultDependencies(deps: any): {
|
|
174
|
+
newWebSocket(server: string, proto: any): any;
|
|
175
|
+
request(url: string, options: any): any;
|
|
176
|
+
};
|
|
177
|
+
private static initWebrtcEvent;
|
|
178
|
+
private openMediaAudio;
|
|
179
|
+
listenCallEvent: (callbacks: OnCallEventParams) => void;
|
|
180
|
+
get agent(): {
|
|
181
|
+
switchLoginType(params: UpdateLoginTypeParams): Promise<void>;
|
|
182
|
+
findPhoneBarList(params: GetAgentPhoneBarParams): void;
|
|
183
|
+
switchPhoneBar(params: UpdateAgentStatusParams): void;
|
|
184
|
+
logout(params: AgentOfflineParams): void;
|
|
185
|
+
findIdleAgentsForQueue(params: GetQueueOnlineAgentsParams): void;
|
|
186
|
+
getAvailableSipNumberList(params: any): void;
|
|
187
|
+
};
|
|
188
|
+
get webrtc(): {
|
|
189
|
+
accept(): void;
|
|
190
|
+
connect(): void;
|
|
191
|
+
disconnect(): void;
|
|
192
|
+
isConnected(): any;
|
|
193
|
+
sendDTMF(tone: string): void;
|
|
194
|
+
};
|
|
195
|
+
get call(): {
|
|
196
|
+
callout(params: DialoutParams): Promise<void>;
|
|
197
|
+
hangup(params: HangupParams): void;
|
|
198
|
+
holdOrUnHold(params: HoldOrUnHoldParams): void;
|
|
199
|
+
muteOrUnMute(params: MuteOrUnMuteParams): void;
|
|
200
|
+
transfer(params: TransferParams): void;
|
|
201
|
+
consult(params: consultParams): void;
|
|
202
|
+
cancelconsult(params: cancleConsultParams): void;
|
|
203
|
+
endConsult(params: stopConsultParams): void;
|
|
204
|
+
callbackConsult(params: resumeConsultParams): void;
|
|
205
|
+
consultTransfer(params: consultTransferParams): void;
|
|
206
|
+
threeWayCall(params: threeWayCallParams): void;
|
|
207
|
+
evaluate(params: satisfactionParams): void;
|
|
208
|
+
meeting(params: meetingParams): void;
|
|
209
|
+
};
|
|
210
|
+
private _callApi;
|
|
211
|
+
private _agentApi;
|
|
212
|
+
_webPhoneApi: () => {
|
|
213
|
+
accept(): void;
|
|
214
|
+
connect(): void;
|
|
215
|
+
disconnect(): void;
|
|
216
|
+
isConnected(): any;
|
|
217
|
+
sendDTMF(tone: string): void;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export {};
|