- Surround contact URIs between < and > only when contacts are saved to file.
This commit is contained in:
@ -1 +1 @@
|
|||||||
"The test call" <sip:thetestcall@opensips.org>
|
"The Test Call" <sip:thetestcall@opensips.org>
|
||||||
|
|||||||
@ -119,7 +119,7 @@ class BaresipService: Service() {
|
|||||||
val wm = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
val wm = applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
||||||
fl = wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, "Baresip")
|
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")
|
"error.wav", "notfound.wav", "ring.wav", "ringback.wav")
|
||||||
var file = File(filesPath)
|
var file = File(filesPath)
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
|
|||||||
@ -96,7 +96,7 @@ class ContactsActivity : AppCompatActivity() {
|
|||||||
fun saveContacts(path: File, file: String): Boolean {
|
fun saveContacts(path: File, file: String): Boolean {
|
||||||
var contents = ""
|
var contents = ""
|
||||||
for (c in Contact.contacts())
|
for (c in Contact.contacts())
|
||||||
contents += "\"${c.name}\" ${c.uri}\n"
|
contents += "\"${c.name}\" <${c.uri}>\n"
|
||||||
return Utils.putFileContents(File(path, file), contents)
|
return Utils.putFileContents(File(path, file), contents)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ class ContactsActivity : AppCompatActivity() {
|
|||||||
val parts = it.split("\"")
|
val parts = it.split("\"")
|
||||||
if (parts.size == 3) {
|
if (parts.size == 3) {
|
||||||
val name = parts[1]
|
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
|
// Currently no need to make baresip aware of the contact
|
||||||
// Api.contact_add("\"$name\" $uri")
|
// Api.contact_add("\"$name\" $uri")
|
||||||
Contact.contacts().add(Contact(name, uri))
|
Contact.contacts().add(Contact(name, uri))
|
||||||
|
|||||||
Reference in New Issue
Block a user