mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 11:38:08 +00:00
Merge branch 'master' of git.linphone.org:linphone into dev_python
This commit is contained in:
commit
92c8cb6824
18 changed files with 267 additions and 92 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -72,3 +72,4 @@ tools/lpc2xml_test
|
|||
tools/xml2lpc_test
|
||||
coreapi/help/filetransfer
|
||||
tester/receive_file.dump
|
||||
tester/tmp.db
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\belle-sip\include;$(ProjectDir)..\..\oRTP\include;$(ProjectDir)..\..\mediastreamer2\include;$(ProjectDIr)..\..\..\tunnel\include;$(ProjectDir)..\..\coreapi;$(ProjectDir)..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>__STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR="";UNICODE;_XKEYCHECK_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>__STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR=".";UNICODE;_XKEYCHECK_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ test_numbers_LDADD=liblinphone.la $(liblinphone_la_LIBADD)
|
|||
endif
|
||||
|
||||
AM_CPPFLAGS=\
|
||||
-I$(top_srcdir) -I$(top_srcdir)/include
|
||||
-I$(top_srcdir) -I$(top_srcdir)/include -I$(builddir)
|
||||
|
||||
AM_CFLAGS=\
|
||||
$(STRICT_OPTIONS) -DIN_LINPHONE \
|
||||
|
|
@ -167,21 +167,21 @@ make_gitversion_h:
|
|||
echo "*** PACKAGE_VERSION and git tag differ. Please put them identical."; \
|
||||
exit 1; \
|
||||
fi ; \
|
||||
$(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(GITDESCRIBE)\"" > $(GITVERSION_FILE_TMP) ; \
|
||||
$(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(GITDESCRIBE)\"" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
|
||||
elif test "$(GITREVISION)" != "" ; then \
|
||||
$(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(LINPHONE_VERSION)_$(GITREVISION)\"" > $(GITVERSION_FILE_TMP) ; \
|
||||
$(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(LINPHONE_VERSION)_$(GITREVISION)\"" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
|
||||
else \
|
||||
$(ECHO) -n "" > $(GITVERSION_FILE_TMP) ; \
|
||||
$(ECHO) -n "" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
|
||||
fi ; \
|
||||
else \
|
||||
$(ECHO) -n "" > $(GITVERSION_FILE_TMP) ; \
|
||||
$(ECHO) -n "" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
|
||||
fi
|
||||
if ! test -f $(srcdir)/$(GITVERSION_FILE) ; then \
|
||||
cp -f $(srcdir)/$(GITVERSION_FILE_TMP) $(srcdir)/$(GITVERSION_FILE) ; \
|
||||
if ! test -f $(builddir)/$(GITVERSION_FILE) ; then \
|
||||
cp -f $(builddir)/$(GITVERSION_FILE_TMP) $(builddir)/$(GITVERSION_FILE) ; \
|
||||
fi
|
||||
if test "`cat $(GITVERSION_FILE_TMP)`" != "`cat $(srcdir)/$(GITVERSION_FILE)`" ; then \
|
||||
cp -f $(GITVERSION_FILE_TMP) $(srcdir)/$(GITVERSION_FILE) ; \
|
||||
if test "`cat $(builddir)/$(GITVERSION_FILE_TMP)`" != "`cat $(builddir)/$(GITVERSION_FILE)`" ; then \
|
||||
cp -f $(builddir)/$(GITVERSION_FILE_TMP) $(builddir)/$(GITVERSION_FILE) ; \
|
||||
fi
|
||||
rm -f $(GITVERSION_FILE_TMP) ;
|
||||
rm -f $(builddir)/$(GITVERSION_FILE_TMP) ;
|
||||
|
||||
$(GITVERSION_FILE): make_gitversion_h
|
||||
|
|
|
|||
|
|
@ -1278,11 +1278,14 @@ void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){
|
|||
/**
|
||||
* Request remote side to send us a Video Fast Update.
|
||||
**/
|
||||
void linphone_call_send_vfu_request(LinphoneCall *call)
|
||||
{
|
||||
void linphone_call_send_vfu_request(LinphoneCall *call) {
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (LinphoneCallStreamsRunning == linphone_call_get_state(call))
|
||||
sal_call_send_vfu_request(call->op);
|
||||
if (call->core->sip_conf.vfu_with_info) {
|
||||
if (LinphoneCallStreamsRunning == linphone_call_get_state(call))
|
||||
sal_call_send_vfu_request(call->op);
|
||||
} else {
|
||||
ms_message("vfu request using sip disabled from config [sip,vfu_with_info]");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -755,6 +755,7 @@ static void sip_config_read(LinphoneCore *lc)
|
|||
sal_use_one_matching_codec_policy(lc->sal,lp_config_get_int(lc->config,"sip","only_one_codec",0));
|
||||
sal_use_dates(lc->sal,lp_config_get_int(lc->config,"sip","put_date",0));
|
||||
sal_enable_sip_update_method(lc->sal,lp_config_get_int(lc->config,"sip","sip_update",1));
|
||||
lc->sip_conf.vfu_with_info=lp_config_get_int(lc->config,"sip","vfu_with_info",1);
|
||||
}
|
||||
|
||||
static void rtp_config_read(LinphoneCore *lc)
|
||||
|
|
|
|||
|
|
@ -77,6 +77,23 @@ extern "C" void libmswebrtc_init();
|
|||
}
|
||||
|
||||
|
||||
#define RETURN_PROXY_CONFIG_USER_DATA_OBJECT(javaclass, funcprefix, cobj) \
|
||||
{ \
|
||||
jclass jUserDataObjectClass; \
|
||||
jmethodID jUserDataObjectCtor; \
|
||||
jobject jUserDataObj; \
|
||||
jUserDataObj = (jobject)funcprefix ## _get_user_data(cobj); \
|
||||
if (jUserDataObj == NULL) { \
|
||||
jUserDataObjectClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/" javaclass)); \
|
||||
jUserDataObjectCtor = env->GetMethodID(jUserDataObjectClass,"<init>", "(J)V"); \
|
||||
jUserDataObj = env->NewObject(jUserDataObjectClass, jUserDataObjectCtor,(jlong) cobj); \
|
||||
jUserDataObj = env->NewGlobalRef(jUserDataObj); \
|
||||
funcprefix ## _set_user_data(cobj, jUserDataObj); \
|
||||
env->DeleteGlobalRef(jUserDataObjectClass); \
|
||||
} \
|
||||
return jUserDataObj; \
|
||||
}
|
||||
|
||||
|
||||
static JavaVM *jvm=0;
|
||||
static const char* LogDomain = "Linphone";
|
||||
|
|
@ -880,24 +897,32 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDefaultProxyConfig( J
|
|||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getDefaultProxyConfig( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
|
||||
LinphoneProxyConfig *config=0;
|
||||
linphone_core_get_default_proxy((LinphoneCore*)lc,&config);
|
||||
return (jlong)config;
|
||||
}
|
||||
|
||||
extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_getProxyConfigList(JNIEnv* env, jobject thiz, jlong lc) {
|
||||
static jobject getOrCreateProxy(JNIEnv* env,LinphoneProxyConfig* proxy){
|
||||
RETURN_PROXY_CONFIG_USER_DATA_OBJECT("LinphoneProxyConfigImpl", linphone_proxy_config, proxy);
|
||||
}
|
||||
|
||||
extern "C" jobjectArray Java_org_linphone_core_LinphoneCoreImpl_getProxyConfigList(JNIEnv* env, jobject thiz, jlong lc) {
|
||||
const MSList* proxies = linphone_core_get_proxy_config_list((LinphoneCore*)lc);
|
||||
int proxyCount = ms_list_size(proxies);
|
||||
jlongArray jProxies = env->NewLongArray(proxyCount);
|
||||
jlong *jInternalArray = env->GetLongArrayElements(jProxies, NULL);
|
||||
jclass cls = env->FindClass("java/lang/Object");
|
||||
jobjectArray jProxies = env->NewObjectArray(proxyCount,cls,NULL);
|
||||
|
||||
for (int i = 0; i < proxyCount; i++ ) {
|
||||
jInternalArray[i] = (unsigned long) (proxies->data);
|
||||
LinphoneProxyConfig* proxy = (LinphoneProxyConfig*)proxies->data;
|
||||
jobject jproxy = getOrCreateProxy(env,proxy);
|
||||
if(jproxy != NULL){
|
||||
env->SetObjectArrayElement(jProxies, i, jproxy);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
proxies = proxies->next;
|
||||
}
|
||||
|
||||
env->ReleaseLongArrayElements(jProxies, jInternalArray, 0);
|
||||
|
||||
return jProxies;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -524,6 +524,7 @@ typedef struct sip_config
|
|||
bool_t ping_with_options;
|
||||
bool_t auto_net_state_mon;
|
||||
bool_t tcp_tls_keepalive;
|
||||
bool_t vfu_with_info; /*use to enable vfu request using sip info*/
|
||||
} sip_config_t;
|
||||
|
||||
typedef struct rtp_config
|
||||
|
|
|
|||
|
|
@ -1116,6 +1116,9 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf
|
|||
linphone_proxy_config_enable_register(cfg,FALSE);
|
||||
linphone_proxy_config_done(cfg);
|
||||
linphone_proxy_config_update(cfg); /*so that it has an effect*/
|
||||
|
||||
/*as cfg no longer in proxies, unregister will never be issued*/
|
||||
_linphone_proxy_config_unregister(cfg);
|
||||
}
|
||||
if (lc->default_proxy==cfg){
|
||||
lc->default_proxy=NULL;
|
||||
|
|
|
|||
|
|
@ -110,33 +110,32 @@ static void belle_request_process_auth_requested(void *ctx, belle_sip_auth_event
|
|||
}
|
||||
|
||||
int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char *remote_provisioning_uri) {
|
||||
const char* file_path = strstr(remote_provisioning_uri, "file://");
|
||||
|
||||
if( file_path == remote_provisioning_uri ){
|
||||
// We allow for 'local remote-provisioning' in case the file is to be opened from the hard drive
|
||||
file_path += strlen("file://");
|
||||
belle_generic_uri_t *uri=belle_generic_uri_parse(remote_provisioning_uri);
|
||||
const char* scheme = uri ? belle_generic_uri_get_scheme(uri) : NULL;
|
||||
|
||||
if( scheme && (strcmp(scheme,"file") == 0) ){
|
||||
// We allow for 'local remote-provisioning' in case the file is to be opened from the hard drive.
|
||||
const char* file_path = remote_provisioning_uri + strlen("file://"); // skip scheme
|
||||
return linphone_remote_provisioning_load_file(lc, file_path);
|
||||
} else {
|
||||
belle_generic_uri_t *uri=belle_generic_uri_parse(remote_provisioning_uri);
|
||||
|
||||
} else if( scheme && strncmp(scheme, "http", 4) == 0 ) {
|
||||
belle_http_request_listener_callbacks_t belle_request_listener={0};
|
||||
belle_http_request_listener_t *listener;
|
||||
belle_http_request_t *request;
|
||||
|
||||
|
||||
belle_request_listener.process_response=belle_request_process_response_event;
|
||||
belle_request_listener.process_auth_requested=belle_request_process_auth_requested;
|
||||
belle_request_listener.process_io_error=belle_request_process_io_error;
|
||||
belle_request_listener.process_timeout=belle_request_process_timeout;
|
||||
|
||||
listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc);
|
||||
|
||||
|
||||
if (uri==NULL) {
|
||||
belle_sip_error("Invalid provisioning URI [%s]",remote_provisioning_uri);
|
||||
return -1;
|
||||
}
|
||||
listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc);
|
||||
|
||||
request=belle_http_request_create("GET",uri, NULL);
|
||||
belle_http_provider_send_request(lc->http_provider, request, listener);
|
||||
return 0;
|
||||
return belle_http_provider_send_request(lc->http_provider, request, listener);
|
||||
} else {
|
||||
ms_error("Invalid provisioning URI [%s] (missing scheme?)",remote_provisioning_uri);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ package org.linphone.core;
|
|||
*/
|
||||
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).
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native String getRing(long nativePtr);
|
||||
private native void setRootCA(long nativePtr, String path);
|
||||
private native long[] listVideoPayloadTypes(long nativePtr);
|
||||
private native long[] getProxyConfigList(long nativePtr);
|
||||
private native LinphoneProxyConfig[] getProxyConfigList(long nativePtr);
|
||||
private native long[] getAuthInfosList(long nativePtr);
|
||||
private native long findAuthInfos(long nativePtr, String username, String realm, String domain);
|
||||
private native long[] listAudioPayloadTypes(long nativePtr);
|
||||
|
|
@ -190,7 +190,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
|
||||
public synchronized LinphoneProxyConfig getDefaultProxyConfig() {
|
||||
isValid();
|
||||
long lNativePtr = getDefaultProxyConfig(nativePtr);
|
||||
long lNativePtr = getDefaultProxyConfig(nativePtr);
|
||||
if (lNativePtr!=0) {
|
||||
return new LinphoneProxyConfigImpl(this,lNativePtr);
|
||||
} else {
|
||||
|
|
@ -224,6 +224,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
isValid();
|
||||
removeProxyConfig(nativePtr, ((LinphoneProxyConfigImpl)proxyCfg).nativePtr);
|
||||
((LinphoneProxyConfigImpl)proxyCfg).mCore=null;
|
||||
((LinphoneProxyConfigImpl)proxyCfg).deleteNativePtr();
|
||||
}
|
||||
public synchronized void clearAuthInfos() {
|
||||
isValid();
|
||||
|
|
@ -512,17 +513,8 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
setRootCA(nativePtr, path);
|
||||
}
|
||||
|
||||
public synchronized LinphoneProxyConfig[] getProxyConfigList() {
|
||||
long[] typesPtr = getProxyConfigList(nativePtr);
|
||||
if (typesPtr == null) return null;
|
||||
|
||||
LinphoneProxyConfig[] proxies = new LinphoneProxyConfig[typesPtr.length];
|
||||
|
||||
for (int i=0; i < proxies.length; i++) {
|
||||
proxies[i] = new LinphoneProxyConfigImpl(this,typesPtr[i]);
|
||||
}
|
||||
|
||||
return proxies;
|
||||
public synchronized LinphoneProxyConfig[] getProxyConfigList() {
|
||||
return getProxyConfigList(nativePtr);
|
||||
}
|
||||
|
||||
public synchronized PayloadType[] getVideoCodecs() {
|
||||
|
|
|
|||
|
|
@ -15,20 +15,17 @@ GNU General Public License for more details.
|
|||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
*/
|
||||
package org.linphone.core;
|
||||
|
||||
import org.linphone.core.LinphoneCore.RegistrationState;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
||||
|
||||
protected final long nativePtr;
|
||||
protected long nativePtr;
|
||||
protected LinphoneCoreImpl mCore;
|
||||
|
||||
protected boolean isDeleting;
|
||||
|
||||
private native int getState(long nativePtr);
|
||||
private native void setExpires(long nativePtr, int delay);
|
||||
private native int getExpires(long nativePtr);
|
||||
|
|
@ -39,14 +36,40 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
setIdentity(identity);
|
||||
setProxy(proxy);
|
||||
setRoute(route);
|
||||
setIsDeleted(false);
|
||||
enableRegister(enableRegister);
|
||||
ownPtr=true;
|
||||
}
|
||||
protected LinphoneProxyConfigImpl(LinphoneCoreImpl core, long aNativePtr) {
|
||||
|
||||
protected LinphoneProxyConfigImpl(LinphoneCoreImpl core,long aNativePtr) {
|
||||
mCore=core;
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=false;
|
||||
mCore=core;
|
||||
}
|
||||
|
||||
protected LinphoneProxyConfigImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
ownPtr=false;
|
||||
}
|
||||
|
||||
public boolean getIsDeleted() {
|
||||
return isDeleting;
|
||||
}
|
||||
|
||||
public void setIsDeleted(boolean b) {
|
||||
isDeleting = b;
|
||||
}
|
||||
|
||||
private void isValid() {
|
||||
if (nativePtr == 0) {
|
||||
throw new RuntimeException("proxy config removed");
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteNativePtr() {
|
||||
nativePtr=0;
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
//Log.e(LinphoneService.TAG,"fixme, should release underlying proxy config");
|
||||
if (ownPtr) delete(nativePtr);
|
||||
|
|
@ -56,42 +79,44 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
|
||||
private native void edit(long ptr);
|
||||
private native void done(long ptr);
|
||||
|
||||
|
||||
private native void setIdentity(long ptr,String identity);
|
||||
private native String getIdentity(long ptr);
|
||||
private native int setProxy(long ptr,String proxy);
|
||||
private native String getProxy(long ptr);
|
||||
|
||||
|
||||
|
||||
private native void enableRegister(long ptr,boolean value);
|
||||
private native boolean isRegisterEnabled(long ptr);
|
||||
|
||||
|
||||
private native boolean isRegistered(long ptr);
|
||||
private native void setDialPrefix(long ptr, String prefix);
|
||||
private native String getDialPrefix(long ptr);
|
||||
|
||||
|
||||
private native String normalizePhoneNumber(long ptr,String number);
|
||||
|
||||
|
||||
private native String getDomain(long ptr);
|
||||
|
||||
|
||||
private native void setDialEscapePlus(long ptr, boolean value);
|
||||
private native boolean getDialEscapePlus(long ptr);
|
||||
|
||||
|
||||
private native String getRoute(long ptr);
|
||||
private native int setRoute(long ptr,String uri);
|
||||
private native void enablePublish(long ptr,boolean enable);
|
||||
private native boolean publishEnabled(long ptr);
|
||||
private native void setContactParameters(long ptr, String params);
|
||||
|
||||
|
||||
private native int lookupCCCFromIso(long nativePtr, String iso);
|
||||
private native int lookupCCCFromE164(long nativePtr, String e164);
|
||||
|
||||
|
||||
public LinphoneProxyConfig enableRegister(boolean value) {
|
||||
isValid();
|
||||
enableRegister(nativePtr,value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void done() {
|
||||
isValid();
|
||||
Object mutex=mCore!=null ? mCore : this;
|
||||
synchronized(mutex){
|
||||
done(nativePtr);
|
||||
|
|
@ -99,6 +124,7 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
}
|
||||
|
||||
public LinphoneProxyConfig edit() {
|
||||
isValid();
|
||||
Object mutex=mCore!=null ? mCore : this;
|
||||
synchronized(mutex){
|
||||
edit(nativePtr);
|
||||
|
|
@ -107,139 +133,173 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
}
|
||||
|
||||
public void setIdentity(String identity) throws LinphoneCoreException {
|
||||
isValid();
|
||||
setIdentity(nativePtr,identity);
|
||||
}
|
||||
|
||||
public void setProxy(String proxyUri) throws LinphoneCoreException {
|
||||
isValid();
|
||||
if (setProxy(nativePtr,proxyUri)!=0) {
|
||||
throw new LinphoneCoreException("Bad proxy address ["+proxyUri+"]");
|
||||
}
|
||||
}
|
||||
public String normalizePhoneNumber(String number) {
|
||||
isValid();
|
||||
return normalizePhoneNumber(nativePtr,number);
|
||||
}
|
||||
public void setDialPrefix(String prefix) {
|
||||
isValid();
|
||||
setDialPrefix(nativePtr, prefix);
|
||||
}
|
||||
public String getDialPrefix() {
|
||||
isValid();
|
||||
return getDialPrefix(nativePtr);
|
||||
}
|
||||
public String getDomain() {
|
||||
isValid();
|
||||
return getDomain(nativePtr);
|
||||
}
|
||||
public void setDialEscapePlus(boolean value) {
|
||||
setDialEscapePlus(nativePtr,value);
|
||||
isValid();
|
||||
setDialEscapePlus(nativePtr,value);
|
||||
}
|
||||
public boolean getDialEscapePlus() {
|
||||
isValid();
|
||||
return getDialEscapePlus(nativePtr);
|
||||
}
|
||||
public String getIdentity() {
|
||||
isValid();
|
||||
return getIdentity(nativePtr);
|
||||
}
|
||||
public String getProxy() {
|
||||
isValid();
|
||||
return getProxy(nativePtr);
|
||||
}
|
||||
public boolean isRegistered() {
|
||||
isValid();
|
||||
return isRegistered(nativePtr);
|
||||
}
|
||||
public boolean registerEnabled() {
|
||||
isValid();
|
||||
return isRegisterEnabled(nativePtr);
|
||||
}
|
||||
public String getRoute() {
|
||||
isValid();
|
||||
return getRoute(nativePtr);
|
||||
}
|
||||
public void setRoute(String routeUri) throws LinphoneCoreException {
|
||||
isValid();
|
||||
if (setRoute(nativePtr, routeUri) != 0) {
|
||||
throw new LinphoneCoreException("cannot set route ["+routeUri+"]");
|
||||
}
|
||||
}
|
||||
public void enablePublish(boolean enable) {
|
||||
isValid();
|
||||
enablePublish(nativePtr,enable);
|
||||
}
|
||||
public RegistrationState getState() {
|
||||
isValid();
|
||||
return RegistrationState.fromInt(getState(nativePtr));
|
||||
}
|
||||
|
||||
public void setExpires(int delay) {
|
||||
isValid();
|
||||
setExpires(nativePtr, delay);
|
||||
}
|
||||
public int getExpires() {
|
||||
isValid();
|
||||
return getExpires(nativePtr);
|
||||
}
|
||||
public boolean publishEnabled() {
|
||||
isValid();
|
||||
return publishEnabled(nativePtr);
|
||||
}
|
||||
@Override
|
||||
public void setContactParameters(String params) {
|
||||
isValid();
|
||||
setContactParameters(nativePtr, params);
|
||||
}
|
||||
@Override
|
||||
public int lookupCCCFromIso(String iso) {
|
||||
isValid();
|
||||
return lookupCCCFromIso(nativePtr, iso);
|
||||
}
|
||||
@Override
|
||||
public int lookupCCCFromE164(String e164) {
|
||||
isValid();
|
||||
return lookupCCCFromE164(nativePtr, e164);
|
||||
}
|
||||
private native int getError(long nativeptr);
|
||||
@Override
|
||||
public Reason getError() {
|
||||
isValid();
|
||||
return Reason.fromInt(getError(nativePtr));
|
||||
}
|
||||
private native void setPrivacy(long nativePtr, int mask);
|
||||
@Override
|
||||
public void setPrivacy(int privacy_mask) {
|
||||
isValid();
|
||||
setPrivacy(nativePtr,privacy_mask);
|
||||
}
|
||||
|
||||
private native int getPrivacy(long nativePtr);
|
||||
@Override
|
||||
public int getPrivacy() {
|
||||
isValid();
|
||||
return getPrivacy(nativePtr);
|
||||
}
|
||||
|
||||
|
||||
private native void enableAvpf(long nativePtr, boolean enable);
|
||||
@Override
|
||||
public void enableAvpf(boolean enable) {
|
||||
isValid();
|
||||
enableAvpf(nativePtr, enable);
|
||||
}
|
||||
|
||||
private native boolean avpfEnabled(long nativePtr);
|
||||
@Override
|
||||
public boolean avpfEnabled() {
|
||||
isValid();
|
||||
return avpfEnabled(nativePtr);
|
||||
}
|
||||
|
||||
|
||||
private native void setAvpfRRInterval(long nativePtr, int interval);
|
||||
@Override
|
||||
public void setAvpfRRInterval(int interval) {
|
||||
isValid();
|
||||
setAvpfRRInterval(nativePtr, interval);
|
||||
}
|
||||
|
||||
|
||||
private native int getAvpfRRInterval(long nativePtr);
|
||||
@Override
|
||||
public int getAvpfRRInterval() {
|
||||
isValid();
|
||||
return getAvpfRRInterval(nativePtr);
|
||||
}
|
||||
|
||||
|
||||
private native String getContactParameters(long ptr);
|
||||
@Override
|
||||
public String getContactParameters() {
|
||||
isValid();
|
||||
return getContactParameters(nativePtr);
|
||||
}
|
||||
|
||||
|
||||
private native void setContactUriParameters(long ptr, String params);
|
||||
@Override
|
||||
public void setContactUriParameters(String params) {
|
||||
isValid();
|
||||
setContactUriParameters(nativePtr,params);
|
||||
}
|
||||
|
||||
|
||||
private native String getContactUriParameters(long ptr);
|
||||
@Override
|
||||
public String getContactUriParameters() {
|
||||
isValid();
|
||||
return getContactUriParameters(nativePtr);
|
||||
}
|
||||
|
||||
private native long getErrorInfo(long nativePtr);
|
||||
|
||||
@Override
|
||||
public ErrorInfo getErrorInfo() {
|
||||
return new ErrorInfoImpl(getErrorInfo(nativePtr));
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4a919b63a6f4583d8dc464e32b542151359d264f
|
||||
Subproject commit 6155d6437712ac049be34b73ddc51a85d62c9f9b
|
||||
2
oRTP
2
oRTP
|
|
@ -1 +1 @@
|
|||
Subproject commit e56d11d0b062ea96c8356513add39511b7cb4043
|
||||
Subproject commit 99f33a0f510310389c22bf88a39582450be38425
|
||||
|
|
@ -306,6 +306,8 @@ static void call_outbound_with_multiple_proxy() {
|
|||
// calling marie should go through the second proxy config
|
||||
CU_ASSERT_TRUE(call(marie, pauline));
|
||||
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
|
||||
#if 0 /* TODO: activate test when the implementation is ready */
|
||||
|
|
@ -934,15 +936,11 @@ static void call_paused_resumed(void) {
|
|||
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 3000);
|
||||
|
||||
int exp_cum = - rtp_session_get_rcv_ext_seq_number(call_pauline->audiostream->ms.sessions.rtp_session);
|
||||
|
||||
linphone_core_pause_call(pauline->lc,call_pauline);
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPausing,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPausedByRemote,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1));
|
||||
|
||||
exp_cum += rtp_session_get_seq_number(linphone_core_get_current_call(marie->lc)->audiostream->ms.sessions.rtp_session);
|
||||
|
||||
/*stay in pause a little while in order to generate traffic*/
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 2000);
|
||||
|
||||
|
|
@ -953,11 +951,58 @@ static void call_paused_resumed(void) {
|
|||
/*same here: wait a while for a bit of a traffic, we need to receive a RTCP packet*/
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 5000);
|
||||
|
||||
/*there should be a bit of packets loss for the ones sent by PAUSED (pauline) between the latest RTCP SR report received
|
||||
by PAUSER (marie) because PAUSER will drop any packets received after the pause. Keep a tolerance of 1 more packet lost
|
||||
in case of ...*/
|
||||
/*since RTCP streams are reset when call is paused/resumed, there should be no loss at all*/
|
||||
stats = rtp_session_get_stats(call_pauline->sessions->rtp_session);
|
||||
CU_ASSERT_TRUE(abs(stats->cum_packet_loss - exp_cum)<=1);
|
||||
CU_ASSERT_EQUAL(stats->cum_packet_loss, 0);
|
||||
|
||||
/*just to sleep*/
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallEnd,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallEnd,1));
|
||||
|
||||
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
|
||||
static void call_paused_resumed_with_loss(void) {
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
|
||||
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
|
||||
LinphoneCall* call_pauline;
|
||||
const rtp_stats_t * stats;
|
||||
|
||||
|
||||
OrtpNetworkSimulatorParams params={0};
|
||||
params.enabled=TRUE;
|
||||
params.loss_rate=25;
|
||||
|
||||
|
||||
CU_ASSERT_TRUE(call(pauline,marie));
|
||||
call_pauline = linphone_core_get_current_call(pauline->lc);
|
||||
rtp_session_enable_network_simulation(call_pauline->audiostream->ms.sessions.rtp_session,¶ms);
|
||||
rtp_session_enable_network_simulation(call_pauline->videostream->ms.sessions.rtp_session,¶ms);
|
||||
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 4000);
|
||||
|
||||
linphone_core_pause_call(pauline->lc,call_pauline);
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPausing,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPausedByRemote,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPaused,1));
|
||||
|
||||
/*stay in pause a little while in order to generate traffic*/
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 2000);
|
||||
|
||||
linphone_core_resume_call(pauline->lc,call_pauline);
|
||||
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,2));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallStreamsRunning,2));
|
||||
/*same here: wait a while for a bit of a traffic, we need to receive a RTCP packet*/
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 5000);
|
||||
|
||||
/*since stats are NOT totally reset during pause, the stats->packet_recv is computed from
|
||||
the start of call. This test ensures that the loss rate is consistent during the entire call.*/
|
||||
stats = rtp_session_get_stats(call_pauline->sessions->rtp_session);
|
||||
CU_ASSERT_TRUE(((stats->cum_packet_loss * 100.f / stats->packet_recv) / params.loss_rate) > .5f);
|
||||
|
||||
/*just to sleep*/
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
|
|
@ -984,19 +1029,29 @@ static bool_t pause_call_1(LinphoneCoreManager* mgr_1,LinphoneCall* call_1,Linph
|
|||
static void call_paused_resumed_from_callee(void) {
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
|
||||
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
|
||||
LinphoneCall* call_obj;
|
||||
LinphoneCall* call_marie;
|
||||
const rtp_stats_t * stats;
|
||||
|
||||
CU_ASSERT_TRUE(call(pauline,marie));
|
||||
call_obj = linphone_core_get_current_call(marie->lc);
|
||||
call_marie = linphone_core_get_current_call(marie->lc);
|
||||
|
||||
linphone_core_pause_call(marie->lc,call_obj);
|
||||
linphone_core_pause_call(marie->lc,call_marie);
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPausing,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallPausedByRemote,1));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallPaused,1));
|
||||
|
||||
linphone_core_resume_call(marie->lc,call_obj);
|
||||
/*stay in pause a little while in order to generate traffic*/
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 2000);
|
||||
|
||||
linphone_core_resume_call(marie->lc,call_marie);
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneCallStreamsRunning,2));
|
||||
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallStreamsRunning,2));
|
||||
/*same here: wait a while for a bit of a traffic, we need to receive a RTCP packet*/
|
||||
wait_for_until(pauline->lc, marie->lc, NULL, 5, 5000);
|
||||
|
||||
/*since RTCP streams are reset when call is paused/resumed, there should be no loss at all*/
|
||||
stats = rtp_session_get_stats(call_marie->sessions->rtp_session);
|
||||
CU_ASSERT_EQUAL(stats->cum_packet_loss, 0);
|
||||
|
||||
/*just to sleep*/
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
|
|
@ -1007,7 +1062,6 @@ static void call_paused_resumed_from_callee(void) {
|
|||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
|
||||
|
||||
#ifdef VIDEO_ENABLED
|
||||
static bool_t add_video(LinphoneCoreManager* caller,LinphoneCoreManager* callee) {
|
||||
LinphoneVideoPolicy caller_policy;
|
||||
|
|
@ -2617,6 +2671,7 @@ test_t call_tests[] = {
|
|||
{ "Call terminated by caller", call_terminated_by_caller },
|
||||
{ "Call without SDP", call_with_no_sdp},
|
||||
{ "Call paused resumed", call_paused_resumed },
|
||||
{ "Call paused resumed with loss", call_paused_resumed_with_loss },
|
||||
{ "Call paused resumed from callee", call_paused_resumed_from_callee },
|
||||
{ "SRTP call", srtp_call },
|
||||
{ "ZRTP call",zrtp_call},
|
||||
|
|
|
|||
|
|
@ -513,3 +513,25 @@ enabled=true
|
|||
filter = (user-agent contains 'redirect') && !(request.uri.params contains 'redirected')
|
||||
contact= <sip:sipopen.example.org;redirected>
|
||||
|
||||
##
|
||||
## The purpose of the StatisticsCollector module is to collect call
|
||||
## statistics (RFC 6035) and store them on the server.
|
||||
##
|
||||
[module::StatisticsCollector]
|
||||
# Indicate whether the module is activated.
|
||||
# Default value: false
|
||||
enabled=true
|
||||
|
||||
# A request/response enters module if the boolean filter evaluates
|
||||
# to true. Ex: from.uri.domain contains 'sip.linphone.org', from.uri.domain
|
||||
# in 'a.org b.org c.org', (to.uri.domain in 'a.org b.org c.org')
|
||||
# && (user-agent == 'Linphone v2')
|
||||
# Default value:
|
||||
filter=
|
||||
|
||||
# SIP URI of the statistics collector. Note that the messages destinated
|
||||
# to this address will be deleted by this module and thus not be
|
||||
# delivered.
|
||||
# Default value:
|
||||
collector-address=sip:collector@sip.example.org
|
||||
|
||||
|
|
|
|||
3
tester/rcfiles/marie_remote_invalid_uri_rc
Normal file
3
tester/rcfiles/marie_remote_invalid_uri_rc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[misc]
|
||||
config-uri=/tmp/lol
|
||||
|
||||
|
|
@ -77,6 +77,12 @@ static void remote_provisioning_invalid(void) {
|
|||
linphone_core_manager_destroy(marie);
|
||||
}
|
||||
|
||||
static void remote_provisioning_invalid_uri(void) {
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new2("marie_remote_invalid_uri_rc", FALSE);
|
||||
CU_ASSERT_TRUE(wait_for(marie->lc,NULL,&marie->stat.number_of_LinphoneConfiguringFailed,1));
|
||||
linphone_core_manager_destroy(marie);
|
||||
}
|
||||
|
||||
static void remote_provisioning_default_values(void) {
|
||||
LinphoneProxyConfig *lpc;
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new2("marie_remote_default_values_rc", FALSE);
|
||||
|
|
@ -120,7 +126,8 @@ test_t remote_provisioning_tests[] = {
|
|||
{ "Remote provisioning invalid", remote_provisioning_invalid },
|
||||
{ "Remote provisioning transient successful", remote_provisioning_transient },
|
||||
{ "Remote provisioning default values", remote_provisioning_default_values },
|
||||
{ "Remote provisioning from file", remote_provisioning_file }
|
||||
{ "Remote provisioning from file", remote_provisioning_file },
|
||||
{ "Remote provisioning invalid URI", remote_provisioning_invalid_uri }
|
||||
};
|
||||
|
||||
test_suite_t remote_provisioning_test_suite = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue