Added JNI API to set expires on given proxy config

This commit is contained in:
Sylvain Berfini 2013-10-14 14:18:33 +02:00
parent bcd22f8a74
commit 873072d460
3 changed files with 15 additions and 0 deletions

View file

@ -2623,10 +2623,15 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUploadPtime(JNIEnv *e
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getState(JNIEnv* env,jobject thiz,jlong ptr) {
return (jint) linphone_proxy_config_get_state((const LinphoneProxyConfig *) ptr);
}
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setExpires(JNIEnv* env,jobject thiz,jlong ptr,jint delay) {
linphone_proxy_config_set_expires((LinphoneProxyConfig *) ptr, (int) delay);
}
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getExpires(JNIEnv* env,jobject thiz,jlong ptr) {
return linphone_proxy_config_get_expires((LinphoneProxyConfig *) ptr);
}
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

@ -134,6 +134,12 @@ public interface LinphoneProxyConfig {
*/
void setExpires(int delay);
/**
* Gets the registration expiration time.
* @return delay expiration time in seconds.
*/
int getExpires();
/**
* Sets parameters for the contact
* @param parameters to add

View file

@ -30,6 +30,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
private native int getState(long nativePtr);
private native void setExpires(long nativePtr, int delay);
private native int getExpires(long nativePtr);
boolean ownPtr = false;
protected LinphoneProxyConfigImpl(String identity,String proxy,String route, boolean enableRegister) throws LinphoneCoreException {
@ -143,6 +144,9 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
public void setExpires(int delay) {
setExpires(nativePtr, delay);
}
public int getExpires() {
return getExpires(nativePtr);
}
public boolean publishEnabled() {
return publishEnabled(nativePtr);
}