diff --git a/build/android/common.mk b/build/android/common.mk index 551ac6c10..cd1dfdf01 100644 --- a/build/android/common.mk +++ b/build/android/common.mk @@ -154,6 +154,11 @@ LOCAL_STATIC_LIBRARIES += \ endif endif +ifeq ($(BUILD_UPNP),1) +LOCAL_CFLAGS += -DBUILD_UPNP +LOCAL_SRC_FILES += upnp.c +endif + LOCAL_STATIC_LIBRARIES += libspeex ifeq ($(BUILD_SRTP), 1) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 275a2c9f3..36f3f6b82 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1309,7 +1309,7 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta #endif #ifdef BUILD_UPNP lc->upnp = linphone_upnp_context_new(lc); -#endif //BUILD_UPNP +#endif //BUILD_UPNP if (lc->vtable.display_status) lc->vtable.display_status(lc,_("Ready")); lc->auto_net_state_mon=lc->sip_conf.auto_net_state_mon; @@ -1412,7 +1412,7 @@ void linphone_core_get_local_ip(LinphoneCore *lc, const char *dest, char *result strncpy(result,ip,LINPHONE_IPADDR_SIZE); return; } -#endif //BUILD_UPNP +#endif //BUILD_UPNP if (linphone_core_get_local_ip_for(lc->sip_conf.ipv6_enabled ? AF_INET6 : AF_INET,dest,result)==0) return; /*else fallback to SAL routine that will attempt to find the most realistic interface */ @@ -3043,7 +3043,7 @@ int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const #endif //VIDEO_ENABLED } -#if BUILD_UPNP +#ifdef BUILD_UPNP if(call->upnp_session != NULL) { linphone_core_update_upnp_from_remote_media_description(call, sal_call_get_remote_media_description(call->op)); #ifdef VIDEO_ENABLED @@ -4260,6 +4260,12 @@ const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc) } void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy pol){ +#ifndef BUILD_UPNP + if(pol == LinphonePolicyUseUpnp) { + ms_warning("UPNP is not available, reset firewall policy to no firewall"); + pol = LinphonePolicyNoFirewall; + } +#endif //BUILD_UPNP lc->net_conf.firewall_policy=pol; if (lc->sip_conf.contact) update_primary_contact(lc); if (linphone_core_ready(lc)) @@ -5229,7 +5235,7 @@ static void linphone_core_uninit(LinphoneCore *lc) #ifdef BUILD_UPNP linphone_upnp_context_destroy(lc->upnp); lc->upnp = NULL; -#endif //BUILD_UPNP +#endif //BUILD_UPNP if (lc->friends) /* FIXME we should wait until subscription to complete*/ ms_list_for_each(lc->friends,(void (*)(void *))linphone_friend_close_subscriptions); diff --git a/coreapi/private.h b/coreapi/private.h index edf759d05..9c6cc85f0 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -42,7 +42,7 @@ extern "C" { #include "mediastreamer2/msconference.h" #ifdef BUILD_UPNP #include "upnp.h" -#endif //BUILD_UPNP +#endif //BUILD_UPNP #ifndef LIBLINPHONE_VERSION #define LIBLINPHONE_VERSION LINPHONE_VERSION diff --git a/mediastreamer2 b/mediastreamer2 index a964bf24c..eeaab2239 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a964bf24c47febe55276a8b5ef3e323503c08668 +Subproject commit eeaab2239d6545f18d5219b62adda8d1dda3b104