|
@@ -804,6 +804,7 @@ export class FuwutaiComponent implements OnInit {
|
804
|
804
|
TLWSA.onOpenreturn = (err) => {
|
805
|
805
|
err = Number(err);
|
806
|
806
|
if (!err) {
|
|
807
|
+ _this.incomingService.setPhoneNumber(TLWSA.phoneNumber);
|
807
|
808
|
_this.websocketLoading = false;
|
808
|
809
|
_this.cancelBindExtensionNumber();
|
809
|
810
|
console.log('呼叫中心连接成功-----seimin');
|
|
@@ -888,12 +889,17 @@ export class FuwutaiComponent implements OnInit {
|
888
|
889
|
clearTimeout(timer);
|
889
|
890
|
if(location.hash === '#/dispatchingDesk'){
|
890
|
891
|
console.log('与服务器网络连接中断-----seimin');
|
891
|
|
- _this.msg.info('与服务器网络连接中断,2分钟后重连')
|
892
|
|
- console.log('2分钟后自动重连-----seimin')
|
893
|
|
- timer = setTimeout(function () {
|
894
|
|
- //连接
|
895
|
|
- tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
|
896
|
|
- }, 120000)
|
|
892
|
+ if(this.incomingService.getPhoneNumber()){
|
|
893
|
+ _this.msg.info('与服务器网络连接中断,2分钟后重连')
|
|
894
|
+ console.log('2分钟后自动重连-----seimin')
|
|
895
|
+ timer = setTimeout(function () {
|
|
896
|
+ //连接
|
|
897
|
+ TLWSA.phoneNumber = _this.incomingService.getPhoneNumber();
|
|
898
|
+ tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
|
|
899
|
+ }, 120000)
|
|
900
|
+ }else{
|
|
901
|
+ _this.websocketLoading = false;
|
|
902
|
+ }
|
897
|
903
|
}
|
898
|
904
|
}
|
899
|
905
|
//签入回调函数
|
|
@@ -1349,14 +1355,15 @@ export class FuwutaiComponent implements OnInit {
|
1349
|
1355
|
|
1350
|
1356
|
showBindExtensionNumber() {
|
1351
|
1357
|
this.showBindExtensionNumberModal = true;
|
|
1358
|
+ this.websocketLoading = false;
|
1352
|
1359
|
}
|
1353
|
1360
|
|
1354
|
1361
|
// 保存绑定分机-签入
|
1355
|
1362
|
checkIn(phoneNumber){
|
1356
|
1363
|
this.websocketLoading = true;
|
1357
|
|
- this.incomingService.setPhoneNumber(phoneNumber);
|
|
1364
|
+ // this.incomingService.setPhoneNumber(phoneNumber);
|
1358
|
1365
|
this.incomingService.closeWs(true);
|
1359
|
|
- this.getWebsocketPhone();
|
|
1366
|
+ this.getWebsocketPhone(phoneNumber);
|
1360
|
1367
|
}
|
1361
|
1368
|
|
1362
|
1369
|
// 签出
|
|
@@ -1385,11 +1392,11 @@ export class FuwutaiComponent implements OnInit {
|
1385
|
1392
|
// tel1: '',//目的号码对象
|
1386
|
1393
|
// tel2: '',//转接坐席对象
|
1387
|
1394
|
}
|
1388
|
|
- getWebsocketPhone() {
|
|
1395
|
+ getWebsocketPhone(phoneNumber) {
|
1389
|
1396
|
const sign = this.incomingService.getSign();
|
1390
|
1397
|
if(sign === 'box'){
|
1391
|
1398
|
// 录音盒
|
1392
|
|
- this.incomingService.connectWs().subscribe((data) => {
|
|
1399
|
+ this.incomingService.connectWs(phoneNumber).subscribe((data) => {
|
1393
|
1400
|
// data = { status: 201, phone: '013581394341' };//ceshi
|
1394
|
1401
|
console.log(data);
|
1395
|
1402
|
console.log(this.incidentModel);
|
|
@@ -1397,6 +1404,7 @@ export class FuwutaiComponent implements OnInit {
|
1397
|
1404
|
|
1398
|
1405
|
// 200签入 201摘机 202来电
|
1399
|
1406
|
if (data.status == 200 && data.phone) {
|
|
1407
|
+ this.incomingService.setPhoneNumber(phoneNumber);
|
1400
|
1408
|
this.incidentModel = {};
|
1401
|
1409
|
this.incidentMsg = {};
|
1402
|
1410
|
this.incidentModel.callID = data.callId || undefined;
|
|
@@ -1426,6 +1434,7 @@ export class FuwutaiComponent implements OnInit {
|
1426
|
1434
|
// 呼叫中心----start
|
1427
|
1435
|
this.preState = '';
|
1428
|
1436
|
//连接
|
|
1437
|
+ TLWSA.phoneNumber = phoneNumber;
|
1429
|
1438
|
tlwsa.tlaOpen(this.incomingService.getSocketUrl());
|
1430
|
1439
|
}else{
|
1431
|
1440
|
this.websocketLoading = false;
|
|
@@ -2485,7 +2494,7 @@ export class FuwutaiComponent implements OnInit {
|
2485
|
2494
|
this.incomingService.removePhoneNumber();
|
2486
|
2495
|
}
|
2487
|
2496
|
if (this.incomingService.getPhoneNumber()) {
|
2488
|
|
- this.getWebsocketPhone();
|
|
2497
|
+ this.getWebsocketPhone(this.incomingService.getPhoneNumber());
|
2489
|
2498
|
}else{
|
2490
|
2499
|
this.websocketLoading = false;
|
2491
|
2500
|
}
|