Now also ( and ) characters are accepted in telephone number and
filtered out when constructing SIP URI
This commit is contained in:
@@ -323,7 +323,7 @@ object Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun isTelNumber(no: String): Boolean {
|
fun isTelNumber(no: String): Boolean {
|
||||||
return no.isNotEmpty() && Regex("^([+][1-9])?[0-9- ]{0,15}\$").matches(no)
|
return no.isNotEmpty() && Regex("^([+][1-9])?[0-9- ()]{0,20}\$").matches(no)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isTelUri(uri: String): Boolean {
|
fun isTelUri(uri: String): Boolean {
|
||||||
@@ -339,7 +339,7 @@ object Utils {
|
|||||||
account.telProvider
|
account.telProvider
|
||||||
else
|
else
|
||||||
aorDomain(account.aor)
|
aorDomain(account.aor)
|
||||||
return "sip:" + telUri.substring(4).filterNot{setOf('-', ' ').contains(it)} +
|
return "sip:" + telUri.substring(4).filterNot{setOf('-', ' ', '(', ')').contains(it)} +
|
||||||
"@" + hostPart + ";user=phone"
|
"@" + hostPart + ";user=phone"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user