Files
13684185576 46fb5f3ce5 警报
2025-07-16 19:44:39 +08:00

118 lines
2.6 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

let ump = null;
UMPSDK.sdkRegister({
eventType: "VoiceNotify",
eventName: "OnDialInRinging",
callback: (data) => {
console.log(4444, data);
},
});
// 登录
function rhlogin(isdn, isdnPwd) {
if (typeof window.ICPSDK !== "function") {
ump.showMessage("未安装融合控件", "error");
return console.log("ICPSDK is not available or is not a constructor");
}
const config = {
mdcIP: "171.221.254.50",
isdn: isdn,
isdnPwd: isdnPwd,
url: "",
callback: (res) => {
// 这里判断是否初始化成功
if (res && res.rsp === "0") {
ump.showMessage("初始化成功", "success");
} else {
ump.showMessage("初始化失败", "error");
}
},
// 仅为demo展示正式使用可不传
logCallback: (res) => {
const text = $("#log-info").text();
console.log(text + "\n" + res);
},
};
ump = new UMPSDK(config);
};
//语音呼叫
function voiceCall(sbbh) {
const style = {
posX: undefined,
posY: undefined,
width: undefined,
height: undefined,
borderColor: undefined,
bgColor: $("#ump-phone-card-body-input1").val(),
"z-index": 99999,
};
ump.voice.dial(sbbh, style);
};
//视频呼叫
function videoCall(sbbh) {
const style = {
posX: undefined,
posY: undefined,
width: undefined,
height: undefined,
borderColor: undefined,
"z-index": 99999,
// bgColor: $("#ump-phone-card-body-input1").val(),
};
ump.video.dial(sbbh, style);
};
//视频监控
/*
fmt 分辨率
4K
2K
1080P
720P
D1
CIF
QCIF
mute 伴音
0 带伴音
1 不带伴音
confirm 接听方式
0 自动接听
1 手动接听
camera 选择摄像头
0 前置
1 后置
2 外置摄像头
*/
function videoMonitoring(sbbh, fmt, mute, confirm, camera) {
const style = {
posX: undefined,
posY: undefined,
width: undefined,
height: undefined,
"z-index": 99999,
};
ump.monitor.dial(sbbh, fmt, mute, confirm, camera, style);
};
//组呼
function groupCall(sbbh) {
const style = {
posX: "",
posY: "",
width: "",
height: "",
borderColor: "",
"z-index": 99999,
// bgColor: $("#ump-group-card-body-changeColor-input").val(),
};
ump.group.open(sbbh, style);
};
//短信
function sMSSending(sbbh, message) {
const targets = sbbh.split(",");
ump.msg.send(targets, message);
};