Commit b6b8ee65 authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

SIP Account login harnessing

parent 328f12d1
...@@ -28,6 +28,7 @@ import org.linhome.LinhomeApplication.Companion.corePreferences ...@@ -28,6 +28,7 @@ import org.linhome.LinhomeApplication.Companion.corePreferences
import org.linhome.linphonecore.CorePreferences import org.linhome.linphonecore.CorePreferences
import org.linhome.linphonecore.extensions.cleanHistory import org.linhome.linphonecore.extensions.cleanHistory
import org.linphone.core.* import org.linphone.core.*
import org.linphone.core.tools.Log
object Account { object Account {
...@@ -58,15 +59,18 @@ object Account { ...@@ -58,15 +59,18 @@ object Account {
expiration: String, expiration: String,
pushReady: MutableLiveData<Boolean> pushReady: MutableLiveData<Boolean>
) { ) {
val proxyConfig: ProxyConfig? = accountCreator.createProxyConfig() accountCreator.createProxyConfig()?.also { proxyConfig ->
proxyConfig?.expires = expiration.toInt() Log.i("[Account] created proxyConfig with domain ${proxyConfig.domain}")
if (!TextUtils.isEmpty(proxy)) { proxyConfig.expires = expiration.toInt()
proxyConfig?.serverAddr = proxy if (!TextUtils.isEmpty(proxy)) {
proxyConfig.serverAddr = proxy
Log.i("[Account] Set proxyConfig server address to ${proxyConfig.serverAddr} for proxyConfig with domain ${proxyConfig.domain}")
}
if (pushGateway() != null)
linkProxiesWithPushGateway(pushReady)
else
createPushGateway(pushReady)
} }
if (pushGateway() != null)
linkProxiesWithPushGateway(pushReady)
else
createPushGateway(pushReady)
} }
fun pushGateway(): ProxyConfig? { fun pushGateway(): ProxyConfig? {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment