mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #307, support config RTC session timeout
This commit is contained in:
parent
8e0f83fdd2
commit
e6e8605304
5 changed files with 36 additions and 4 deletions
|
@ -4780,6 +4780,24 @@ bool SrsConfig::get_rtc_aac_discard(string vhost)
|
|||
return conf->arg0() == "discard";
|
||||
}
|
||||
|
||||
srs_utime_t SrsConfig::get_rtc_stun_timeout(string vhost)
|
||||
{
|
||||
static srs_utime_t DEFAULT = 30 * SRS_UTIME_SECONDS;
|
||||
|
||||
SrsConfDirective* conf = get_rtc(vhost);
|
||||
|
||||
if (!conf) {
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
conf = conf->get("stun_timeout");
|
||||
if (!conf || conf->arg0().empty()) {
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
return (srs_utime_t)(::atoi(conf->arg0().c_str()) * SRS_UTIME_SECONDS);
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_vhost(string vhost, bool try_default_vhost)
|
||||
{
|
||||
srs_assert(root);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue