diff options
author | Harald Welte <laforge@gnumonks.org> | 2013-10-06 12:23:35 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2013-10-06 12:23:35 +0200 |
commit | 2bfc01dfd8830cf36bb8f7564604f7f357c0a0fb (patch) | |
tree | 6267e0a2f1d464d223842efefecb7b7aa61a2612 | |
parent | 51b796122ccb3f7952d8826c75bd803c0df65992 (diff) |
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.
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | src/trau/osmo_ortp.c | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 8b4014a..c285dad 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 7faca41..7dcff60 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -37,6 +37,7 @@ #include <ortp/port.h> #include <ortp/rtpsession.h> +#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; |