mgcp: Add a testcase for 160->80 ptime handling
diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c
index 3974695..e163f71 100644
--- a/openbsc/tests/mgcp/mgcp_transcoding_test.c
+++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c
@@ -343,6 +343,25 @@
}
{
+ /* from GSM to PCMA and same ptime */
+ given_configured_endpoint(160, 160, "gsm", "pcma", &ctx, &endp);
+ state = endp->bts_end.rtp_process_data;
+
+ /* result */
+ len = audio_packets_gsm[0].len;
+ memcpy(buf, audio_packets_gsm[0].data, len);
+ res = mgcp_transcoding_process_rtp(endp, &endp->bts_end, buf, &len, ARRAY_SIZE(buf));
+ OSMO_ASSERT(res == sizeof(struct rtp_hdr));
+ OSMO_ASSERT(state->sample_cnt == 0);
+
+ len = res;
+ res = mgcp_transcoding_process_rtp(endp, &endp->bts_end, buf, &len, ARRAY_SIZE(buf));
+ OSMO_ASSERT(res == -EAGAIN);
+
+ talloc_free(ctx);
+ }
+
+ {
/* from PCMA to GSM and wrong different ptime */
given_configured_endpoint(80, 160, "pcma", "gsm", &ctx, &endp);
state = endp->bts_end.rtp_process_data;