In accounts file, moved ;extra from last to middle

Use UTF_8 in accounts byte array
This commit is contained in:
Juha Heinanen
2023-03-30 10:50:29 +03:00
parent 7bdcd14183
commit 4285df80fb
2 changed files with 5 additions and 7 deletions

View File

@ -132,8 +132,6 @@ class Account(val accp: Long) {
if (answerMode == Api.ANSWERMODE_AUTO)
res += ";answermode=auto"
res += ";ptime=20;regint=${regint};regq=0.5;pubint=0;call_transfer=yes;100rel=no"
var extra = ""
if (nickName != "")
@ -154,6 +152,8 @@ class Account(val accp: Long) {
if (extra !="")
res += ";extra=\"" + extra.substringAfter(";") + "\""
res += ";ptime=20;regint=${regint};regq=0.5;pubint=0;call_transfer=yes;100rel=no"
return res
}

View File

@ -135,11 +135,9 @@ class AccountsActivity : AppCompatActivity() {
fun saveAccounts() {
var accounts = ""
for (a in Account.accounts()) {
accounts = accounts + a.print() + "\n"
}
Utils.putFileContents(BaresipService.filesPath + "/accounts", accounts.toByteArray())
// Log.e(TAG, "Saved accounts '${accounts}' to '${BaresipService.filesPath}/accounts'")
for (a in Account.accounts()) accounts = accounts + a.print() + "\n"
Utils.putFileContents(BaresipService.filesPath + "/accounts", accounts.toByteArray(Charsets.UTF_8))
// Log.d(TAG, "Saved accounts '${accounts}' to '${BaresipService.filesPath}/accounts'")
}
fun noAccounts(): Boolean {