]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore_jni.cc
add get_remote_contact() api and clean java API.
[linphone] / coreapi / linphonecore_jni.cc
index 4144c1441f54d07da534f7995313002d7f0f6c64..6c2135203648a8349879f9fbf1b8931c6ba2175a 100644 (file)
@@ -1508,7 +1508,17 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getRemoteAddress(       JNIEn
 
 extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getRemoteUserAgent(JNIEnv *env, jobject thiz, jlong ptr) {
        LinphoneCall *call = (LinphoneCall *)ptr;
-       jstring jvalue = env->NewStringUTF(linphone_call_get_remote_user_agent(call));
+       const char *value=linphone_call_get_remote_user_agent(call);
+       jstring jvalue=NULL;
+       if (value) jvalue=env->NewStringUTF();
+       return jvalue;
+}
+
+extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getRemoteContact(JNIEnv *env, jobject thiz, jlong ptr) {
+       LinphoneCall *call = (LinphoneCall *)ptr;
+       const char *value=linphone_call_get_remote_contact(call);
+       jstring jvalue = NULL;
+       if (value) jvalue=env->NewStringUTF(value);
        return jvalue;
 }