- Surround contact URIs between < and > only when contacts are saved to file.

This commit is contained in:
Juha Heinanen
2019-06-06 11:45:29 +03:00
parent c66e20a6ed
commit 8ca30cfe16
3 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
"The test call" <sip:thetestcall@opensips.org>
"The Test Call" <sip:thetestcall@opensips.org>

View File

@ -119,7 +119,7 @@ class BaresipService: Service() {
val wm = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
fl = wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Baresip")
val assets = arrayOf("accounts", "contacts", "config", "busy.wav", "callwaiting.wav",
val assets = arrayOf("accounts", "config", "contacts", "busy.wav", "callwaiting.wav",
"error.wav", "notfound.wav", "ring.wav", "ringback.wav")
var file = File(filesPath)
if (!file.exists()) {

View File

@ -96,7 +96,7 @@ class ContactsActivity : AppCompatActivity() {
fun saveContacts(path: File, file: String): Boolean {
var contents = ""
for (c in Contact.contacts())
contents += "\"${c.name}\" ${c.uri}\n"
contents += "\"${c.name}\" <${c.uri}>\n"
return Utils.putFileContents(File(path, file), contents)
}
@ -109,7 +109,7 @@ class ContactsActivity : AppCompatActivity() {
val parts = it.split("\"")
if (parts.size == 3) {
val name = parts[1]
val uri = parts[2].trim()
val uri = parts[2].trim().substringAfter("<").substringBefore(">")
// Currently no need to make baresip aware of the contact
// Api.contact_add("\"$name\" $uri")
Contact.contacts().add(Contact(name, uri))