Added constant REGISTRATION_INTERVAL with value 900

This commit is contained in:
Juha Heinanen
2022-06-06 15:49:50 +03:00
parent 59288033ef
commit d612f13bc1
3 changed files with 7 additions and 4 deletions

View File

@ -147,7 +147,7 @@ class AccountActivity : AppCompatActivity() {
if (text.isNotEmpty())
acc.outbound.add(text)
"register" ->
acc.regint = if (text == "yes") 3600 else 0
acc.regint = if (text == "yes") REGISTRATION_INTERVAL else 0
"audio-codec" ->
if (text in audioCodecs)
acc.audioCodec.add(text)
@ -452,8 +452,8 @@ class AccountActivity : AppCompatActivity() {
var newRegint = -1
if (regCheck.isChecked) {
if (acc.regint != 3600) {
newRegint = 3600
if (acc.regint != REGISTRATION_INTERVAL) {
newRegint = REGISTRATION_INTERVAL
ua.status = R.drawable.dot_yellow
}
} else {

View File

@ -25,3 +25,6 @@ const val MESSAGE_REQ_CODE = 8
const val REPLY_REQ_CODE = 9
const val SAVE_REQ_CODE = 10
const val DELETE_REQ_CODE = 11
const val REGISTRATION_INTERVAL = 900

View File

@ -24,7 +24,7 @@ class TaskReceiver : BroadcastReceiver() {
when (intent.action) {
"com.tutpro.baresip.REGISTER" -> {
Log.d(TAG, "TaskReceiver: registering $aor")
Api.account_set_regint(acc.accp,3600)
Api.account_set_regint(acc.accp, REGISTRATION_INTERVAL)
Api.ua_update_account(ua.uap)
if (!Api.ua_isregistered(ua.uap))
Api.ua_register(ua.uap)