From 2bfc01dfd8830cf36bb8f7564604f7f357c0a0fb Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 6 Oct 2013 12:23:35 +0200 Subject: enable support of libortp >= 0.21, which has an API breakage in libortp >= 0.21, rtp_session_set_local_addr() has one extra argument for the RTCP port. --- configure.ac | 10 +++++++++- src/trau/osmo_ortp.c | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8b4014a2..c285dad8 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,15 @@ AM_CONFIG_HEADER(config.h) PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.10) -PKG_CHECK_MODULES(ORTP, ortp >= 0.13.1) +PKG_CHECK_MODULES([ORTP], [ortp >= 0.13.1], + [ + PKG_CHECK_MODULES([ORTP], [ortp >= 0.21], + [AC_DEFINE(HAVE_ORTP_021, 1, + [libortp >= 0.21])], + [AC_DEFINE(HAVE_ORTP_021, 0, + [libortp < 0.21])]) + ] +) AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 7faca417..7dcff60c 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -37,6 +37,7 @@ #include #include +#include "config.h" static PayloadType *payload_type_efr; static PayloadType *payload_type_hr; @@ -348,8 +349,11 @@ struct osmo_rtp_socket *osmo_rtp_socket_create(void *talloc_ctx, unsigned int fl int osmo_rtp_socket_bind(struct osmo_rtp_socket *rs, const char *ip, int port) { int rc; - +#ifdef HAVE_ORTP_021 + rc = rtp_session_set_local_addr(rs->sess, ip, port, port+1); +#else rc = rtp_session_set_local_addr(rs->sess, ip, port); +#endif if (rc < 0) return rc; -- cgit v1.2.3