Add JNI wrapper for linphone proxy config realm parameter

This commit is contained in:
Gautier Pelloux-Prayer 2014-07-29 14:11:21 +02:00
parent 66044e773d
commit d8cc5b600f
3 changed files with 44 additions and 2 deletions

View file

@ -3033,6 +3033,19 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getQual
return jvalue;
}
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_setRealm(JNIEnv *env, jobject thiz, jlong ptr, jstring jrealm) {
if (jrealm){
const char *realm=env->GetStringUTFChars(jrealm, NULL);
linphone_proxy_config_set_realm((LinphoneProxyConfig *)ptr, realm);
env->ReleaseStringUTFChars(jrealm,realm);
}
}
JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getRealm(JNIEnv *env, jobject thiz, jlong ptr) {
jstring jvalue = env->NewStringUTF(linphone_proxy_config_get_realm((LinphoneProxyConfig *)ptr));
return jvalue;
}
extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env,jobject thiz,jlong ptr) {
return (jint)linphone_call_get_duration((LinphoneCall *) ptr);
}

View file

@ -224,6 +224,19 @@ public interface LinphoneProxyConfig {
*/
String getQualityReportingCollector();
/**
* Set the outbound proxy realm. It is used in digest authentication to avoid
* re-authentication if a previous token has already been provided.
* @param The new outbound proxy realm.
*/
void setRealm(String realm);
/**
* Get the outbound proxy realm.
* @return The outbound proxy realm.
*/
String getRealm();
/**
* Set optional contact parameters that will be added to the contact information sent in the registration.
* @param contact_params a string containing the additional parameters in text form, like "myparam=something;myparam2=something_else"
@ -287,12 +300,12 @@ public interface LinphoneProxyConfig {
* @return the publish expiration time in second. Default value is the registration expiration value.
*/
public int getPublishExpires();
/**
* attached a user data to a proxy config
**/
void setUserData(Object obj);
/**
* Returns user data from a proxy config. return null if any
* @return an Object.

View file

@ -321,6 +321,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
isValid();
return getQualityReportingInterval(nativePtr);
}
private native void setQualityReportingCollector(long nativePtr, String collector);
@Override
public void setQualityReportingCollector(String collector) {
@ -334,6 +335,21 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
isValid();
return getQualityReportingCollector(nativePtr);
}
private native void setRealm(long nativePtr, String realm);
@Override
public void setRealm(String realm) {
isValid();
setRealm(nativePtr, realm);
}
private native String getRealm(long nativePtr);
@Override
public String getRealm() {
isValid();
return getRealm(nativePtr);
}
private native void setPublishExpires(long nativePtr, int expires);
@Override
public void setPublishExpires(int expires) {