aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-04 08:13:53 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-22 14:48:07 +0200
commit4c18d7947522a36ddc2cc4cd3d4286a03dc3a8cb (patch)
treedbd16b775d141cdc1185ebead137ac6233bea506 /openbsc/tests/mgcp
parentc8b29083d27b9070dbc5690d0632db411b706326 (diff)
mgcp: Add a testcase for 160->80 ptime handling
Diffstat (limited to 'openbsc/tests/mgcp')
-rw-r--r--openbsc/tests/mgcp/mgcp_transcoding_test.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/tests/mgcp/mgcp_transcoding_test.c b/openbsc/tests/mgcp/mgcp_transcoding_test.c
index 397469560..e163f7162 100644
--- a/openbsc/tests/mgcp/mgcp_transcoding_test.c
+++ b/openbsc/tests/mgcp/mgcp_transcoding_test.c
@@ -343,6 +343,25 @@ static void test_transcode_result(void)
}
{
+ /* 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;