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/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
index 14ec221..6b72965 100644
--- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c
@@ -49,6 +49,10 @@
 
 #include "../../bscconfig.h"
 
+#ifdef BUILD_MGCP_TRANSCODING
+#include "mgcp_transcode.h"
+#endif
+
 /* this is here for the vty... it will never be called */
 void subscr_put() { abort(); }
 
@@ -207,6 +211,12 @@
 	if (!cfg)
 		return -1;
 
+#ifdef BUILD_MGCP_TRANSCODING
+	cfg->setup_rtp_processing_cb = &mgcp_transcoding_setup;
+	cfg->rtp_processing_cb = &mgcp_transcoding_process_rtp;
+	cfg->get_net_downlink_format_cb = &mgcp_transcoding_net_downlink_format;
+#endif
+
 	vty_info.copyright = openbsc_copyright;
 	vty_init(&vty_info);
 	logging_vty_add_cmds(&log_info);