mgcp: Add RTP audio transcoding

This patch implements audio transcoding between the formats GSM,
PCMA, L16, and optionally G.729.

The feature needs to be enabled by using the autoconf option
'--enable-mgcp-transcoding'. In this case mgcp_transcode.c will
be compiled and linked to osmo-bsc_mgcp, and the transcoding
functions provided will be registered as processing callbacks.

If G.729 support is required, libcg729 needs to be installed and
'--with-g729' must be passed to ./configure.

Ticket: OW#1111
Sponsored-by: On-Waves ehf
diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/openbsc/src/osmo-bsc_mgcp/Makefile.am
index 7b62621..be39977 100644
--- a/openbsc/src/osmo-bsc_mgcp/Makefile.am
+++ b/openbsc/src/osmo-bsc_mgcp/Makefile.am
@@ -1,11 +1,17 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)
 AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) \
-	$(LIBOSMOVTY_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS)
+	$(LIBOSMOVTY_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) \
+	$(LIBBCG729_CFLAGS)
 
 bin_PROGRAMS = osmo-bsc_mgcp
 
 osmo_bsc_mgcp_SOURCES = mgcp_main.c
+if BUILD_MGCP_TRANSCODING
+    osmo_bsc_mgcp_SOURCES += mgcp_transcode.c
+endif
 osmo_bsc_mgcp_LDADD = $(top_builddir)/src/libcommon/libcommon.a \
 		 $(top_builddir)/src/libmgcp/libmgcp.a -lrt \
 		 $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) \
-		 $(LIBOSMONETIF_LIBS)
+		 $(LIBOSMONETIF_LIBS) $(LIBBCG729_LIBS)
+
+noinst_HEADERS = g711common.h mgcp_transcode.h