Fixed STUN setting not working on non-sip.linphone.org accounts
This commit is contained in:
parent
7b7c803736
commit
d9c3800596
1 changed files with 9 additions and 2 deletions
|
@ -297,8 +297,15 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
||||||
val stunServerListener = object : SettingListenerStub() {
|
val stunServerListener = object : SettingListenerStub() {
|
||||||
override fun onTextValueChanged(newValue: String) {
|
override fun onTextValueChanged(newValue: String) {
|
||||||
val params = account.params.clone()
|
val params = account.params.clone()
|
||||||
|
if (params.natPolicy == null) {
|
||||||
|
Log.w("[Account Settings] No NAT Policy object in account params yet")
|
||||||
|
val natPolicy = core.createNatPolicy()
|
||||||
|
natPolicy.stunServer = newValue
|
||||||
|
params.natPolicy = natPolicy
|
||||||
|
} else {
|
||||||
params.natPolicy?.stunServer = newValue
|
params.natPolicy?.stunServer = newValue
|
||||||
if (newValue.isEmpty()) ice.value = false
|
if (newValue.isEmpty()) ice.value = false
|
||||||
|
}
|
||||||
stunServer.value = newValue
|
stunServer.value = newValue
|
||||||
account.params = params
|
account.params = params
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue