- Try to avoid empty account uri, but setting it explicitly after new
account has been created.
This commit is contained in:
@ -8,7 +8,7 @@ class Account(val accp: String) {
|
||||
|
||||
var displayName = account_display_name(accp)
|
||||
val aor = account_aor(accp)
|
||||
val uri = account_uri(accp)
|
||||
var uri = account_uri(accp)
|
||||
var authUser = account_auth_user(accp)
|
||||
var authPass = account_auth_pass(accp)
|
||||
var outbound = ArrayList<String>()
|
||||
|
||||
@ -14,8 +14,6 @@ class AccountsActivity : AppCompatActivity() {
|
||||
|
||||
internal lateinit var alAdapter: AccountListAdapter
|
||||
|
||||
internal var aor = ""
|
||||
|
||||
public override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
@ -47,7 +45,8 @@ class AccountsActivity : AppCompatActivity() {
|
||||
Utils.alertView(this, getString(R.string.notice),
|
||||
getString(R.string.account_allocation_failure))
|
||||
} else {
|
||||
Log.d("Baresip", "Allocated UA ${ua.uap} for ${ua.account.uri}")
|
||||
Log.d("Baresip", "Allocated UA ${ua.uap} for $aor")
|
||||
ua.account.uri = "sip:$aor"
|
||||
newAorView.setText("")
|
||||
newAorView.hint = getString(R.string.user_domain)
|
||||
newAorView.clearFocus()
|
||||
@ -118,9 +117,13 @@ class AccountsActivity : AppCompatActivity() {
|
||||
|
||||
fun saveAccounts() {
|
||||
var accounts = ""
|
||||
for (a in Account.accounts()) accounts = accounts + a.print() + "\n"
|
||||
var count = 0
|
||||
for (a in Account.accounts()) {
|
||||
accounts = accounts + a.print() + "\n"
|
||||
count++
|
||||
}
|
||||
Utils.putFileContents(BaresipService.filesPath + "/accounts", accounts.toByteArray())
|
||||
Log.d("Baresip", "Saved accounts to '${BaresipService.filesPath}/accounts'")
|
||||
Log.d("Baresip", "Saved $count account(s) to '${BaresipService.filesPath}/accounts'")
|
||||
// Log.d("Baresip", "Saved accounts '${accounts}' to '${BaresipService.filesPath}/accounts'")
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.tutpro.baresip
|
||||
|
||||
class UserAgent (val uap: String) {
|
||||
class UserAgent(val uap: String) {
|
||||
|
||||
val account = Account(Api.ua_account(uap))
|
||||
var registrationFailed = false
|
||||
|
||||
Reference in New Issue
Block a user