improved implementation of call hold/unhold based on new upstream feature

This commit is contained in:
Juha Heinanen
2018-06-18 21:37:58 +03:00
parent 45610b7fd4
commit c0172966a1

View File

@ -838,10 +838,11 @@ Java_com_tutpro_baresip_MainActivity_call_1hold(JNIEnv *env, jobject thiz,
struct call *call = (struct call *) strtoul(native_call, NULL, 10); struct call *call = (struct call *) strtoul(native_call, NULL, 10);
LOGD("holding call %s\n", native_call); LOGD("holding call %s\n", native_call);
int res = call_hold(call, true);
// audio_set_source(call_audio(call), NULL, NULL);
(*env)->ReleaseStringUTFChars(env, javaCall, native_call); (*env)->ReleaseStringUTFChars(env, javaCall, native_call);
return res; struct audio *au = call_audio(call);
audio_set_hold(au, true);
audio_set_source(au, NULL, NULL);
return call_hold(call, true);
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
@ -851,10 +852,11 @@ Java_com_tutpro_baresip_MainActivity_call_1unhold(JNIEnv *env, jobject thiz,
struct call *call = (struct call *) strtoul(native_call, NULL, 10); struct call *call = (struct call *) strtoul(native_call, NULL, 10);
LOGD("unholding call %s\n", native_call); LOGD("unholding call %s\n", native_call);
// audio_set_source(call_audio(call), "opensles", "nil");
int res = call_hold(call, false);
(*env)->ReleaseStringUTFChars(env, javaCall, native_call); (*env)->ReleaseStringUTFChars(env, javaCall, native_call);
return res; struct audio *au = call_audio(call);
audio_set_hold(au, false);
audio_set_source(au, "opensles", "nil");
return call_hold(call, false);
} }
JNIEXPORT void JNICALL JNIEXPORT void JNICALL