Parcourir la Source

Merge branch 'master' into zz12356

zhoufan il y a 7 mois
Parent
commit
de6b537d02

+ 9 - 0
midware-service/src/main/java/midware/service/eslclient/EslCommon.java

77
     }
77
     }
78
 
78
 
79
     //根据id获取通道
79
     //根据id获取通道
80
+    public static Channel getChanById(String chanId) {
81
+        List<Channel> cs = channels.stream().filter(p -> p.getChanId().equals(chanId)).collect(Collectors.toList());
82
+        if (cs.size() > 0) {
83
+            return cs.get(0);
84
+        }
85
+        return null;
86
+    }
87
+
88
+    //根据号码获取通道
80
     public static Channel getChanByNumber(String number) {
89
     public static Channel getChanByNumber(String number) {
81
         List<Channel> cs = channels.stream().filter(p -> p.getNumber().equals(number)).collect(Collectors.toList());
90
         List<Channel> cs = channels.stream().filter(p -> p.getNumber().equals(number)).collect(Collectors.toList());
82
         if (cs.size() > 0) {
91
         if (cs.size() > 0) {

+ 6 - 2
midware-service/src/main/java/midware/service/eslclient/EslEventListenerEvent.java

78
                 String codec = header.get("variable_ep_codec_string");
78
                 String codec = header.get("variable_ep_codec_string");
79
                 boolean isVideo = StringHelper.isNotEmpty(codec) && codec.contains("H264");
79
                 boolean isVideo = StringHelper.isNotEmpty(codec) && codec.contains("H264");
80
 
80
 
81
-                Channel chan = EslCommon.getChanByNumber(chanNames[2]);
82
-                Agent agent = EslCommon.getAgentByExten(chanNames[2]);
81
+                Agent agent = null;
82
+                Channel chan = EslCommon.getChanById(chanId);
83
+                if(EslCommon.existExten(chanNames[2])) {
84
+                    if (chan == null) chan = EslCommon.getChanByNumber(chanNames[2]);
85
+                    agent = EslCommon.getAgentByExten(chanNames[2]);
86
+                }
83
                 Session session = EslCommon.getSessionById(callId);
87
                 Session session = EslCommon.getSessionById(callId);
84
                 if (callType == 0) callType = EslCommon.existExten(callerNum) ? 2 : 1;
88
                 if (callType == 0) callType = EslCommon.existExten(callerNum) ? 2 : 1;
85
 
89