|
@ -373,7 +373,7 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR |
|
|
redisUtil.set(key, serverItem); |
|
|
redisUtil.set(key, serverItem); |
|
|
resetOnlineServerItem(serverItem); |
|
|
resetOnlineServerItem(serverItem); |
|
|
updateMediaServerKeepalive(serverItem.getId(), null); |
|
|
updateMediaServerKeepalive(serverItem.getId(), null); |
|
|
setZLMConfig(serverItem); |
|
|
setZLMConfig(serverItem, "0".equals(zlmServerConfig.getHookEnable())); |
|
|
publisher.zlmOnlineEventPublish(serverItem.getId()); |
|
|
publisher.zlmOnlineEventPublish(serverItem.getId()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -448,9 +448,10 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR |
|
|
/** |
|
|
/** |
|
|
* 对zlm服务器进行基础配置 |
|
|
* 对zlm服务器进行基础配置 |
|
|
* @param mediaServerItem 服务ID |
|
|
* @param mediaServerItem 服务ID |
|
|
|
|
|
* @param restart 是否重启zlm |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void setZLMConfig(MediaServerItem mediaServerItem) { |
|
|
public void setZLMConfig(MediaServerItem mediaServerItem, boolean restart) { |
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm", |
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm", |
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
String protocol = sslEnabled ? "https" : "http"; |
|
|
String protocol = sslEnabled ? "https" : "http"; |
|
@ -483,12 +484,22 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR |
|
|
JSONObject responseJSON = zlmresTfulUtils.setServerConfig(mediaServerItem, param); |
|
|
JSONObject responseJSON = zlmresTfulUtils.setServerConfig(mediaServerItem, param); |
|
|
|
|
|
|
|
|
if (responseJSON != null && responseJSON.getInteger("code") == 0) { |
|
|
if (responseJSON != null && responseJSON.getInteger("code") == 0) { |
|
|
|
|
|
if (restart) { |
|
|
|
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm成功, 开始重启以保证配置生效", |
|
|
|
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
|
|
|
zlmresTfulUtils.restartServer(mediaServerItem); |
|
|
|
|
|
}else { |
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm成功", |
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm成功", |
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else { |
|
|
}else { |
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm失败", |
|
|
logger.info("[ ZLM:{} ]-[ {}:{} ]设置zlm失败", |
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|