合并pr:#509

This commit is contained in:
xiongziliang
2020-10-01 14:37:52 +08:00
parent eccb1a664c
commit 728dd3ec3c
3 changed files with 5 additions and 34 deletions

View File

@@ -129,6 +129,9 @@ const char *getContentType(const HttpArgs &value){
}
static void do_http_hook(const string &url,const ArgsType &body,const function<void(const Value &,const string &)> &fun){
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
const_cast<ArgsType &>(body)["mediaserverid"] = mediaServerId;
GET_CONFIG(float,hook_timeoutSec,Hook::kTimeoutSec);
HttpRequester::Ptr requester(new HttpRequester);
requester->setMethod("POST");
@@ -158,8 +161,6 @@ static void do_http_hook(const string &url,const ArgsType &body,const function<v
static ArgsType make_json(const MediaInfo &args){
ArgsType body;
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
body["mediaserverid"] = mediaServerId;
body["schema"] = args._schema;
body["vhost"] = args._vhost;
body["app"] = args._app;
@@ -321,8 +322,6 @@ void installWebHook(){
return;
}
ArgsType body;
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
body["mediaserverid"] = mediaServerId;
body["regist"] = bRegist;
body["schema"] = sender.getSchema();
body["vhost"] = sender.getVhost();
@@ -348,8 +347,6 @@ void installWebHook(){
static auto getRecordInfo = [](const RecordInfo &info) {
ArgsType body;
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
body["mediaserverid"] = mediaServerId;
body["start_time"] = (Json::UInt64) info.start_time;
body["file_size"] = (Json::UInt64) info.file_size;
body["time_len"] = info.time_len;
@@ -388,8 +385,6 @@ void installWebHook(){
return;
}
ArgsType body;
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
body["mediaserverid"] = mediaServerId;
body["ip"] = sender.get_peer_ip();
body["port"] = sender.get_peer_port();
body["id"] = sender.getIdentifier();
@@ -408,8 +403,6 @@ void installWebHook(){
}
ArgsType body;
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
body["mediaserverid"] = mediaServerId;
body["schema"] = sender.getSchema();
body["vhost"] = sender.getVhost();
body["app"] = sender.getApp();
@@ -455,8 +448,6 @@ void installWebHook(){
}
ArgsType body;
GET_CONFIG(string,mediaServerId,General::kMediaServerId);
body["mediaserverid"] = mediaServerId;
body["ip"] = sender.get_peer_ip();
body["port"] = sender.get_peer_port();
body["id"] = sender.getIdentifier();