spin to incoming call
This commit is contained in:
@@ -748,16 +748,16 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
"registered" -> {
|
"registered" -> {
|
||||||
Log.d("Baresip", "Setting status to green")
|
Log.d("Baresip", "Setting status to green")
|
||||||
images[account_index] = R.drawable.dot_green
|
|
||||||
this@MainActivity.runOnUiThread {
|
this@MainActivity.runOnUiThread {
|
||||||
|
images[account_index] = R.drawable.dot_green
|
||||||
uaAdapter.notifyDataSetChanged()
|
uaAdapter.notifyDataSetChanged()
|
||||||
updateNotification()
|
updateNotification()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"registering failed" -> {
|
"registering failed" -> {
|
||||||
Log.d("Baresip", "Setting status to red")
|
Log.d("Baresip", "Setting status to red")
|
||||||
images[account_index] = R.drawable.dot_red
|
|
||||||
this@MainActivity.runOnUiThread {
|
this@MainActivity.runOnUiThread {
|
||||||
|
images[account_index] = R.drawable.dot_red
|
||||||
uaAdapter.notifyDataSetChanged()
|
uaAdapter.notifyDataSetChanged()
|
||||||
updateNotification()
|
updateNotification()
|
||||||
}
|
}
|
||||||
@@ -832,13 +832,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val peer_uri = call_peeruri(callp)
|
val peer_uri = call_peeruri(callp)
|
||||||
Log.d("Baresip", "Incoming call $uap/$callp/$peer_uri")
|
Log.d("Baresip", "Incoming call $uap/$callp/$peer_uri")
|
||||||
val new_call = Call(callp, ua, peer_uri, "in", "Answer", null)
|
val new_call = Call(callp, ua, peer_uri, "in", "Answer", null)
|
||||||
calls.add(new_call)
|
|
||||||
this@MainActivity.runOnUiThread {
|
this@MainActivity.runOnUiThread {
|
||||||
if (ua == uas[aorSpinner.selectedItemPosition]) {
|
calls.add(new_call)
|
||||||
addCallViews(ua, new_call, Call.calls(calls, "in").size * 10)
|
am.mode = AudioManager.MODE_RINGTONE
|
||||||
}
|
aorSpinner.setSelection(UserAgent.findAorIndex(uas, aor)!!)
|
||||||
}
|
}
|
||||||
am.mode = AudioManager.MODE_RINGTONE
|
|
||||||
val i = Intent(this, MainActivity::class.java)
|
val i = Intent(this, MainActivity::class.java)
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
@@ -992,6 +990,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
else -> Log.d("Baresip", "Unknown event '${ev[0]}'")
|
else -> Log.d("Baresip", "Unknown event '${ev[0]}'")
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user