mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
API: Add service_id for http_hooks, which identify the process, v6.0.28, v5.0.142 (#3424)
Co-authored-by: Winlin <winlin@vip.126.com> Co-authored-by: Haibo Chen <495810242@qq.com>
This commit is contained in:
parent
b75668b509
commit
733aeaa641
4 changed files with 14 additions and 2 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
|||
|
||||
## SRS 6.0 Changelog
|
||||
|
||||
* v6.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v6.0.28 (#3424)
|
||||
* v6.0, 2023-02-22, Compatible with legacy RTMP URL. v6.0.27
|
||||
* v6.0, 2023-02-16, Merge [#3411](https://github.com/ossrs/srs/pull/3411): HEVC: Fix nalu vec duplicate when h265 vps/sps/pps demux. v6.0.26 (#3411)
|
||||
* v6.0, 2023-02-14, Merge [#3408](https://github.com/ossrs/srs/pull/3408): GB: Support H.265 for GB28181. v6.0.25 (#3408)
|
||||
|
@ -41,6 +42,7 @@ The changelog for SRS.
|
|||
|
||||
## SRS 5.0 Changelog
|
||||
|
||||
* v5.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v5.0.142 (#3424)
|
||||
* v5.0, 2023-02-22, Compatible with legacy RTMP URL. v5.0.142
|
||||
* v5.0, 2023-02-12, Merge [#3409](https://github.com/ossrs/srs/pull/3409): SRT: Reduce latency to 200ms of srt2rtc.conf. v5.0.141 (#3409)
|
||||
* v5.0, 2023-02-08, Merge [#3391](https://github.com/ossrs/srs/pull/3391): Config: Error when both HLS and HTTP-TS enabled. v5.0.140 (#3391)
|
||||
|
|
|
@ -53,6 +53,7 @@ srs_error_t SrsHttpHooks::on_connect(string url, SrsRequest* req)
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_connect"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -91,6 +92,7 @@ void SrsHttpHooks::on_close(string url, SrsRequest* req, int64_t send_bytes, int
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_close"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -130,6 +132,7 @@ srs_error_t SrsHttpHooks::on_publish(string url, SrsRequest* req)
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_publish"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -173,6 +176,7 @@ void SrsHttpHooks::on_unpublish(string url, SrsRequest* req)
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_unpublish"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -219,6 +223,7 @@ srs_error_t SrsHttpHooks::on_play(string url, SrsRequest* req)
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_play"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -263,6 +268,7 @@ void SrsHttpHooks::on_stop(string url, SrsRequest* req)
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_stop"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -310,6 +316,7 @@ srs_error_t SrsHttpHooks::on_dvr(SrsContextId c, string url, SrsRequest* req, st
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_dvr"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -362,6 +369,7 @@ srs_error_t SrsHttpHooks::on_hls(SrsContextId c, string url, SrsRequest* req, st
|
|||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("action", SrsJsonAny::str("on_hls"));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
|
@ -413,6 +421,7 @@ srs_error_t SrsHttpHooks::on_hls_notify(SrsContextId c, std::string url, SrsRequ
|
|||
SrsStatistic* stat = SrsStatistic::instance();
|
||||
|
||||
url = srs_string_replace(url, "[server_id]", stat->server_id().c_str());
|
||||
url = srs_string_replace(url, "[service_id]", stat->service_id().c_str());
|
||||
url = srs_string_replace(url, "[app]", req->app);
|
||||
url = srs_string_replace(url, "[stream]", req->stream);
|
||||
url = srs_string_replace(url, "[ts_url]", ts_url);
|
||||
|
@ -537,6 +546,7 @@ srs_error_t SrsHttpHooks::on_forward_backend(string url, SrsRequest* req, std::v
|
|||
|
||||
obj->set("action", SrsJsonAny::str("on_forward"));
|
||||
obj->set("server_id", SrsJsonAny::str(stat->server_id().c_str()));
|
||||
obj->set("service_id", SrsJsonAny::str(stat->service_id().c_str()));
|
||||
obj->set("client_id", SrsJsonAny::str(cid.c_str()));
|
||||
obj->set("ip", SrsJsonAny::str(req->ip.c_str()));
|
||||
obj->set("vhost", SrsJsonAny::str(req->vhost.c_str()));
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 142
|
||||
#define VERSION_REVISION 143
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 6
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 27
|
||||
#define VERSION_REVISION 28
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue