mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
rtp session manager, stun codding
This commit is contained in:
parent
bc22ebe949
commit
51abb0844e
10 changed files with 356 additions and 19 deletions
|
@ -46,6 +46,7 @@ using namespace std;
|
|||
#include <srs_protocol_amf0.hpp>
|
||||
#include <srs_protocol_utility.hpp>
|
||||
#include <srs_app_coworkers.hpp>
|
||||
#include <srs_app_rtc_udp.hpp>
|
||||
|
||||
string test_sdp =
|
||||
"v=0\\r\\n"
|
||||
|
@ -847,8 +848,9 @@ srs_error_t SrsGoApiStreams::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
|
|||
return srs_api_response(w, r, obj->dumps());
|
||||
}
|
||||
|
||||
SrsGoApiSdp::SrsGoApiSdp()
|
||||
SrsGoApiSdp::SrsGoApiSdp(SrsServer* svr)
|
||||
{
|
||||
server = svr;
|
||||
}
|
||||
|
||||
SrsGoApiSdp::~SrsGoApiSdp()
|
||||
|
@ -872,6 +874,14 @@ srs_error_t SrsGoApiSdp::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage*
|
|||
|
||||
SrsJsonObject* obj = SrsJsonAny::object();
|
||||
SrsAutoFree(SrsJsonObject, obj);
|
||||
|
||||
SrsRtcListener* rtc_listener = dynamic_cast<SrsRtcListener*>(server->find_listener(SrsListenerRtcOverUdp));
|
||||
if (rtc_listener == NULL) {
|
||||
return srs_go_http_error(w, SRS_CONSTS_HTTP_Unauthorized);
|
||||
}
|
||||
|
||||
SrsRtcOverUdp* rtc = rtc_listener->get_rtc();
|
||||
rtc->create_rtc_session("192.168.170.169", "xiaozhihongjohn", "ok");
|
||||
|
||||
obj->set("code", SrsJsonAny::integer(ERROR_SUCCESS));
|
||||
obj->set("server", SrsJsonAny::integer(stat->server_id()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue