diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 98418983..a1abf642 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1535,7 +1535,11 @@ void installWebApi() { obj["vhost"] = vec[0]; obj["app"] = vec[1]; obj["stream_id"] = vec[2]; - obj["port"] = pr.second->getPort(); + auto& rtps = pr.second; + obj["port"] = rtps->getPort(); + obj["ssrc"] = rtps->getSSRC(); + obj["tcp_mode"] = rtps->getTcpMode(); + obj["only_track"] = rtps->getOnlyTrack(); val["data"].append(obj); } }); diff --git a/src/Rtp/RtpServer.cpp b/src/Rtp/RtpServer.cpp index ebd3db9b..a66423d4 100644 --- a/src/Rtp/RtpServer.cpp +++ b/src/Rtp/RtpServer.cpp @@ -295,5 +295,13 @@ void RtpServer::updateSSRC(uint32_t ssrc) { } } +uint32_t RtpServer::getSSRC() const { + if (_ssrc) + return *_ssrc; + else if (_tcp_server) + return (*_tcp_server)[RtpSession::kSSRC]; + return 0; +} + }//namespace mediakit #endif//defined(ENABLE_RTPPROXY) diff --git a/src/Rtp/RtpServer.h b/src/Rtp/RtpServer.h index daf5b6e0..739ecf87 100644 --- a/src/Rtp/RtpServer.h +++ b/src/Rtp/RtpServer.h @@ -97,6 +97,9 @@ public: */ void updateSSRC(uint32_t ssrc); + uint32_t getSSRC() const; + int getOnlyTrack() const { return _only_track; } + TcpMode getTcpMode() const { return _tcp_mode; } private: // tcp主动模式连接服务器成功回调 [AUTO-TRANSLATED:0775844e] // tcp active mode connection server success callback