mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Fix log issue
This commit is contained in:
parent
a36c0381e8
commit
715c70b6e0
4 changed files with 16 additions and 6 deletions
|
@ -412,7 +412,7 @@ rtc_server {
|
|||
# The exposed candidate IPs, response in SDP candidate line. It can be:
|
||||
# * Retrieve server IP automatically, from all network interfaces.
|
||||
# eth0 Retrieve server IP by specified network interface name. # TODO: Implements it.
|
||||
# $CANDIDATE Read the IP from ENV variable $EIP, use * if not set, see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
|
||||
# $CANDIDATE Read the IP from ENV variable, use * if not set, see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
|
||||
# x.x.x.x A specified IP address or DNS name, which can be access by client such as Chrome.
|
||||
# You can specific more than one interface name:
|
||||
# eth0 eth1 Use network interface eth0 and eth1. # TODO: Implements it.
|
||||
|
|
|
@ -28,6 +28,7 @@ rtc_server {
|
|||
# The * means retrieving server IP automatically, from all network interfaces,
|
||||
# @see https://github.com/ossrs/srs/issues/307#issuecomment-599028124
|
||||
candidate $CANDIDATE;
|
||||
#candidate 10.0.0.123;
|
||||
}
|
||||
|
||||
vhost __defaultVhost__ {
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <srs_service_utility.hpp>
|
||||
#include <srs_app_rtc_source.hpp>
|
||||
#include <srs_app_rtc_api.hpp>
|
||||
#include <srs_protocol_utility.hpp>
|
||||
|
||||
// @global dtls certficate for rtc module.
|
||||
SrsDtlsCertificate* _srs_rtc_dtls_certificate = new SrsDtlsCertificate();
|
||||
|
@ -331,11 +332,13 @@ srs_error_t SrsRtcServer::create_session(
|
|||
// We allows to mock the eip of server.
|
||||
if (!mock_eip.empty()) {
|
||||
local_sdp.add_candidate(mock_eip, _srs_config->get_rtc_server_listen(), "host");
|
||||
srs_trace("RTC: Use candidate mock_eip %s", mock_eip.c_str());
|
||||
} else {
|
||||
std::vector<string> candidate_ips = get_candidate_ips();
|
||||
for (int i = 0; i < (int)candidate_ips.size(); ++i) {
|
||||
local_sdp.add_candidate(candidate_ips[i], _srs_config->get_rtc_server_listen(), "host");
|
||||
}
|
||||
srs_trace("RTC: Use candidates %s", srs_join_vector_string(candidate_ips, ", ").c_str());
|
||||
}
|
||||
|
||||
SrsRtcSession* session = new SrsRtcSession(this);
|
||||
|
@ -357,7 +360,7 @@ srs_error_t SrsRtcServer::create_session(
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcServer::create_session2(SrsSdp& local_sdp, SrsRtcSession** psession)
|
||||
srs_error_t SrsRtcServer::create_session2(SrsSdp& local_sdp, const std::string& mock_eip, SrsRtcSession** psession)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -374,9 +377,15 @@ srs_error_t SrsRtcServer::create_session2(SrsSdp& local_sdp, SrsRtcSession** pse
|
|||
local_sdp.set_fingerprint(_srs_rtc_dtls_certificate->get_fingerprint());
|
||||
|
||||
// We allows to mock the eip of server.
|
||||
std::vector<string> candidate_ips = get_candidate_ips();
|
||||
for (int i = 0; i < (int)candidate_ips.size(); ++i) {
|
||||
local_sdp.add_candidate(candidate_ips[i], _srs_config->get_rtc_server_listen(), "host");
|
||||
if (!mock_eip.empty()) {
|
||||
local_sdp.add_candidate(mock_eip, _srs_config->get_rtc_server_listen(), "host");
|
||||
srs_trace("RTC: Use candidate mock_eip %s", mock_eip.c_str());
|
||||
} else {
|
||||
std::vector<string> candidate_ips = get_candidate_ips();
|
||||
for (int i = 0; i < (int)candidate_ips.size(); ++i) {
|
||||
local_sdp.add_candidate(candidate_ips[i], _srs_config->get_rtc_server_listen(), "host");
|
||||
}
|
||||
srs_trace("RTC: Use candidates %s", srs_join_vector_string(candidate_ips, ", ").c_str());
|
||||
}
|
||||
|
||||
session->set_local_sdp(local_sdp);
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
SrsRtcSession** psession
|
||||
);
|
||||
// We start offering, create_session2 to generate offer, setup_session2 to handle answer.
|
||||
srs_error_t create_session2(SrsSdp& local_sdp, SrsRtcSession** psession);
|
||||
srs_error_t create_session2(SrsSdp& local_sdp, const std::string& mock_eip, SrsRtcSession** psession);
|
||||
srs_error_t setup_session2(SrsRtcSession* session, SrsRequest* req, const SrsSdp& remote_sdp);
|
||||
// Destroy the session from server.
|
||||
void destroy(SrsRtcSession* session);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue