added handing on Hangup to call button onclick listener
This commit is contained in:
@@ -165,14 +165,23 @@ class MainActivity : AppCompatActivity() {
|
|||||||
callButton.setOnClickListener {
|
callButton.setOnClickListener {
|
||||||
Log.d("Baresip", "AoR at position is " + aors[aorSpinner.selectedItemPosition])
|
Log.d("Baresip", "AoR at position is " + aors[aorSpinner.selectedItemPosition])
|
||||||
val aor = aors[aorSpinner.selectedItemPosition]
|
val aor = aors[aorSpinner.selectedItemPosition]
|
||||||
if (callButton.text.toString() == "Call") {
|
when (callButton.text.toString()) {
|
||||||
|
"Call" -> {
|
||||||
call(aor, (findViewById(R.id.callee) as EditText).text.toString())
|
call(aor, (findViewById(R.id.callee) as EditText).text.toString())
|
||||||
} else {
|
}
|
||||||
|
"Cancel" -> {
|
||||||
Log.i("Baresip", "Canceling UA " + aor_ua(aor) + " call " +
|
Log.i("Baresip", "Canceling UA " + aor_ua(aor) + " call " +
|
||||||
callsOut[0].call + " to " +
|
callsOut[0].call + " to " +
|
||||||
(findViewById(R.id.callee) as EditText).text)
|
(findViewById(R.id.callee) as EditText).text)
|
||||||
ua_hangup(aor_ua(aor), callsOut[0].call, 486, "Rejected")
|
ua_hangup(aor_ua(aor), callsOut[0].call, 486, "Rejected")
|
||||||
}
|
}
|
||||||
|
"Hangup" -> {
|
||||||
|
Log.i("Baresip", "Hanging up UA " + aor_ua(aor) + " call " +
|
||||||
|
callsOut[0].call + " to " +
|
||||||
|
(findViewById(R.id.callee) as EditText).text)
|
||||||
|
ua_hangup(aor_ua(aor), callsOut[0].call,0, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val holdButton = findViewById(R.id.holdButton) as Button
|
val holdButton = findViewById(R.id.holdButton) as Button
|
||||||
|
|||||||
Reference in New Issue
Block a user