mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 23:28:09 +00:00
add JNI getters/setters for quality reporting
This commit is contained in:
parent
b468714122
commit
f3cfd4e0d5
3 changed files with 113 additions and 5 deletions
|
|
@ -2993,6 +2993,37 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getAvpfRRI
|
|||
return (jint)linphone_proxy_config_get_avpf_rr_interval((LinphoneProxyConfig *)ptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_enableQualityReporting(JNIEnv *env, jobject thiz, jlong ptr, jboolean enable) {
|
||||
linphone_proxy_config_enable_quality_reporting((LinphoneProxyConfig *)ptr, (bool)enable);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_quality_reportingEnabled(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
return linphone_proxy_config_quality_reporting_enabled((LinphoneProxyConfig *)ptr);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_setQualityReportingInterval(JNIEnv *env, jobject thiz, jlong ptr, jint interval) {
|
||||
linphone_proxy_config_set_quality_reporting_interval((LinphoneProxyConfig *)ptr, (uint8_t)interval);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getQualityReportingInterval(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
return (jint)linphone_proxy_config_get_quality_reporting_interval((LinphoneProxyConfig *)ptr);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_setQualityReportingCollector(JNIEnv *env, jobject thiz, jlong ptr, jstring jcollector) {
|
||||
if (jcollector){
|
||||
const char *collector=env->GetStringUTFChars(jcollector, NULL);
|
||||
linphone_proxy_config_set_quality_reporting_collector((LinphoneProxyConfig *)ptr, collector);
|
||||
env->ReleaseStringUTFChars(jcollector,collector);
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneProxyConfigImpl_getQualityReportingCollector(JNIEnv *env, jobject thiz, jlong ptr) {
|
||||
jstring jvalue = env->NewStringUTF(linphone_proxy_config_get_quality_reporting_collector((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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,6 +172,12 @@ public interface LinphoneProxyConfig {
|
|||
*/
|
||||
void enableAvpf(boolean enable);
|
||||
|
||||
/**
|
||||
* Whether AVPF is used for calls through this proxy.
|
||||
* @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).
|
||||
|
|
@ -185,14 +191,45 @@ public interface LinphoneProxyConfig {
|
|||
int getAvpfRRInterval();
|
||||
|
||||
/**
|
||||
* Whether AVPF is used for calls through this proxy.
|
||||
* 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
|
||||
*/
|
||||
boolean avpfEnabled();
|
||||
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 contaning the additional parameters in text form, like "myparam=something;myparam2=something_else"
|
||||
* @param contact_params a string containing the additional parameters in text form, like "myparam=something;myparam2=something_else"
|
||||
*
|
||||
* The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or android push id.
|
||||
* 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.
|
||||
|
|
@ -207,7 +244,7 @@ public interface LinphoneProxyConfig {
|
|||
|
||||
/**
|
||||
* Set optional contact parameters that will be added to the contact information sent in the registration, inside the URI.
|
||||
* @param params a string contaning the additional parameters in text form, like "myparam=something;myparam2=something_else"
|
||||
* @param params a string containing the additional parameters in text form, like "myparam=something;myparam2=something_else"
|
||||
*
|
||||
* The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id.
|
||||
* 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>.
|
||||
|
|
@ -215,7 +252,7 @@ public interface LinphoneProxyConfig {
|
|||
public void setContactUriParameters(String params);
|
||||
|
||||
/**
|
||||
* Get the contact's uri parameters.
|
||||
* Get the contact's URI parameters.
|
||||
* @return
|
||||
*/
|
||||
public String getContactUriParameters();
|
||||
|
|
|
|||
|
|
@ -304,4 +304,44 @@ 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) {
|
||||
isValid();
|
||||
setQualityReportingInterval(nativePtr, interval);
|
||||
}
|
||||
private native int getQualityReportingInterval(long nativePtr);
|
||||
@Override
|
||||
public int getQualityReportingInterval() {
|
||||
isValid();
|
||||
return getQualityReportingInterval(nativePtr);
|
||||
}
|
||||
private native void setQualityReportingCollector(long nativePtr, String collector);
|
||||
@Override
|
||||
public void setQualityReportingCollector(String collector) {
|
||||
isValid();
|
||||
setQualityReportingCollector(nativePtr, collector);
|
||||
}
|
||||
private native String getQualityReportingCollector(long nativePtr);
|
||||
@Override
|
||||
public String getQualityReportingCollector() {
|
||||
|
||||
isValid();
|
||||
return getQualityReportingCollector(nativePtr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue