- Allow port in account's AoR.
- Fixed checking if account already exists.
This commit is contained in:
@@ -200,7 +200,7 @@ class Account(val accp: String) {
|
|||||||
|
|
||||||
fun exists(aor: String): Boolean {
|
fun exists(aor: String): Boolean {
|
||||||
for (ua in UserAgent.uas()) {
|
for (ua in UserAgent.uas()) {
|
||||||
if (ua.account.aor == aor) return true
|
if (ua.account.aor == "sip:$aor") return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,12 @@ object Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun checkAor(aor: String): Boolean {
|
fun checkAor(aor: String): Boolean {
|
||||||
return checkUriUser(aorUser(aor)) && checkDomain(aorDomain(aor))
|
val parts = aor.split(":")
|
||||||
|
if (parts.size == 1)
|
||||||
|
return checkUriUser(aorUser(aor)) && checkDomain(aorDomain(aor))
|
||||||
|
else
|
||||||
|
return checkUriUser(aorUser(parts[0])) && checkDomain(aorDomain(parts[0])) &&
|
||||||
|
checkPort(parts[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkTelNo(no: String): Boolean {
|
fun checkTelNo(no: String): Boolean {
|
||||||
|
|||||||
@@ -92,8 +92,8 @@
|
|||||||
|
|
||||||
<!-- Accounts Activity -->
|
<!-- Accounts Activity -->
|
||||||
<string name="accounts">Accounts</string>
|
<string name="accounts">Accounts</string>
|
||||||
<string name="user_domain">user@domain</string>
|
<string name="user_domain">user@domain[:port]</string>
|
||||||
<string name="invalid_aor">Invalid user@domain \'%1$s\'</string>
|
<string name="invalid_aor">Invalid user@domain[:port] \'%1$s\'</string>
|
||||||
<string name="account_exists">Account \'%1$s\' already exists.</string>
|
<string name="account_exists">Account \'%1$s\' already exists.</string>
|
||||||
<string name="account_allocation_failure">"Failed to allocate new account.</string>
|
<string name="account_allocation_failure">"Failed to allocate new account.</string>
|
||||||
<string name="encrypt_password">Encrypt Password</string>
|
<string name="encrypt_password">Encrypt Password</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user