From 7cd96d33badf38269ad348dc7915371691598dcf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 27 Jun 2014 17:13:17 +0200 Subject: [PATCH] fix git version checking when not in a git tree add linphone_proxy_config_pause_register() make linphone_core_remove_proxy_config() really send unregister. --- coreapi/Makefile.am | 22 ++++++++++++++-------- coreapi/linphonecore.h | 1 + coreapi/proxy.c | 18 ++++++++++++++++-- mediastreamer2 | 2 +- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index e2db1d2c1..8a3b62daf 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -91,7 +91,7 @@ if HAVE_LD_OUTPUT_DEF liblinphone_la_LDFLAGS += -Wl,--output-def,liblinphone-$(LIBLINPHONE_SO_CURRENT).def defexecdir = $(libdir) defexec_DATA = liblinphone-$(LIBLINPHONE_SO_CURRENT).def -CLEANFILES = $(defexec_DATA) +CLEANFILES += $(defexec_DATA) liblinphone-$(LIBLINPHONE_SO_CURRENT).def: liblinphone.la @@ -156,15 +156,21 @@ AM_CFLAGS+= -DUSE_BELLESIP AM_CXXFLAGS=$(AM_CFLAGS) +#Make sure that we are in linphone's git tree by doing git log $(top_srcdir)/configure.ac. +#if it is something known to git, then that will be ok to check the git describe number and make sure it is consistent with +#the PACKAGE_VERSION given in configure.ac + make_gitversion_h: - if test "$(GITDESCRIBE)" != "" ; then \ - if test "$(GIT_TAG)" != "$(PACKAGE_VERSION)" ; then \ - echo "*** PACKAGE_VERSION and git tag differ. Please put them identical."; \ - exit 1; \ + if test -d $(top_srcdir)/.git ; then \ + if test "$(GITDESCRIBE)" != "" ; then \ + if test "$(GIT_TAG)" != "$(PACKAGE_VERSION)" ; then \ + echo "*** PACKAGE_VERSION and git tag differ. Please put them identical."; \ + exit 1; \ + fi ; \ + $(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(GITDESCRIBE)\"" > $(GITVERSION_FILE_TMP) ; \ + elif test "$(GITREVISION)" != "" ; then \ + $(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(LINPHONE_VERSION)_$(GITREVISION)\"" > $(GITVERSION_FILE_TMP) ; \ fi ; \ - $(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(GITDESCRIBE)\"" > $(GITVERSION_FILE_TMP) ; \ - elif test "$(GITREVISION)" != "" ; then \ - $(ECHO) -n "#define LIBLINPHONE_GIT_VERSION \"$(LINPHONE_VERSION)_$(GITREVISION)\"" > $(GITVERSION_FILE_TMP) ; \ else \ $(ECHO) -n "" > $(GITVERSION_FILE_TMP) ; \ fi diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 05776a89d..825a41697 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -908,6 +908,7 @@ LINPHONE_PUBLIC const char *linphone_proxy_config_get_addr(const LinphoneProxyCo LINPHONE_PUBLIC int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj); +LINPHONE_PUBLIC void linphone_proxy_config_pause_register(LinphoneProxyConfig *obj); LINPHONE_PUBLIC const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj, const char *contact_params); LINPHONE_PUBLIC void linphone_proxy_config_set_contact_uri_parameters(LinphoneProxyConfig *obj, const char *contact_uri_params); diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 201035606..ad7234a7b 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -307,6 +307,19 @@ void linphone_proxy_config_set_expires(LinphoneProxyConfig *obj, int val){ void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val){ obj->publish=val; } + +/** + * Prevent a proxy config from refreshing its registration. + * This is useful to let registrations to expire naturally (or) when the application wants to keep control on when + * refreshes are sent. + * However, linphone_core_set_network_reachable(lc,TRUE) will always request the proxy configs to refresh their registrations. + * The refreshing operations can be resumed with linphone_proxy_config_refresh_register(). + * @param obj the proxy config +**/ +void linphone_proxy_config_pause_register(LinphoneProxyConfig *obj){ + if (obj->op) sal_op_stop_refreshing(obj->op); +} + /** * Starts editing a proxy configuration. * @@ -327,7 +340,7 @@ void linphone_proxy_config_edit(LinphoneProxyConfig *obj){ linphone_proxy_config_store_server_config(obj); /*stop refresher in any case*/ - if (obj->op) sal_op_stop_refreshing(obj->op); + linphone_proxy_config_pause_register(obj); } void linphone_proxy_config_apply(LinphoneProxyConfig *obj,LinphoneCore *lc){ @@ -1090,7 +1103,7 @@ int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cfg){ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cfg){ /* check this proxy config is in the list before doing more*/ if (ms_list_find(lc->sip_conf.proxies,cfg)==NULL){ - ms_error("linphone_core_remove_proxy_config: LinphoneProxyConfig %p is not known by LinphoneCore (programming error?)",cfg); + ms_error("linphone_core_remove_proxy_config: LinphoneProxyConfig [%p] is not known by LinphoneCore (programming error?)",cfg); return; } lc->sip_conf.proxies=ms_list_remove(lc->sip_conf.proxies,cfg); @@ -1102,6 +1115,7 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf linphone_proxy_config_edit(cfg); linphone_proxy_config_enable_register(cfg,FALSE); linphone_proxy_config_done(cfg); + linphone_proxy_config_update(cfg); /*so that it has an effect*/ } if (lc->default_proxy==cfg){ lc->default_proxy=NULL; diff --git a/mediastreamer2 b/mediastreamer2 index bcb80cd10..71bce450a 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bcb80cd105e3fe4c96a66ab4b80b87a92dcb21c7 +Subproject commit 71bce450a360361039cfdf1967095bcd2a842af3