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
@@ -147,7 +147,7 @@ class AccountActivity : AppCompatActivity() {
if (text.isNotEmpty()) if (text.isNotEmpty())
acc.outbound.add(text) acc.outbound.add(text)
"register" -> "register" ->
acc.regint = if (text == "yes") 3600 else 0 acc.regint = if (text == "yes") REGISTRATION_INTERVAL else 0
"audio-codec" -> "audio-codec" ->
if (text in audioCodecs) if (text in audioCodecs)
acc.audioCodec.add(text) acc.audioCodec.add(text)
@@ -452,8 +452,8 @@ class AccountActivity : AppCompatActivity() {
var newRegint = -1 var newRegint = -1
if (regCheck.isChecked) { if (regCheck.isChecked) {
if (acc.regint != 3600) { if (acc.regint != REGISTRATION_INTERVAL) {
newRegint = 3600 newRegint = REGISTRATION_INTERVAL
ua.status = R.drawable.dot_yellow ua.status = R.drawable.dot_yellow
} }
} else { } else {
@@ -25,3 +25,6 @@ const val MESSAGE_REQ_CODE = 8
const val REPLY_REQ_CODE = 9 const val REPLY_REQ_CODE = 9
const val SAVE_REQ_CODE = 10 const val SAVE_REQ_CODE = 10
const val DELETE_REQ_CODE = 11 const val DELETE_REQ_CODE = 11
const val REGISTRATION_INTERVAL = 900
@@ -24,7 +24,7 @@ class TaskReceiver : BroadcastReceiver() {
when (intent.action) { when (intent.action) {
"com.tutpro.baresip.REGISTER" -> { "com.tutpro.baresip.REGISTER" -> {
Log.d(TAG, "TaskReceiver: registering $aor") 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) Api.ua_update_account(ua.uap)
if (!Api.ua_isregistered(ua.uap)) if (!Api.ua_isregistered(ua.uap))
Api.ua_register(ua.uap) Api.ua_register(ua.uap)