|
|
@@ -74,7 +74,7 @@ public class WebSocketService {
|
|
74
|
74
|
|
|
75
|
75
|
Map<String, Object> result = new HashMap<>();
|
|
76
|
76
|
result.put("Type", type);
|
|
77
|
|
- result.put("Result", "操作失败");
|
|
|
77
|
+ result.put("Result", "操作失败1");
|
|
78
|
78
|
Agent agent = EslCommon.getAgent(agentId);
|
|
79
|
79
|
Channel chan = null;EslAgentNum state =null;
|
|
80
|
80
|
if (agent != null) {
|
|
|
@@ -225,7 +225,7 @@ public class WebSocketService {
|
|
225
|
225
|
param = DestinationNumber;
|
|
226
|
226
|
if (StringHelper.isNotEmpty(DestinationNumber)) {
|
|
227
|
227
|
if (DestinationNumber.equals(agent.getExten())) {
|
|
228
|
|
- result.put("Result", "操作失败");
|
|
|
228
|
+ result.put("Result", "目标不能是自己");
|
|
229
|
229
|
} else {
|
|
230
|
230
|
Agent tAgent = EslCommon.getAgentByExten(DestinationNumber);
|
|
231
|
231
|
if (tAgent != null && tAgent.getAgentState() != EslAgentNum.free.ordinal()) {
|
|
|
@@ -233,7 +233,7 @@ public class WebSocketService {
|
|
233
|
233
|
} else if (EslCommon.isInSession(DestinationNumber)) {
|
|
234
|
234
|
result.put("Result", "目标号码忙碌中");
|
|
235
|
235
|
} else if (chan.getSessionSort() == 1) {//呼出方不可以转移
|
|
236
|
|
- result.put("Result", "操作失败");
|
|
|
236
|
+ result.put("Result", "主叫不能此操作");
|
|
237
|
237
|
} else {
|
|
238
|
238
|
agent.setOpType(1);
|
|
239
|
239
|
String rt = eslClientService.transfer(chan.getSessionId(), agent.getExten(), DestinationNumber);
|
|
|
@@ -253,7 +253,7 @@ public class WebSocketService {
|
|
253
|
253
|
param = DestinationNumber;
|
|
254
|
254
|
if (StringHelper.isNotEmpty(DestinationNumber)) {
|
|
255
|
255
|
if (DestinationNumber.equals(agent.getExten())) {
|
|
256
|
|
- result.put("Result", "操作失败");
|
|
|
256
|
+ result.put("Result", "目标不能是自己");
|
|
257
|
257
|
} else {
|
|
258
|
258
|
Agent tAgent = EslCommon.getAgentByExten(DestinationNumber);
|
|
259
|
259
|
if (tAgent != null && tAgent.getAgentState() != EslAgentNum.free.ordinal()) {
|
|
|
@@ -261,7 +261,7 @@ public class WebSocketService {
|
|
261
|
261
|
} else if (EslCommon.isInSession(DestinationNumber)) {
|
|
262
|
262
|
result.put("Result", "目标号码忙碌中");
|
|
263
|
263
|
} else if (chan.getSessionSort() == 1) {//呼出方不可以协商
|
|
264
|
|
- result.put("Result", "操作失败");
|
|
|
264
|
+ result.put("Result", "主叫不能此操作");
|
|
265
|
265
|
} else {
|
|
266
|
266
|
agent.setOpType(1);
|
|
267
|
267
|
String rt = eslClientService.consult(chan.getSessionId(), agent.getExten(), DestinationNumber);
|
|
|
@@ -294,7 +294,7 @@ public class WebSocketService {
|
|
294
|
294
|
param = DestinationNumber;
|
|
295
|
295
|
if (StringHelper.isNotEmpty(DestinationNumber)) {
|
|
296
|
296
|
if (DestinationNumber.equals(agent.getExten())) {
|
|
297
|
|
- result.put("Result", "操作失败");
|
|
|
297
|
+ result.put("Result", "目标不能是自己");
|
|
298
|
298
|
} else {
|
|
299
|
299
|
Agent tAgent = EslCommon.getAgentByExten(DestinationNumber);
|
|
300
|
300
|
if (tAgent != null && tAgent.getAgentState() != EslAgentNum.free.ordinal()) {
|
|
|
@@ -350,7 +350,7 @@ public class WebSocketService {
|
|
350
|
350
|
param = TargetAgentID;
|
|
351
|
351
|
if (StringHelper.isNotEmpty(TargetAgentID)) {
|
|
352
|
352
|
if (TargetAgentID.equals(agentId)) {
|
|
353
|
|
- result.put("Result", "操作失败");
|
|
|
353
|
+ result.put("Result", "目标不能是自己");
|
|
354
|
354
|
} else {
|
|
355
|
355
|
Agent tAgent = EslCommon.getAgent(TargetAgentID);
|
|
356
|
356
|
String check = checkTargetAgentTalk(tAgent);
|
|
|
@@ -378,7 +378,7 @@ public class WebSocketService {
|
|
378
|
378
|
param = TargetAgentID;
|
|
379
|
379
|
if (StringHelper.isNotEmpty(TargetAgentID)) {
|
|
380
|
380
|
if (TargetAgentID.equals(agentId)) {
|
|
381
|
|
- result.put("Result", "操作失败");
|
|
|
381
|
+ result.put("Result", "目标不能是自己");
|
|
382
|
382
|
} else {
|
|
383
|
383
|
Agent tAgent = EslCommon.getAgent(TargetAgentID);
|
|
384
|
384
|
String check = checkTargetAgentTalk(tAgent);
|
|
|
@@ -407,7 +407,7 @@ public class WebSocketService {
|
|
407
|
407
|
param = TargetAgentID;
|
|
408
|
408
|
if (StringHelper.isNotEmpty(TargetAgentID)) {
|
|
409
|
409
|
if (TargetAgentID.equals(agentId)) {
|
|
410
|
|
- result.put("Result", "操作失败");
|
|
|
410
|
+ result.put("Result", "目标不能是自己");
|
|
411
|
411
|
} else {
|
|
412
|
412
|
Agent tAgent = EslCommon.getAgent(TargetAgentID);
|
|
413
|
413
|
String check = checkTargetAgentTalk(tAgent);
|
|
|
@@ -437,7 +437,7 @@ public class WebSocketService {
|
|
437
|
437
|
param = TargetAgentID;
|
|
438
|
438
|
if (StringHelper.isNotEmpty(TargetAgentID)) {
|
|
439
|
439
|
if (TargetAgentID.equals(agentId)) {
|
|
440
|
|
- result.put("Result", "操作失败");
|
|
|
440
|
+ result.put("Result", "目标不能是自己");
|
|
441
|
441
|
} else {
|
|
442
|
442
|
Agent tAgent = EslCommon.getAgent(TargetAgentID);
|
|
443
|
443
|
String check = checkTargetAgentTalk(tAgent);
|
|
|
@@ -464,7 +464,7 @@ public class WebSocketService {
|
|
464
|
464
|
param = TargetAgentID;
|
|
465
|
465
|
if (StringHelper.isNotEmpty(TargetAgentID)) {
|
|
466
|
466
|
if (TargetAgentID.equals(agentId)) {
|
|
467
|
|
- result.put("Result", "操作失败");
|
|
|
467
|
+ result.put("Result", "目标不能是自己");
|
|
468
|
468
|
} else {
|
|
469
|
469
|
Agent tAgent = EslCommon.getAgent(TargetAgentID);
|
|
470
|
470
|
if (tAgent == null) {
|
|
|
@@ -475,7 +475,7 @@ public class WebSocketService {
|
|
475
|
475
|
Channel tchan = EslCommon.getChanByExten(tAgent.getExten());
|
|
476
|
476
|
if (tchan != null && StringHelper.isNotEmpty(tchan.getSessionId())) {
|
|
477
|
477
|
if (tchan.getSessionSort() == 1) {//不能代接开始方
|
|
478
|
|
- result.put("Result", "操作失败");
|
|
|
478
|
+ result.put("Result", "主叫不能代接");
|
|
479
|
479
|
} else {
|
|
480
|
480
|
agent.setOpType(5);
|
|
481
|
481
|
String sid = tchan.getSessionId(), cid = tchan.getChanId();
|