Added call transfer capability.

This commit is contained in:
Juha Heinanen
2020-08-23 13:26:28 +03:00
parent 035f89c2ee
commit b1ff3ecc0e
8 changed files with 120 additions and 18 deletions

View File

@ -1285,7 +1285,6 @@ Java_com_tutpro_baresip_Api_ua_1debug(JNIEnv *env, jobject thiz, jstring javaUA)
ua_debug_log(ua);
}
JNIEXPORT jint JNICALL
Java_com_tutpro_baresip_Call_call_1connect(JNIEnv *env, jobject thiz, jstring javaCall,
jstring javaPeer) {
@ -1375,6 +1374,22 @@ Java_com_tutpro_baresip_Call_call_1unhold(JNIEnv *env, jobject thiz, jstring jav
return ret;
}
JNIEXPORT jint JNICALL
Java_com_tutpro_baresip_Call_call_1transfer(JNIEnv *env, jobject thiz, jstring jCall,
jstring jPeer) {
const char *native_call = (*env)->GetStringUTFChars(env, jCall, 0);
const char *native_peer = (*env)->GetStringUTFChars(env, jPeer, 0);
struct call *call = (struct call *)strtoul(native_call, NULL, 10);
LOGD("transfering call %s to %s\n", native_call, native_peer);
re_thread_enter();
int err = call_transfer(call, native_peer);
re_thread_leave();
if (err) LOGW("call_transfer error: %d\n", err);
(*env)->ReleaseStringUTFChars(env, jCall, native_call);
(*env)->ReleaseStringUTFChars(env, jPeer, native_peer);
return err;
}
JNIEXPORT jstring JNICALL
Java_com_tutpro_baresip_Api_call_1peeruri(JNIEnv *env, jobject thiz, jstring javaCall)
{