*) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
esac],[build_tools=check])
+dnl check for installed version of libupnp
+AC_ARG_ENABLE(upnp,
+ [AS_HELP_STRING([--disable-upnp], [Disable uPnP support])],
+ [case "${enableval}" in
+ yes) build_upnp=true ;;
+ no) build_upnp=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-upnp) ;;
+ esac],[build_upnp=auto])
+
+if test "$build_upnp" != "false" ; then
+PKG_CHECK_MODULES([LIBUPNP], [libupnp], [build_upnp=true],
+ [
+ if test "$build_upnp" == "true" ; then
+ AC_MSG_ERROR([libupnp not found.])
+ else
+ build_upnp=false
+ fi
+ ])
+
+fi
+
+AM_CONDITIONAL(BUILD_UPNP, test x$build_upnp != xfalse)
+if test "$build_upnp" != "false" ; then
+ AC_DEFINE(BUILD_UPNP, 1, [Define if upnp enabled])
+fi
+
dnl check libxml2 (needed for tools)
if test "$build_tools" != "false" ; then
PKG_CHECK_MODULES(LIBXML2, [libxml-2.0],[],
conference.c \
linphone_tunnel.cc \
$(GITVERSION_FILE)
+
+if BUILD_UPNP
+liblinphone_la_SOURCES+=upnp.c
+endif
if BUILD_WIZARD
liblinphone_la_SOURCES+=sipwizard.c
#include "mediastreamer2/ice.h"
#include "mediastreamer2/mediastream.h"
#include "mediastreamer2/msconference.h"
+#ifdef BUILD_UPNP
+#include "mediastreamer2/upnp_igd.h"
+#endif
#ifndef LIBLINPHONE_VERSION
#define LIBLINPHONE_VERSION LINPHONE_VERSION
bool_t network_reachable;
bool_t use_preview_window;
- time_t network_last_check;
- bool_t network_last_status;
+ time_t network_last_check;
+ bool_t network_last_status;
bool_t ringstream_autorelease;
bool_t pad[3];
LinphoneTunnel *tunnel;
char* device_id;
MSList *last_recv_msg_ids;
+#ifdef BUILD_UPNP
+ upnp_igd_context *upnp_igd_ctxt;
+#endif
};
LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc);
int linphone_core_get_edge_bw(LinphoneCore *lc);
int linphone_core_get_edge_ptime(LinphoneCore *lc);
+int linphone_upnp_init(LinphoneCore *lc);
+void linphone_upnp_destroy(LinphoneCore *lc);
+
#ifdef __cplusplus
}
#endif
--- /dev/null
+/*
+linphone
+Copyright (C) 2012 Belledonne Communications SARL
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+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.
+*/
+
+#include "private.h"
+#include "mediastreamer2/upnp_igd.h"
+
+/* Convert uPnP IGD logs to ortp logs */
+void linphone_upnp_igd_print(void *cookie, upnp_igd_print_level level, const char *fmt, va_list list) {
+ int ortp_level = ORTP_DEBUG;
+ switch(level) {
+ case UPNP_IGD_MESSAGE:
+ ortp_level = ORTP_MESSAGE;
+ break;
+ case UPNP_IGD_WARNING:
+ ortp_level = ORTP_WARNING;
+ break;
+ case UPNP_IGD_ERROR:
+ ortp_level = ORTP_ERROR;
+ break;
+ default:
+ break;
+ }
+ ortp_logv(level, fmt, list);
+}
+
+void linphone_upnp_igd_callback(void *cookie, upnp_igd_event event, void *arg) {
+}
+
+int linphone_upnp_init(LinphoneCore *lc) {
+ lc->upnp_igd_ctxt = NULL;
+ return 0;
+}
+void linphone_upnp_destroy(LinphoneCore *lc) {
+
+}
-Subproject commit 9c3f1bdf1f7b51c5eeb020f68ef9a4019c66cc52
+Subproject commit 2093868ac68ffe62310cd0ad20b58ffa6860d7e3