mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
add JNI wrapper for publish expires getter/setter
This commit is contained in:
parent
7861f9a127
commit
de812274e7
3 changed files with 75 additions and 43 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*<br>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 <sip:joe@15.128.128.93:50421>;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 <sip:joe@15.128.128.93:50421;apple-push-id=43143-DFE23F-2323-FA2232>.
|
||||
**/
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue