Added Telephony Provider account configuration item

Added support for Contact tel URIs
Show account's STUN configuration items only if needed
Avoid some lint warnings in baresip.c
This commit is contained in:
Juha Heinanen
2022-02-02 11:36:08 +02:00
parent c285719da1
commit d3a2282f03
12 changed files with 291 additions and 156 deletions
@@ -3,6 +3,8 @@ package com.tutpro.baresip
import android.content.Context
import java.util.*
import kotlin.collections.ArrayList
import java.net.URLEncoder
import java.net.URLDecoder
class Account(val accp: String) {
@@ -28,6 +30,7 @@ class Account(val accp: String) {
var missedCalls = false
var unreadMessages = false
var callHistory = true
var telProvider = Utils.aorDomain(aor)
var resumeUri = ""
init {
@@ -56,6 +59,10 @@ class Account(val accp: String) {
val extra = Api.account_extra(accp)
callHistory = Utils.paramValue(extra,"call_history") == ""
telProvider = if (Utils.paramExists(extra, "tel_provider"))
URLDecoder.decode(Utils.paramValue(extra,"tel_provider"), "UTF-8")
else
Utils.aorDomain(aor)
}
@@ -119,6 +126,8 @@ class Account(val accp: String) {
if (!callHistory)
extra += ";call_history=no"
extra += ";tel_provider=${URLEncoder.encode(telProvider, "UTF-8")}"
if (extra != "")
res += ";extra=\"" + extra.substringAfter(";") + "\""