mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-28 22:24:16 +00:00
[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:
1 parent
e94d8cfdfc
commit
c1b66f650f
7 files changed
+71
-1
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user