- Introduced new config variables 'opus_samplerate', 'opus_stereo',
and 'opus_sprop_stereo'. - Set 'opus_samplerate' to 16000 and 'opus[_sprop]_stereo' to "no" in order to support acoustic echo cancellation also when opus codec is in use. - Renamed 'prefer_ipv6' config variable to 'net_prefer_ipv6'.
This commit is contained in:
@ -19,7 +19,7 @@ rtcp_mux no
|
||||
jitter_buffer_delay 5-10
|
||||
rtp_stats no
|
||||
dyn_dns yes
|
||||
prefer_ipv6 no
|
||||
net_prefer_ipv6 no
|
||||
module ilbc.so
|
||||
module g7221.so
|
||||
module g711.so
|
||||
@ -39,9 +39,12 @@ module_app debug_cmd.so
|
||||
module_app mwi.so
|
||||
evdev_device /dev/input/event0
|
||||
opus_bitrate 28000
|
||||
opus_samplerate 16000
|
||||
opus_cbr no
|
||||
opus_inbandfec yes
|
||||
opus_application voip
|
||||
opus_stereo no
|
||||
opus_sprop_stereo no
|
||||
ice_turn no
|
||||
ice_debug no
|
||||
ice_nomination regular
|
||||
|
||||
@ -37,6 +37,22 @@ object Config {
|
||||
config = "${config}opus_application voip\n"
|
||||
write = true
|
||||
}
|
||||
if (!config.contains("opus_samplerate")) {
|
||||
config = "${config}opus_samplerate 16000\n"
|
||||
val accountsFile = File(BaresipService.filesPath + "/config")
|
||||
var accounts = Utils.getFileContents(accountsFile)
|
||||
accounts = accounts.replace("opus/48000/1", "opus/16000/1")
|
||||
Utils.putFileContents(accountsFile, accounts)
|
||||
write = true
|
||||
}
|
||||
if (!config.contains("opus_stereo")) {
|
||||
config = "${config}opus_stereo no\n"
|
||||
write = true
|
||||
}
|
||||
if (!config.contains("opus_sprop_stereo")) {
|
||||
config = "${config}opus_sprop_stereo no\n"
|
||||
write = true
|
||||
}
|
||||
if (!config.contains("log_level")) {
|
||||
config = "${config}log_level 2\n"
|
||||
Api.log_level_set(2)
|
||||
@ -47,9 +63,16 @@ object Config {
|
||||
Api.log_level_set(ll)
|
||||
Log.logLevelSet(ll)
|
||||
}
|
||||
if (!config.contains("prefer_ipv6")) {
|
||||
config = "prefer_ipv6 no\n${config}"
|
||||
val preferIpv6 = variable("prefer_ipv6")
|
||||
if (preferIpv6.size > 0) {
|
||||
remove("prefer_ipv6")
|
||||
config = "net_prefer_ipv6 ${preferIpv6[0]}\n${config}"
|
||||
write = true
|
||||
} else {
|
||||
if (!config.contains("net_prefer_ipv6")) {
|
||||
config = "net_prefer_ipv6 no\n${config}"
|
||||
write = true
|
||||
}
|
||||
}
|
||||
if (!config.contains("call_volume")) {
|
||||
config = "${config}call_volume 0\n"
|
||||
|
||||
@ -52,7 +52,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
listenAddr.setText(oldListenAddr)
|
||||
|
||||
preferIPv6 = findViewById(R.id.PreferIPv6) as CheckBox
|
||||
val piCv = Config.variable("prefer_ipv6")
|
||||
val piCv = Config.variable("net_prefer_ipv6")
|
||||
oldPreferIPv6 = if (piCv.size == 0) "no" else piCv[0]
|
||||
preferIPv6.isChecked = oldPreferIPv6 == "yes"
|
||||
|
||||
@ -154,7 +154,7 @@ class ConfigActivity : AppCompatActivity() {
|
||||
var preferIPv6String = "no"
|
||||
if (preferIPv6.isChecked) preferIPv6String = "yes"
|
||||
if (oldPreferIPv6 != preferIPv6String) {
|
||||
Config.replace("prefer_ipv6", preferIPv6String)
|
||||
Config.replace("net_prefer_ipv6", preferIPv6String)
|
||||
save = true
|
||||
restart = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user