Commit c9ada30c authored by Erwan Croze's avatar Erwan Croze 👋🏻

Add getNatPolicy JNI to LinphoneProxyConfig

parent 7c3f25b7
......@@ -2867,6 +2867,10 @@ extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getContactUriP
return params ? env->NewStringUTF(params) : NULL;
}
JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getNatPolicy(JNIEnv* env,jobject thiz,jlong proxyCfg) {
LinphoneNatPolicy *nat_policy = linphone_proxy_config_get_nat_policy((LinphoneProxyConfig *)proxyCfg);
return (nat_policy != NULL) ? getNatPolicy(env, nat_policy) : NULL;
}
extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) {
if (jroute != NULL) {
......
......@@ -85,6 +85,11 @@ public interface LinphoneProxyConfig {
*/
public boolean registerEnabled();
/**
* @return nat policy from proxy config
*/
public LinphoneNatPolicy getNatPolicy();
/**
* normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
* @param number
......
......@@ -100,6 +100,8 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
private native int lookupCCCFromIso(long nativePtr, String iso);
private native int lookupCCCFromE164(long nativePtr, String e164);
private native Object getNatPolicy(long nativePtr);
public LinphoneProxyConfig enableRegister(boolean value) {
isValid();
......@@ -124,6 +126,10 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
return this;
}
public LinphoneNatPolicy getNatPolicy() {
return (LinphoneNatPolicy)getNatPolicy(nativePtr);
}
public void setIdentity(String identity) throws LinphoneCoreException {
isValid();
setIdentity(nativePtr,identity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment