diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index c43b6e3c3..609493b3e 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1729,6 +1729,15 @@ extern "C" jlong Java_org_linphone_core_LinphoneProxyConfigImpl_getErrorInfo(JNI return (jlong)linphone_proxy_config_get_error_info((LinphoneProxyConfig *) ptr); } +extern "C" jint Java_org_linphone_core_LinphoneProxyConfigImpl_getPublishExpires(JNIEnv* env,jobject thiz,jlong ptr) { + return (jint)linphone_proxy_config_get_publish_expires((LinphoneProxyConfig *) ptr); +} +extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setPublishExpires(JNIEnv* env + ,jobject thiz + ,jlong ptr + ,jint jval) { + linphone_proxy_config_set_publish_expires((LinphoneProxyConfig *) ptr, jval); +} //Auth Info extern "C" jlong Java_org_linphone_core_LinphoneAuthInfoImpl_newLinphoneAuthInfo(JNIEnv* env diff --git a/java/common/org/linphone/core/LinphoneProxyConfig.java b/java/common/org/linphone/core/LinphoneProxyConfig.java index c2c742bd4..0f8db591b 100644 --- a/java/common/org/linphone/core/LinphoneProxyConfig.java +++ b/java/common/org/linphone/core/LinphoneProxyConfig.java @@ -18,19 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.linphone.core; /** - * The LinphoneProxyConfig object represents a proxy configuration to be used by the LinphoneCore object. Its fields must not be used directly in favour of the accessors methods. + * The LinphoneProxyConfig object represents a proxy configuration to be used by the LinphoneCore object. Its fields must not be used directly in favour of the accessors methods. * Once created and filled properly the LinphoneProxyConfig can be given to LinphoneCore with {@link LinphoneCore#addProxyConfig(LinphoneProxyConfig)}. This will automatically triggers the registration, if enabled. *
The proxy configuration are persistent to restarts because they are saved in the configuration file. As a consequence, after {@link LinphoneCoreFactory#createLinphoneCore(LinphoneCoreListener, String, String, Object)} there might already be a default proxy that can be examined with {@link LinphoneCore#getDefaultProxyConfig()} . * */ public interface LinphoneProxyConfig { - + public void setIsDeleted(boolean b); public boolean getIsDeleted(); - + /** *Starts editing a proxy configuration. - *Because proxy configuration must be consistent, applications MUST call {@link #edit()} before doing any attempts to modify proxy configuration (such as identity, proxy address and so on). + *Because proxy configuration must be consistent, applications MUST call {@link #edit()} before doing any attempts to modify proxy configuration (such as identity, proxy address and so on). *Once the modifications are done, then the application must call {@link #done()} to commit the changes. */ public LinphoneProxyConfig edit(); @@ -61,20 +61,20 @@ public interface LinphoneProxyConfig { public void setProxy(String proxyUri) throws LinphoneCoreException; /** * get the proxy's SIP address. - * + * */ public String getProxy(); /** * Enable register for this proxy config. * Register message is issued after call to {@link #done()} * @param value - */ + */ public LinphoneProxyConfig enableRegister(boolean value); /** * @return true if registration to the proxy is enabled. */ public boolean registerEnabled(); - + /** * normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222 * @param number @@ -86,32 +86,32 @@ public interface LinphoneProxyConfig { * @param prefix */ public void setDialPrefix(String prefix); - + /** * Returns the automatically added international prefix to e164 phone numbers */ public String getDialPrefix(); - + /** * * Sets whether liblinphone should replace "+" by "00" in dialed numbers (passed to * {@link LinphoneCore#invite(String)}). * @param value default value is false */ public void setDialEscapePlus(boolean value); - + /** * Whether liblinphone should replace "+" by "00" in dialed numbers (passed to * {@link LinphoneCore#invite(String)}). */ public boolean getDialEscapePlus(); - + /** * get domain host name or ip * @return may be null */ public String getDomain(); /** - * + * * @return a boolean indicating that the user is successfully registered on the proxy. */ public boolean isRegistered(); @@ -122,7 +122,7 @@ public interface LinphoneProxyConfig { */ public void setRoute(String routeUri) throws LinphoneCoreException; /** - * + * * @return the route set for this proxy configuration. */ public String getRoute(); @@ -138,95 +138,95 @@ public interface LinphoneProxyConfig { * returns publish state for this proxy config (see {@link #enablePublish(boolean)} ) */ public boolean publishEnabled(); - - + + LinphoneCore.RegistrationState getState(); - + /** * Sets the registration expiration time. * @param delay expiration time in seconds */ void setExpires(int delay); - + /** * Gets the registration expiration time. * @return delay expiration time in seconds. */ int getExpires(); - + /** * Set the privacy for all calls or chat sessions using the identity exposed by this LinphoneProxyConfig * @param privacy_mask a or'd int of values defined in interface {@link org.linphone.core.Privacy} */ void setPrivacy(int privacy_mask); - + /** * Get the privacy mask requested for this proxy config. * @return the privacy mask as defined in interface {@link org.linphone.core.Privacy} */ int getPrivacy(); - + /** * Indicates whether AVPF/SAVPF must be used for calls using this proxy config. * @param enable True to enable AVPF/SAVF, false to disable it. */ void enableAvpf(boolean enable); - + /** * Whether AVPF is used for calls through this proxy. - * @return + * @return */ boolean avpfEnabled(); - + /** * Set the interval between regular RTCP reports when using AVPF/SAVPF. * @param interval The interval in seconds (between 0 and 5 seconds). */ void setAvpfRRInterval(int interval); - + /** * Get the interval between regular RTCP reports when using AVPF/SAVPF. * @return The interval in seconds. */ int getAvpfRRInterval(); - + /** * Indicates whether quality reporting must be used for calls using this proxy config. * @param enable True to enable quality reporting, false to disable it. */ void enableQualityReporting(boolean enable); - + /** * Whether quality reporting is used for calls through this proxy. - * @return + * @return */ boolean qualityReportingEnabled(); - + /** * Set the interval between quality interval reports during a call when using quality reporting. * @param interval The interval in seconds (should be greater than 120 seconds to avoid too much). */ void setQualityReportingInterval(int interval); - + /** * Get the interval between quality interval reports during a call when using quality reporting. * @return The interval in seconds. */ int getQualityReportingInterval(); - + /** * Set the collector SIP URI to collect reports when using quality reporting. * @param collector The collector SIP URI which should be configured server side too. */ void setQualityReportingCollector(String collector); - + /** * Get the collector SIP URI collecting reports when using quality reporting. * @return The SIP URI collector address. */ String getQualityReportingCollector(); - + /** * 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" @@ -235,13 +235,13 @@ public interface LinphoneProxyConfig { * As an example, the contact address in the SIP register sent will look like ;android-push-id=43143-DFE23F-2323-FA2232. **/ public void setContactParameters(String contact_params); - + /** * Get the contact's parameters. * @return */ public String getContactParameters(); - + /** * Set optional contact parameters that will be added to the contact information sent in the registration, inside the URI. * @param params a string containing the additional parameters in text form, like "myparam=something;myparam2=something_else" @@ -250,34 +250,44 @@ public interface LinphoneProxyConfig { * As an example, the contact address in the SIP register sent will look like . **/ public void setContactUriParameters(String params); - + /** * Get the contact's URI parameters. * @return */ public String getContactUriParameters(); - + /** * Return the international prefix for the given country * @param country iso code */ public int lookupCCCFromIso(String iso); - + /** * Return the international prefix for the given country * @param e164 phone number */ public int lookupCCCFromE164(String e164); - + /** * Return reason error code. * @return reason code. */ public Reason getError(); - + /** * Get full error information about last error occured on the proxy config. * @return an ErrorInfo. */ public ErrorInfo getErrorInfo(); + + /** + * Set the publish expiration time in second. + * @param expires in second + */ + public void setPublishExpires(int expires); + /** + * @return the publish expiration time in second. Default value is the registration expiration value. + */ + public int getPublishExpires(); } diff --git a/java/impl/org/linphone/core/LinphoneProxyConfigImpl.java b/java/impl/org/linphone/core/LinphoneProxyConfigImpl.java index 475fe352d..68d444332 100644 --- a/java/impl/org/linphone/core/LinphoneProxyConfigImpl.java +++ b/java/impl/org/linphone/core/LinphoneProxyConfigImpl.java @@ -212,7 +212,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig { } public boolean publishEnabled() { isValid(); - return publishEnabled(nativePtr); + return publishEnabled(nativePtr); } @Override public void setContactParameters(String params) { @@ -304,21 +304,21 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig { public ErrorInfo getErrorInfo() { return new ErrorInfoImpl(getErrorInfo(nativePtr)); } - + private native void enableQualityReporting(long nativePtr, boolean enable); @Override public void enableQualityReporting(boolean enable) { isValid(); enableQualityReporting(nativePtr, enable); } - + private native boolean qualityReportingEnabled(long nativePtr); @Override public boolean qualityReportingEnabled() { isValid(); return avpfEnabled(nativePtr); } - + private native void setQualityReportingInterval(long nativePtr, int interval); @Override public void setQualityReportingInterval(int interval) { @@ -344,4 +344,17 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig { isValid(); return getQualityReportingCollector(nativePtr); } + private native void setPublishExpires(long nativePtr, int expires); + @Override + public void setPublishExpires(int expires) { + isValid(); + setPublishExpires(nativePtr, expires); + } + private native int getPublishExpires(long nativePtr); + @Override + public int getPublishExpires() { + + isValid(); + return getPublishExpires(nativePtr); + } }