|
|
@@ -466,12 +466,14 @@ public class EslEventListener implements IEslEventListener {
|
|
466
|
466
|
String agentNo = agent.getAgent();
|
|
467
|
467
|
if (callType == 1 && chan.isAnswer()) {//呼入接通后挂断-话后处理
|
|
468
|
468
|
agent.setAgentState(EslAgentEnum.aftertalk.ordinal());
|
|
469
|
|
- new ScheduledThreadPoolExecutor(1).schedule(() -> {
|
|
|
469
|
+ ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
|
|
|
470
|
+ executor.schedule(() -> {
|
|
470
|
471
|
Agent agent2 = EslCommon.getAgent(agentNo);
|
|
471
|
472
|
if (agent2 != null && agent2.getAgentState() == EslAgentEnum.aftertalk.ordinal()) {
|
|
472
|
473
|
agent2.setAgentState(EslAgentEnum.free.ordinal());
|
|
473
|
474
|
}
|
|
474
|
|
- }, 20, TimeUnit.SECONDS);
|
|
|
475
|
+ executor.shutdown();
|
|
|
476
|
+ }, 5, TimeUnit.SECONDS);
|
|
475
|
477
|
} else {//呼出挂断-空闲
|
|
476
|
478
|
chan.setSessionId("");
|
|
477
|
479
|
agent.setAgentState(EslAgentEnum.free.ordinal());
|