|
|
@@ -48,6 +48,14 @@ public class EslClientService {
|
|
48
|
48
|
new ScheduledThreadPoolExecutor(1).scheduleAtFixedRate(() -> {
|
|
49
|
49
|
if (!client.canSend()) {
|
|
50
|
50
|
try {
|
|
|
51
|
+ if (EslCommon.agents.size() > 0) {
|
|
|
52
|
+ for (Agent a : EslCommon.agents) {
|
|
|
53
|
+ logout(a.getAgent(), a.getGroup());
|
|
|
54
|
+ a.setAgentState(EslAgentEnum.logout.ordinal());
|
|
|
55
|
+ }
|
|
|
56
|
+ EslCommon.agents=new ArrayList<>();
|
|
|
57
|
+ }
|
|
|
58
|
+
|
|
51
|
59
|
client.connect(config.getHost(), config.getPort(), config.getPassword(), config.getTimeout());
|
|
52
|
60
|
//移除事件
|
|
53
|
61
|
client.cancelEventSubscriptions();
|
|
|
@@ -70,14 +78,6 @@ public class EslClientService {
|
|
70
|
78
|
} catch (Exception e1) {
|
|
71
|
79
|
}
|
|
72
|
80
|
}
|
|
73
|
|
- }else {
|
|
74
|
|
- if (EslCommon.agents.size() > 0) {
|
|
75
|
|
- for (Agent a : EslCommon.agents) {
|
|
76
|
|
- logout(a.getAgent(), a.getGroup());
|
|
77
|
|
- a.setAgentState(EslAgentEnum.logout.ordinal());
|
|
78
|
|
- }
|
|
79
|
|
- EslCommon.agents=new ArrayList<>();
|
|
80
|
|
- }
|
|
81
|
81
|
}
|
|
82
|
82
|
}, 1, 5000, TimeUnit.MILLISECONDS);
|
|
83
|
83
|
|
|
|
@@ -379,6 +379,22 @@ public class EslClientService {
|
|
379
|
379
|
return result;
|
|
380
|
380
|
}
|
|
381
|
381
|
|
|
|
382
|
+ //放音收号
|
|
|
383
|
+ public String playAndGetDigits(String path, String chanId) {
|
|
|
384
|
+ String result = "";
|
|
|
385
|
+ try {
|
|
|
386
|
+ String command = EslCommandEnum.uuid_broadcast.name();
|
|
|
387
|
+ path = "/home/wav/8001.wav";
|
|
|
388
|
+
|
|
|
389
|
+ String arg = chanId + " 'play_and_get_digits::1 1 2 2000 # " + path + " silence_stream://250 res \\d+'";
|
|
|
390
|
+ result = client.sendAsyncApiCommand(command, arg);
|
|
|
391
|
+
|
|
|
392
|
+ } catch (Exception e) {
|
|
|
393
|
+ log.error(chanId + " 放音收号失败", e);
|
|
|
394
|
+ }
|
|
|
395
|
+ return result;
|
|
|
396
|
+ }
|
|
|
397
|
+
|
|
382
|
398
|
//会话加入会议
|
|
383
|
399
|
public String talkJoinMeeting(String sessionId) {
|
|
384
|
400
|
String result = "";
|