|
|
@@ -579,32 +579,31 @@ public class EslClientService {
|
|
579
|
579
|
}
|
|
580
|
580
|
|
|
581
|
581
|
//呼叫号码加入会议
|
|
582
|
|
- public boolean callJoinMeeting(String callerNum, String calleeNum, String meetingId,String action) {
|
|
|
582
|
+ public boolean callJoinMeeting(String callerNum, String calleeNum, String sessionId,String action) {
|
|
583
|
583
|
String result = "";
|
|
584
|
584
|
try {
|
|
585
|
585
|
String fix = action.substring(action.lastIndexOf("|") + 1);
|
|
586
|
586
|
String command = EslCommandEnum.originate.name();
|
|
587
|
587
|
String at = "threeway", argstr = "";
|
|
588
|
|
- Session session = EslCommon.getSessionById(meetingId);
|
|
|
588
|
+ Session session = EslCommon.getSessionById(sessionId);
|
|
589
|
589
|
if (session != null && session.isVideo()) {
|
|
590
|
590
|
at = "video-mcu-stereo";
|
|
591
|
591
|
String parentPath = "files/video/meeting/" + new SimpleDateFormat("yyyyMMdd").format(new Date());
|
|
592
|
|
- String path = new File(parentPath).getAbsolutePath() + "/" + meetingId + ".mp4";
|
|
593
|
|
- session.setVideoPath(parentPath + "/" + meetingId + ".mp4");
|
|
|
592
|
+ String path = new File(parentPath).getAbsolutePath() + "/" + sessionId + ".mp4";
|
|
|
593
|
+ session.setVideoPath(parentPath + "/" + sessionId + ".mp4");
|
|
594
|
594
|
argstr = ",record_concat_video=true,conference_auto_record=" + path;
|
|
595
|
595
|
}
|
|
596
|
|
-
|
|
597
|
|
- String arg = " {cc_member_session_uuid=" + meetingId+",call_caller=" + callerNum
|
|
|
596
|
+ String arg = " {cc_member_session_uuid=" + sessionId+",call_caller=" + callerNum
|
|
598
|
597
|
+ ",call_callee=" + calleeNum.substring(fix.length())
|
|
599
|
598
|
+ ",transfer_ringback=local_stream://moh,ringback=local_stream://moh"
|
|
600
|
599
|
+ argstr + "}" + getCallString(calleeNum)
|
|
601
|
600
|
// + " " + meetingId + " xml ExtenMeeting";
|
|
602
|
|
- + " &conference(" + meetingId + "@" + at + ")"
|
|
|
601
|
+ + " &conference(" + sessionId + "@" + at + ")"
|
|
603
|
602
|
+ "\r\nJob-UUID: " + action + "|" + System.currentTimeMillis();
|
|
604
|
603
|
result = client.sendAsyncApiCommand(command, arg);
|
|
605
|
604
|
|
|
606
|
605
|
} catch (Exception e) {
|
|
607
|
|
- log.error(callerNum + "|" + calleeNum + "|" + meetingId + " 呼叫加入会议失败", e);
|
|
|
606
|
+ log.error(callerNum + "|" + calleeNum + "|" + sessionId + " 呼叫加入会议失败", e);
|
|
608
|
607
|
}
|
|
609
|
608
|
return !result.equals("");
|
|
610
|
609
|
}
|
|
|
@@ -646,7 +645,7 @@ public class EslClientService {
|
|
646
|
645
|
String result = "";
|
|
647
|
646
|
try {
|
|
648
|
647
|
String command = EslCommandEnum.uuid_record.name();
|
|
649
|
|
- String arg = chanId + (isRecord ? " start" : " stop") + filePath;
|
|
|
648
|
+ String arg = chanId + (isRecord ? " start " : " stop ") + filePath;
|
|
650
|
649
|
result = client.sendAsyncApiCommand(command, arg);
|
|
651
|
650
|
} catch (Exception e) {
|
|
652
|
651
|
String state = isRecord ? "开启" : "关闭";
|
|
|
@@ -726,6 +725,23 @@ public class EslClientService {
|
|
726
|
725
|
return !result.equals("");
|
|
727
|
726
|
}
|
|
728
|
727
|
|
|
|
728
|
+ //获取会议人员id
|
|
|
729
|
+ public String getConferenceMemberId(String meetingId, String chanId) {
|
|
|
730
|
+ String memberId = "";
|
|
|
731
|
+ try {
|
|
|
732
|
+ //获取会议所有人员
|
|
|
733
|
+ EslMessage message = client.sendSyncApiCommand("conference", meetingId + " list");
|
|
|
734
|
+ if (message != null && message.getBodyLines().size() > 0) {
|
|
|
735
|
+ for (String line : message.getBodyLines()) {
|
|
|
736
|
+ if (line.contains(chanId)) memberId = line.split(";")[0];
|
|
|
737
|
+ }
|
|
|
738
|
+ }
|
|
|
739
|
+ } catch (Exception e) {
|
|
|
740
|
+ log.error("获取会议人员id失败", e);
|
|
|
741
|
+ }
|
|
|
742
|
+ return memberId;
|
|
|
743
|
+ }
|
|
|
744
|
+
|
|
729
|
745
|
//设置会议人员离开是否播放声音
|
|
730
|
746
|
public boolean setConferenceExitSound(String meetingId, boolean isplay) {
|
|
731
|
747
|
String result = "";
|
|
|
@@ -733,7 +749,7 @@ public class EslClientService {
|
|
733
|
749
|
String command = EslCommandEnum.conference.name();
|
|
734
|
750
|
String arg = meetingId + " exit_sound " + (isplay ? "on" : "off");
|
|
735
|
751
|
result = client.sendAsyncApiCommand(command, arg);
|
|
736
|
|
-
|
|
|
752
|
+
|
|
737
|
753
|
} catch (Exception e) {
|
|
738
|
754
|
log.error(meetingId + "|" + isplay + " 设置会议离开失败", e);
|
|
739
|
755
|
}
|
|
|
@@ -741,9 +757,10 @@ public class EslClientService {
|
|
741
|
757
|
}
|
|
742
|
758
|
|
|
743
|
759
|
//设置会议人员是否静音
|
|
744
|
|
- public boolean setConferenceIsMute(String meetingId, String memberId, boolean isMute,String action) {
|
|
|
760
|
+ public boolean setConferenceIsMute(String meetingId, String chanId, boolean isMute,String action) {
|
|
745
|
761
|
String result = "";
|
|
746
|
762
|
try {
|
|
|
763
|
+ String memberId=getConferenceMemberId(meetingId,chanId);
|
|
747
|
764
|
String command = EslCommandEnum.conference.name();
|
|
748
|
765
|
if (isMute) {
|
|
749
|
766
|
String arg = meetingId + " deaf " + memberId;
|
|
|
@@ -762,7 +779,7 @@ public class EslClientService {
|
|
762
|
779
|
}
|
|
763
|
780
|
|
|
764
|
781
|
} catch (Exception e) {
|
|
765
|
|
- log.error(meetingId + "|" + memberId + "|" + isMute + " 设置会议静音失败", e);
|
|
|
782
|
+ log.error(meetingId + "|" + chanId + "|" + isMute + " 设置会议静音失败", e);
|
|
766
|
783
|
}
|
|
767
|
784
|
return !result.equals("");
|
|
768
|
785
|
}
|