From 4c18d7947522a36ddc2cc4cd3d4286a03dc3a8cb Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 4 Jul 2014 08:13:53 +0200 Subject: mgcp: Add a testcase for 160->80 ptime handling --- openbsc/tests/mgcp/mgcp_transcoding_test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openbsc/tests/mgcp') 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 @@ -342,6 +342,25 @@ static void test_transcode_result(void) talloc_free(ctx); } + { + /* 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); -- cgit v1.2.3