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
import org.linhome.linphonecore.CorePreferences
import org.linhome.linphonecore.extensions.cleanHistory
import org.linphone.core.*
import org.linphone.core.tools.Log
object Account {
......@@ -58,16 +59,19 @@ object Account {
expiration: String,
pushReady: MutableLiveData<Boolean>
) {
val proxyConfig: ProxyConfig? = accountCreator.createProxyConfig()
proxyConfig?.expires = expiration.toInt()
accountCreator.createProxyConfig()?.also { proxyConfig ->
Log.i("[Account] created proxyConfig with domain ${proxyConfig.domain}")
proxyConfig.expires = expiration.toInt()
if (!TextUtils.isEmpty(proxy)) {
proxyConfig?.serverAddr = 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)
}
}
fun pushGateway(): ProxyConfig? {
return coreContext.core.getProxyConfigByIdkey(PUSH_GW_ID_KEY)
......
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