From e0422ee7228a68185b60da5c0487a5e3362c9377 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Fri, 25 May 2018 17:28:05 +0300 Subject: [PATCH] fixed hold/unhold native functions --- app/src/main/cpp/baresip.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c index 447d5fdc..ce1980c0 100644 --- a/app/src/main/cpp/baresip.c +++ b/app/src/main/cpp/baresip.c @@ -746,8 +746,10 @@ JNIEXPORT jint JNICALL Java_com_tutpro_baresip_MainActivity_call_1hold(JNIEnv *env, jobject thiz, jstring javaCall) { const char *native_call = (*env)->GetStringUTFChars(env, javaCall, 0); + struct call *call = (struct call *) strtoul(native_call, NULL, 10); + LOGD("holding call %s\n", native_call); - int res = call_hold(ua_call(uag_current()), true); + int res = call_hold(call, true); (*env)->ReleaseStringUTFChars(env, javaCall, native_call); return res; } @@ -756,8 +758,10 @@ JNIEXPORT jint JNICALL Java_com_tutpro_baresip_MainActivity_call_1unhold(JNIEnv *env, jobject thiz, jstring javaCall) { const char *native_call = (*env)->GetStringUTFChars(env, javaCall, 0); - LOGD("holding call %s\n", native_call); - int res = call_hold(ua_call(uag_current()), false); + struct call *call = (struct call *) strtoul(native_call, NULL, 10); + + LOGD("unholding call %s\n", native_call); + int res = call_hold(call, false); (*env)->ReleaseStringUTFChars(env, javaCall, native_call); return res; }