@94ai/softphone 5.0.11 → 5.0.12

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.
@@ -0,0 +1,829 @@
1
+ const { addGlobalUncaughtErrorHandler, initGlobalState, registerMicroApps, loadMicroApp, start } = window.qiankun
2
+ const { bus, setupApp } = window.wujie
3
+ class SoftphoneManager {
4
+ nfMicrophoneInstance
5
+ option = {
6
+ origin: 'ai-softphone',
7
+ ancestorOrigin: 'nf-softphone',
8
+ destinationOrigin: '*',
9
+
10
+ mode: 'qiankun',
11
+ lang: 'zh',
12
+ name: 'nf-microphone',
13
+ blackList: ['#/login'],
14
+ isOem: true,
15
+ accessMode: 'pc',
16
+ numberKeyBoard: true,
17
+
18
+ sgGateway: undefined,
19
+ sgBase: undefined,
20
+ sgOpen: undefined,
21
+ sgDomain: undefined,
22
+ timestamp: undefined,
23
+ sign: undefined,
24
+ open: '1',
25
+
26
+ envMap: {
27
+ dev: {
28
+ host: 'http://softphone.test.k8s.com',
29
+ port: '80',
30
+ base: '/'
31
+ },
32
+ test: {
33
+ host: 'http://softphone.test.k8s.com',
34
+ port: '80',
35
+ base: '/'
36
+ },
37
+ sg: {
38
+ host: 'https://seat.teleai.com',
39
+ port: 443,
40
+ base: '/'
41
+ },
42
+ gray: {
43
+ host: 'http://softphone.gray.94ai.com',
44
+ port: 80,
45
+ base: '/'
46
+ },
47
+ prod: {
48
+ host: 'https://seat.94ai.com',
49
+ port: 443,
50
+ base: '/'
51
+ }
52
+ },
53
+ env: 'prod',
54
+ el: undefined,
55
+
56
+ agentId: undefined,
57
+ agentTag: undefined,
58
+ appKey: undefined,
59
+ appSecret: undefined,
60
+ extStatus: '1',
61
+
62
+ callShow: '1',
63
+ transferToLaborShow: '1',
64
+ restShow: '1',
65
+ networkDetectShow: '1',
66
+ muteShow: '1',
67
+ logShow: '1',
68
+ timingShow: '1',
69
+ signShow: '1',
70
+
71
+ softphoneConnectCallBack: () => {
72
+ console.log('softphone-connect')
73
+ },
74
+ softphoneCallRefreshCallBack: () => {
75
+ console.log('softphone-call-refresh')
76
+ },
77
+ softphoneSeatStatusChangeCallBack: () => {
78
+ console.log('softphone-seats-status-change')
79
+ },
80
+ softphoneAcceptCallBack: () => {
81
+ console.log('softphone-accept')
82
+ },
83
+ softphoneIgnoreCallBack: () => {
84
+ console.log('softphone-ignore')
85
+ },
86
+ softphoneHangupCallBack: () => {
87
+ console.log('softphone-hangup')
88
+ },
89
+ softphoneSessionStateChangeCallBack: () => {
90
+ console.log('softphone-session-state-change')
91
+ },
92
+ softphoneIncomingCallBack: () => {
93
+ console.log('softphone-incoming')
94
+ },
95
+ softphoneSendDtmfCallBack: () => {
96
+ console.log('softphone-send-dtmf')
97
+ },
98
+ softphoneConnectRegisteredCallBack: () => {
99
+ console.log('softphone-connect-registered')
100
+ },
101
+ softphoneSignOverduedCallBack: (done) => {
102
+ done({
103
+ timestamp: undefined,
104
+ sign: undefined
105
+ })
106
+ }
107
+ }
108
+
109
+ initSoftphone = (option) => {
110
+ if (this.nfMicrophoneInstance) {
111
+ return
112
+ }
113
+ const props = this.option = option ? { ...this.option, ...option } : this.option
114
+
115
+ const setUserInfo = (userInfo) => {
116
+ if (userInfo.sign && props.sign && userInfo.sign !== props.sign) {
117
+ this.option.sign = userInfo.sign
118
+ this.option.timestamp = userInfo.timestamp
119
+ }
120
+ }
121
+
122
+ const getUserInfo = () => {
123
+ const {
124
+ agentId,
125
+ agentTag,
126
+ appKey,
127
+ appSecret,
128
+ timestamp,
129
+ sign,
130
+ extStatus,
131
+ origin,
132
+ ancestorOrigin,
133
+ destinationOrigin,
134
+ callShow,
135
+ transferToLaborShow,
136
+ restShow,
137
+ networkDetectShow,
138
+ muteShow,
139
+ logShow,
140
+ timingShow,
141
+ signShow,
142
+ lang,
143
+ name,
144
+ extensionInfo,
145
+ blackList,
146
+ extPassword,
147
+ extensionNumber,
148
+ wsRegisterAddress,
149
+ wsProtocol,
150
+ isOem,
151
+ numberKeyBoard,
152
+ accessMode,
153
+ sipHeaders,
154
+ sgGateway,
155
+ open,
156
+ sgOpen,
157
+ sgDomain,
158
+ sgBase,
159
+ token,
160
+ timeZone,
161
+ getOfflineInfo,
162
+ changeALittleRest,
163
+ quickCallWin,
164
+ phoneRegex,
165
+ account,
166
+ extAccount,
167
+ socketHost,
168
+ sid,
169
+ uid,
170
+ newUserId,
171
+ companyId,
172
+ company,
173
+ countryId,
174
+ countryName,
175
+ authUserType,
176
+ userType,
177
+ recordPath,
178
+ constMap
179
+ } = props
180
+
181
+ return {
182
+ agentId,
183
+ agentTag,
184
+ appKey,
185
+ appSecret,
186
+ timestamp,
187
+ sign,
188
+ extStatus,
189
+ origin,
190
+ ancestorOrigin,
191
+ destinationOrigin,
192
+ callShow,
193
+ transferToLaborShow,
194
+ restShow,
195
+ networkDetectShow,
196
+ muteShow,
197
+ logShow,
198
+ timingShow,
199
+ signShow,
200
+ lang,
201
+ name,
202
+ extensionInfo,
203
+ blackList,
204
+ extPassword,
205
+ extensionNumber,
206
+ wsRegisterAddress,
207
+ wsProtocol,
208
+ isOem,
209
+ numberKeyBoard,
210
+ accessMode,
211
+ sipHeaders,
212
+ sgGateway,
213
+ open,
214
+ sgOpen,
215
+ sgDomain,
216
+ sgBase,
217
+ token,
218
+ timeZone,
219
+ getOfflineInfo,
220
+ changeALittleRest,
221
+ quickCallWin,
222
+ phoneRegex,
223
+ account,
224
+ extAccount,
225
+ socketHost,
226
+ sid,
227
+ uid,
228
+ newUserId,
229
+ companyId,
230
+ company,
231
+ countryId,
232
+ countryName,
233
+ authUserType,
234
+ userType,
235
+ recordPath,
236
+ constMap,
237
+ seats: true
238
+ }
239
+ }
240
+
241
+ // 数据总线
242
+ class Shared {
243
+ key
244
+
245
+ constructor(key) {
246
+ this.key = key
247
+ }
248
+
249
+ /**
250
+ * 获取 UserInfo
251
+ */
252
+ getUserInfo() {
253
+ return {}
254
+ }
255
+
256
+ setUserInfo() {
257
+ }
258
+
259
+ /**
260
+ * 获取分机信息
261
+ */
262
+ getExtensionInfo() {
263
+ return props.extensionInfo || {}
264
+ }
265
+
266
+ /**
267
+ * 获取 Gateway
268
+ */
269
+ getGateway() {
270
+ if (props.sgGateway) {
271
+ if (isDomainOrIP(props.sgGateway)) {
272
+ return props.sgGateway
273
+ }
274
+ if (props.sgGateway === '1') {
275
+ return 'https://gateway.teleai.com'
276
+ } else if (props.sgGateway === '0') {
277
+ return 'https://gateway.94ai.pro'
278
+ }
279
+ }
280
+ return 'https://gateway.94ai.pro'
281
+ }
282
+
283
+ getOpenApi() {
284
+ const {
285
+ sgOpen,
286
+ sgDomain
287
+ } = props
288
+ if (sgOpen) {
289
+ if (isDomainOrIP(sgOpen)) {
290
+ return sgOpen
291
+ }
292
+ if (sgOpen === '1') {
293
+ if (sgDomain === '1') {
294
+ return 'https://seat.teleai.com/sgopenapi'
295
+ } else {
296
+ return 'https://seat.teleai.com/openapi'
297
+ }
298
+ } else if (sgOpen === '0') {
299
+ if (sgDomain === '1') {
300
+ return 'https://seat.94ai.com/sgopenapi'
301
+ } else {
302
+ return 'https://seat.94ai.com/openapi'
303
+ }
304
+ }
305
+ }
306
+ return 'https://seat.94ai.com/openapi'
307
+ }
308
+
309
+ getBase() {
310
+ const {
311
+ sgBase
312
+ } = props
313
+ if (sgBase) {
314
+ if (isDomainOrIP(sgBase)) {
315
+ return sgBase
316
+ }
317
+ if (sgBase === '1') {
318
+ return 'https://seat.teleai.com/api'
319
+ } else if (sgBase === '0') {
320
+ return 'https://seat.94ai.com/api'
321
+ }
322
+ }
323
+ return undefined
324
+ }
325
+
326
+ getIsOem() {
327
+ return props.isOem
328
+ }
329
+
330
+ getSoftPhoneShowCall() {
331
+ if (props.callShow === '0') {
332
+ return false
333
+ }
334
+ return true
335
+ }
336
+
337
+ getSoftPhoneShowTransferToLabor() {
338
+ if (props.transferToLaborShow === '0') {
339
+ return false
340
+ }
341
+ return true
342
+ }
343
+
344
+ getSoftPhoneShowRest() {
345
+ if (props.restShow === '0') {
346
+ return false
347
+ }
348
+ return true
349
+ }
350
+
351
+ getSoftPhoneShowNetworkDetect() {
352
+ if (props.networkDetectShow === '0') {
353
+ return false
354
+ }
355
+ return true
356
+ }
357
+
358
+ getSoftPhoneShowMute() {
359
+ if (props.muteShow === '0') {
360
+ return false
361
+ }
362
+ return true
363
+ }
364
+
365
+ /**
366
+ * 是否展示对话记录功能
367
+ */
368
+ getSoftPhoneShowLog() {
369
+ if (props.logShow === '0') {
370
+ return false
371
+ }
372
+ return true
373
+ }
374
+
375
+ getSoftPhoneShowTiming() {
376
+ if (props.timingShow === '0') {
377
+ return false
378
+ }
379
+ return true
380
+ }
381
+
382
+ getSoftPhoneShowSign() {
383
+ if (props.signShow === '0') {
384
+ return false
385
+ }
386
+ return true
387
+ }
388
+
389
+ /**
390
+ * 使用按键拨号
391
+ */
392
+ getNumberKeyBoard() {
393
+ return props.numberKeyBoard
394
+ }
395
+
396
+ /**
397
+ * sip扩展头
398
+ */
399
+ getSipHeaders() {
400
+ // return ['sip-xx-headers1: 1', 'sip-xx-headers2: 2']
401
+ return props.sipHeaders
402
+ }
403
+
404
+ /**
405
+ * 启动移动端模式
406
+ */
407
+ getIsMobile() {
408
+ return props.accessMode === 'mobile'
409
+ }
410
+
411
+ /**
412
+ * 设置语言
413
+ */
414
+
415
+ getLanguage() {
416
+ return props.lang
417
+ }
418
+
419
+ setLanguage() {
420
+ //
421
+ }
422
+
423
+ getApplicationCode() {
424
+ return 3
425
+ }
426
+ }
427
+
428
+ // 实例+动作管理
429
+ class MicroManager {
430
+ showSoftPhone = true
431
+
432
+ app
433
+ mode = props.mode
434
+
435
+ #qiankunActions
436
+
437
+ getQiankunActions() {
438
+ return this.#qiankunActions
439
+ }
440
+
441
+ getWejieActions() {
442
+ return bus
443
+ }
444
+
445
+ microCommunicat(
446
+ type,
447
+ data = {},
448
+ operationType = 'manual',
449
+ ancestorOrigin = props.ancestorOrigin,
450
+ destinationOrigin = props.destinationOrigin
451
+ ) {
452
+ const state = {
453
+ origin: 'nf-softphone',
454
+ ancestorOrigin: ancestorOrigin || props.ancestorOrigin,
455
+ destinationOrigin: destinationOrigin || props.destinationOrigin,
456
+ type,
457
+ data: {
458
+ ...data,
459
+ type: operationType
460
+ }
461
+ }
462
+ if (this.mode === 'qiankun') {
463
+ this.getQiankunActions().setGlobalState(state)
464
+ } else if (this.mode === 'wujie') {
465
+ this.getWejieActions().$emit('ai-softphone', state)
466
+ }
467
+ }
468
+
469
+
470
+ // 签入
471
+ connect() {
472
+ this.microCommunicat('softphone-connect', {
473
+ status: true
474
+ })
475
+ }
476
+
477
+ disconnect() {
478
+ this.microCommunicat('softphone-connect', {
479
+ status: false
480
+ })
481
+ }
482
+
483
+ seatsStatusChange(status) {
484
+ this.microCommunicat('softphone-connect', {
485
+ status
486
+ })
487
+ }
488
+
489
+ accept() {
490
+ this.microCommunicat('softphone-connect')
491
+ }
492
+
493
+ ignore() {
494
+ this.microCommunicat('softphone-hangup')
495
+ }
496
+
497
+ hangup() {
498
+ this.microCommunicat('softphone-hangup')
499
+ }
500
+
501
+ sendDtmf() {
502
+ this.microCommunicat('softphone-send-dtmf')
503
+ }
504
+
505
+ signOverdued(data) {
506
+ this.microCommunicat('softphone-sign-overdued', data, 'auto', props.ancestorOrigin, 'ai-softphone')
507
+ }
508
+
509
+ changeServerToRegister() {
510
+ this.microCommunicat('softphone-change-server-to-register')
511
+ }
512
+
513
+ getMicroAppConfig() {
514
+ const config = []
515
+ const shared = new Shared('default')
516
+ if (props.getOfflineInfo) {
517
+ shared.getOfflineInfo = async (data) => {
518
+ return await props.getOfflineInfo
519
+ !(data)
520
+ }
521
+ }
522
+ if (props.changeALittleRest) {
523
+ shared.changeALittleRest = async (data) => {
524
+ return await props.changeALittleRest
525
+ !(data)
526
+ }
527
+ }
528
+ if (props.quickCallWin) {
529
+ shared.quickCallWin = async (data) => {
530
+ return await props.quickCallWin
531
+ !(data)
532
+ }
533
+ }
534
+ (Object.keys(props.envMap).reduce((res, currentValue) => {
535
+ res[currentValue] = [{
536
+ name: props.name,
537
+ host: props.envMap[currentValue].host,
538
+ port: props.envMap[currentValue].port,
539
+ base: props.envMap[currentValue].base,
540
+ container: props.el,
541
+ activeRule: (location) => {
542
+ if (!this.showSoftPhone) {
543
+ return false
544
+ }
545
+ if (props.blackList.includes(location.hash)) {
546
+ return false
547
+ }
548
+ return true
549
+ },
550
+ props: {
551
+ name: props.name
552
+ }
553
+ }]
554
+ return res
555
+ }, {})[props.env] || []).forEach(item => {
556
+ config.push({
557
+ name: item.name,
558
+ entry: `${ item.host }${ (item.port ? `:${ item.port }` : '') + item.base }?name=${ item.name }`,
559
+ container: item.container,
560
+ activeRule: item.activeRule,
561
+ props: { ...item.props, shared }
562
+ })
563
+ })
564
+ return config
565
+ }
566
+
567
+ initState() {
568
+ this.#qiankunActions = initGlobalState({
569
+ type: 'qiankun-init',
570
+ origin: props.origin,
571
+ ancestorOrigin: props.ancestorOrigin,
572
+ destinationOrigin: props.destinationOrigin,
573
+ data: null
574
+ })
575
+ this.#qiankunActions.onGlobalStateChange((state) => {
576
+ // state: 变更后的状态; prev 变更前的状态
577
+ (new SoftphoneNotity()).useQinkunSoftphoneNotity(state)
578
+ })
579
+ addGlobalUncaughtErrorHandler((event) => {
580
+ if (event.type === 'error' && event.error?.message === 'application \'softPhone\' died in status LOADING_SOURCE_CODE: Failed to fetch') {
581
+ this.showSoftPhone = false
582
+ }
583
+ console.error(event)
584
+ })
585
+ }
586
+
587
+ /**
588
+ * 手动加载子应用
589
+ */
590
+ loadQiankunMicroApps() {
591
+ const appConfig = this.getMicroAppConfig()[0]
592
+ appConfig.props.shared.getUserInfo = getUserInfo
593
+ appConfig.props.shared.setUserInfo = setUserInfo
594
+ this.initState()
595
+ this.app = loadMicroApp(appConfig, {
596
+ sandbox: {
597
+ experimentalStyleIsolation: true
598
+ }
599
+ })
600
+ }
601
+
602
+ /**
603
+ * 卸载子应用
604
+ */
605
+ unmountQiankunMicroApps() {
606
+ try {
607
+ this.app?.unmount()
608
+ this.#qiankunActions?.offGlobalStateChange()
609
+ } catch (e) {
610
+ //
611
+ } finally {
612
+ this.app = null
613
+ }
614
+ }
615
+
616
+ registerWujieMicroApps() {
617
+ const appConfig = this.getMicroAppConfig()[0]
618
+ const url = appConfig.entry
619
+ appConfig.props.shared.getUserInfo = getUserInfo
620
+ appConfig.props.shared.setUserInfo = setUserInfo
621
+
622
+ setupApp({
623
+ name: props.name,
624
+ plugins: [
625
+ {
626
+ cssBeforeLoaders: [{ src: `${ url }/index.css` }]
627
+ }
628
+ ],
629
+ url,
630
+ exec: true,
631
+ props: {
632
+ shared: appConfig.props.shared
633
+ },
634
+ fetch(url, options) {
635
+ return window.fetch(url, { ...options, credentials: 'omit' })
636
+ },
637
+ degrade: !window.Proxy || !window.CustomElementRegistry,
638
+ // @ts-ignore
639
+ beforeLoad: (appWindow) => console.log(`${ appWindow.__WUJIE.id } beforeLoad 生命周期`),
640
+ // @ts-ignore
641
+ beforeMount: (appWindow) => console.log(`${ appWindow.__WUJIE.id } beforeMount 生命周期`),
642
+ // @ts-ignore
643
+ afterMount: (appWindow) => console.log(`${ appWindow.__WUJIE.id } afterMount 生命周期`),
644
+ // @ts-ignore
645
+ beforeUnmount: (appWindow) => console.log(`${ appWindow.__WUJIE.id } beforeUnmount 生命周期`),
646
+ // @ts-ignore
647
+ afterUnmount: (appWindow) => console.log(`${ appWindow.__WUJIE.id } afterUnmount 生命周期`),
648
+ // @ts-ignore
649
+ activated: (appWindow) => console.log(`${ appWindow.__WUJIE.id } activated 生命周期`),
650
+ // @ts-ignore
651
+ deactivated: (appWindow) => console.log(`${ appWindow.__WUJIE.id } deactivated 生命周期`)
652
+ // loadError: (url, e) => console.log(`${url} 加载失败`, e),
653
+ });
654
+ (new SoftphoneNotity()).useWujieSoftphoneNotity()
655
+ }
656
+
657
+ registerQiankunMicroApps() {
658
+ const appConfig = this.getMicroAppConfig()[0]
659
+ appConfig.props.shared.getUserInfo = getUserInfo
660
+ appConfig.props.shared.setUserInfo = setUserInfo
661
+
662
+ registerMicroApps([appConfig], {
663
+ // qiankun 生命周期钩子 - 加载前
664
+ beforeLoad: [() => {
665
+ // 加载子应用前,加载进度条
666
+ // NProgress.start()
667
+ return Promise.resolve()
668
+ }],
669
+ // qiankun 生命周期钩子 - 挂载后
670
+ afterMount: [() => {
671
+ // 加载子应用前,进度条加载完成
672
+ // NProgress.done()
673
+ return Promise.resolve()
674
+ }],
675
+ // qiankun 生命周期钩子 - 卸载后
676
+ afterUnmount: [() => {
677
+ return Promise.resolve()
678
+ }]
679
+ })
680
+ this.initState()
681
+ }
682
+
683
+ startQiankun() {
684
+ this.registerQiankunMicroApps()
685
+ start({
686
+ singular: false,
687
+ prefetch: 'all',
688
+ sandbox: {
689
+ experimentalStyleIsolation: true
690
+ }
691
+ })
692
+ }
693
+
694
+ startWujie() {
695
+ this.registerWujieMicroApps()
696
+ // @ts-ignore
697
+ startApp({
698
+ name: props.name,
699
+ el: props.el
700
+ })
701
+ }
702
+
703
+ startMicrotask() {
704
+ if (this.mode === 'wujie') {
705
+ this.startWujie()
706
+ } else {
707
+ this.startQiankun()
708
+ }
709
+ }
710
+ }
711
+
712
+ const nfMicrophoneInstance = this.nfMicrophoneInstance = new MicroManager()
713
+
714
+ // 通知
715
+ class SoftphoneNotity {
716
+ communicationList = {
717
+ 'softphone-connect-registered': (data) => {
718
+ props.softphoneConnectRegisteredCallBack?.(data)
719
+ },
720
+ 'softphone-session-state-change': (data) => {
721
+ props.softphoneSessionStateChangeCallBack?.(data)
722
+ },
723
+ 'softphone-call-refresh': (data) => {
724
+ props.softphoneCallRefreshCallBack?.(data)
725
+ },
726
+ 'softphone-connect': (data) => {
727
+ props.softphoneConnectCallBack?.(data)
728
+ },
729
+ 'softphone-accept': (data) => {
730
+ props.softphoneAcceptCallBack?.(data)
731
+ },
732
+ 'softphone-seats-status-change': (data) => {
733
+ props.softphoneSeatStatusChangeCallBack?.(data)
734
+ },
735
+ 'softphone-ignore': (data) => {
736
+ props.softphoneIgnoreCallBack?.(data)
737
+ },
738
+ 'softphone-hangup': (data) => {
739
+ props.softphoneHangupCallBack?.(data)
740
+ },
741
+ 'softphone-incoming': (data) => {
742
+ props.softphoneIncomingCallBack?.(data)
743
+ },
744
+ 'softphone-send-dtmf': (data) => {
745
+ props.softphoneSendDtmfCallBack?.(data)
746
+ },
747
+ 'softphone-sign-overdued': () => {
748
+ const done = (data) => {
749
+ const {
750
+ sign,
751
+ timestamp
752
+ } = data
753
+ nfMicrophoneInstance.signOverdued({
754
+ sign,
755
+ timestamp
756
+ })
757
+ }
758
+ props.softphoneSignOverduedCallBack?.(done)
759
+ }
760
+ }
761
+ useQinkunSoftphoneNotity = (state) => {
762
+ if ((state.ancestorOrigin === props.ancestorOrigin && state.origin !== props.ancestorOrigin) ||
763
+ (state.ancestorOrigin === props.origin && state.origin === props.origin)) {
764
+ if (state.destinationOrigin === '*' || state.destinationOrigin === props.destinationOrigin) {
765
+ this.communicationList[state.type]?.(state.data)
766
+ }
767
+ }
768
+ }
769
+
770
+ useWujieSoftphoneNotity() {
771
+ Object.keys(this.communicationList).forEach(key => {
772
+ bus.$on(key, (state) => {
773
+ if ((state.ancestorOrigin === props.ancestorOrigin && state.origin !== props.ancestorOrigin) ||
774
+ (state.ancestorOrigin === props.origin && state.origin === props.origin)) {
775
+ if (state.destinationOrigin === '*' || state.destinationOrigin === props.destinationOrigin) {
776
+ this.communicationList[key]?.(state.data)
777
+ }
778
+ }
779
+ })
780
+ })
781
+ }
782
+ }
783
+
784
+ // 注册软电话微应用
785
+ if (this.option.mode === 'qiankun') {
786
+ this.nfMicrophoneInstance.loadQiankunMicroApps()
787
+ } else {
788
+ this.nfMicrophoneInstance.startWujie()
789
+ }
790
+
791
+ return this
792
+ }
793
+
794
+
795
+ connect = () => {
796
+ this.nfMicrophoneInstance.connect()
797
+ }
798
+
799
+ disconnect = () => {
800
+ this.nfMicrophoneInstance.disconnect()
801
+ }
802
+
803
+ seatsStatusChange = (status) => {
804
+ this.nfMicrophoneInstance.seatsStatusChange(status)
805
+ }
806
+
807
+ accept = () => {
808
+ this.nfMicrophoneInstance.accept()
809
+ }
810
+ ignore = () => {
811
+ this.nfMicrophoneInstance.ignore()
812
+ }
813
+ hangup = () => {
814
+ this.nfMicrophoneInstance.hangup()
815
+ }
816
+ sendDtmf = () => {
817
+ this.nfMicrophoneInstance.sendDtmf()
818
+ }
819
+
820
+ changeServerToRegister = () => {
821
+ this.nfMicrophoneInstance.changeServerToRegister()
822
+ }
823
+
824
+ destory = () => {
825
+ this.nfMicrophoneInstance.unmountQiankunMicroApps()
826
+ this.nfMicrophoneInstance = undefined
827
+ }
828
+ }
829
+ const softphoneManager = new SoftphoneManager()