支持彻底关闭文档页面 + 修复云端录像偶现callId错误问题
This commit is contained in:
@@ -29,6 +29,7 @@ import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.utils.MediaServerUtils;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo;
|
||||
@@ -47,7 +48,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.sip.InvalidArgumentException;
|
||||
import javax.sip.SipException;
|
||||
import java.text.ParseException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -179,7 +179,7 @@ public class ZLMHttpHookListener {
|
||||
}
|
||||
});
|
||||
if (!"rtp".equals(param.getApp())) {
|
||||
Map<String, String> paramMap = urlParamToMap(param.getParams());
|
||||
Map<String, String> paramMap = MediaServerUtils.urlParamToMap(param.getParams());
|
||||
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(param.getApp(), param.getStream());
|
||||
if (streamAuthorityInfo != null && streamAuthorityInfo.getCallId() != null && !streamAuthorityInfo.getCallId().equals(paramMap.get("callId"))) {
|
||||
return new HookResult(401, "Unauthorized");
|
||||
@@ -220,7 +220,7 @@ public class ZLMHttpHookListener {
|
||||
logger.info("推流鉴权失败: 缺少必要参数:sign=md5(user表的pushKey)");
|
||||
return new HookResultForOnPublish(401, "Unauthorized");
|
||||
}
|
||||
Map<String, String> paramMap = urlParamToMap(param.getParams());
|
||||
Map<String, String> paramMap = MediaServerUtils.urlParamToMap(param.getParams());
|
||||
String sign = paramMap.get("sign");
|
||||
if (sign == null) {
|
||||
logger.info("推流鉴权失败: 缺少必要参数:sign=md5(user表的pushKey)");
|
||||
@@ -899,22 +899,4 @@ public class ZLMHttpHookListener {
|
||||
|
||||
return HookResult.SUCCESS();
|
||||
}
|
||||
|
||||
private Map<String, String> urlParamToMap(String params) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (ObjectUtils.isEmpty(params)) {
|
||||
return map;
|
||||
}
|
||||
String[] paramsArray = params.split("&");
|
||||
if (paramsArray.length == 0) {
|
||||
return map;
|
||||
}
|
||||
for (String param : paramsArray) {
|
||||
String[] paramArray = param.split("=");
|
||||
if (paramArray.length == 2) {
|
||||
map.put(paramArray[0], paramArray[1]);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public class OnRecordMp4HookParam extends HookParam{
|
||||
private String vhost;
|
||||
private long start_time;
|
||||
private double time_len;
|
||||
private String params;
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
@@ -96,6 +97,14 @@ public class OnRecordMp4HookParam extends HookParam{
|
||||
this.time_len = time_len;
|
||||
}
|
||||
|
||||
public String getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(String params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OnRecordMp4HookParam{" +
|
||||
@@ -109,6 +118,7 @@ public class OnRecordMp4HookParam extends HookParam{
|
||||
", vhost='" + vhost + '\'' +
|
||||
", start_time=" + start_time +
|
||||
", time_len=" + time_len +
|
||||
", params=" + params +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user