- Moved call related API functions to Call class.

This commit is contained in:
Juha Heinanen
2020-04-28 17:21:37 +03:00
parent ac32540a9b
commit 2d39c284b7
6 changed files with 98 additions and 33 deletions
@@ -11,10 +11,66 @@ class Call(val callp: String, val ua: UserAgent, val peerURI: String, val dir: S
var zid = ""
var hasHistory = false
fun connect(uri: String): Int {
return call_connect(callp, uri)
}
fun startAudio() {
call_start_audio(callp)
}
fun stopAudio() {
call_stop_audio(callp)
}
fun hold(): Int {
return call_hold(callp)
}
fun unhold(): Int {
return call_unhold(callp)
}
fun sendDigit(digit: Char): Int {
return call_send_digit(callp, digit)
}
fun notifySipfrag(code: Int, reason: String) {
call_notify_sipfrag(callp, code, reason)
}
fun hasVideo(): Boolean {
return call_has_video(callp)
}
fun peerUri(): String {
return call_peeruri(callp)
}
fun status(): String {
return call_status(callp)
}
fun audioCodecs(): String {
return call_audio_codecs(callp)
}
init {
if (ua.account.mediaEnc != "") security = R.drawable.box_red
}
private external fun call_connect(callp: String, peer_uri: String): Int
private external fun call_hold(callp: String): Int
private external fun call_unhold(callp: String): Int
private external fun call_peeruri(callp: String): String
private external fun call_send_digit(callp: String, digit: Char): Int
private external fun call_notify_sipfrag(callp: String, code: Int, reason: String)
private external fun call_start_audio(callp: String)
private external fun call_stop_audio(callp: String)
private external fun call_audio_codecs(callp: String): String
private external fun call_status(callp: String): String
private external fun call_has_video(callp: String): Boolean
companion object {
fun calls(): ArrayList<Call> {