[core] add audio channels limit when opening files, configurable through switch.conf.xml (param "max-audio-channels"), add unit-test.

This commit is contained in:
Dragos Oancea committed 2020-01-27 23:35:19 +00:00
1 parent e94d8cfdfc
commit c1b66f650f
7 files changed
+71 -1

No files matched your search

+11
View File
@@ -2383,6 +2383,8 @@ static void switch_load_core_config(const char *file)
} else {
switch_clear_flag((&runtime), SCF_EVENT_CHANNEL_LOG_UNDELIVERABLE_JSON);
}
} else if (!strcasecmp(var, "max-audio-channels") && !zstr(val)) {
switch_core_max_audio_channels(atoi(val));
}
}
}
@@ -2638,6 +2640,15 @@ SWITCH_DECLARE(int32_t) switch_core_sessions_peak_fivemin(void)
return runtime.sessions_peak_fivemin;
}
SWITCH_DECLARE(uint32_t) switch_core_max_audio_channels(uint32_t limit)
{
if (limit) {
runtime.max_audio_channels = limit;
}
return runtime.max_audio_channels;
}
SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, void *val)
{
int *intval = (int *) val;