mgcp/rtp: Add test case for RTP timestamp patching and stats

This patch adds a test case to check, whether RTP timestamps are
generated properly after SSRC changes and whether the error counters
work properly.

Sponsored-by: On-Waves ehf
diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c
index 6966be6..72d0a5c 100644
--- a/openbsc/src/libmgcp/mgcp_network.c
+++ b/openbsc/src/libmgcp/mgcp_network.c
@@ -209,9 +209,9 @@
  * There is also no probation period for new sources. Every package
  * we receive will be seen as a switch in streams.
  */
-static void patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *state,
-			    struct mgcp_rtp_end *rtp_end, struct sockaddr_in *addr,
-			    char *data, int len)
+void mgcp_patch_and_count(struct mgcp_endpoint *endp, struct mgcp_rtp_state *state,
+			  struct mgcp_rtp_end *rtp_end, struct sockaddr_in *addr,
+			  char *data, int len)
 {
 	uint32_t arrival_time;
 	int32_t transit, d;
@@ -369,9 +369,9 @@
 
 	if (dest == MGCP_DEST_NET) {
 		if (is_rtp) {
-			patch_and_count(endp, &endp->bts_state,
-					&endp->net_end,
-					addr, buf, rc);
+			mgcp_patch_and_count(endp, &endp->bts_state,
+					     &endp->net_end,
+					     addr, buf, rc);
 			forward_data(endp->net_end.rtp.fd,
 				     &endp->taps[MGCP_TAP_NET_OUT], buf, rc);
 			return mgcp_udp_send(endp->net_end.rtp.fd,
@@ -384,9 +384,9 @@
 		}
 	} else {
 		if (is_rtp) {
-			patch_and_count(endp, &endp->net_state,
-					&endp->bts_end,
-					addr, buf, rc);
+			mgcp_patch_and_count(endp, &endp->net_state,
+					     &endp->bts_end,
+					     addr, buf, rc);
 			forward_data(endp->bts_end.rtp.fd,
 				     &endp->taps[MGCP_TAP_BTS_OUT], buf, rc);
 			return mgcp_udp_send(endp->bts_end.rtp.fd,