aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-17 15:19:57 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-08-17 15:22:30 +0200
commitd17bc7b3a8bce2c507a2e72459b34c07b7fdcd52 (patch)
treeab46181cb17acbc5713891f548e5a9d84fcaad39 /openbsc/tests/mgcp
parenta334e90ddf99697ad6b18df80f1cd7473b2314d4 (diff)
mgcp: Avoid crashing when rtpmap is not complete
The NAT sends an incomplete SDP file for the purpose of informing the BSC about the remote IP/PORT early. The case of an incomplete SDP file was not considered. Check if there is a codec and if not skip it. TODO: We need to have a better end-point life cycle test.
Diffstat (limited to 'openbsc/tests/mgcp')
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index d5018591b..df2ab29ae 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -350,7 +350,7 @@ static void test_strline(void)
"v=0\r\n" \
"o=- 1439038275 1439038275 IN IP4 192.168.181.247\r\n" \
"s=-\r\nc=IN IP4 192.168.181.247\r\n" \
- "t=0 0\r\nm=audio 29084 RTP/AVP 0 8 3 18 4 96 97 101\r\n" \
+ "t=0 0\r\nm=audio 29084 RTP/AVP 255 0 8 3 18 4 96 97 101\r\n" \
"a=rtpmap:0 PCMU/8000\r\n" \
"a=rtpmap:8 PCMA/8000\r\n" \
"a=rtpmap:3 gsm/8000\r\n" \
@@ -1068,8 +1068,8 @@ static void test_multilple_codec(void)
OSMO_ASSERT(last_endpoint == 5);
endp = &cfg->trunk.endpoints[last_endpoint];
- OSMO_ASSERT(endp->net_end.codec.payload_type == 0);
- OSMO_ASSERT(endp->net_end.alt_codec.payload_type == 8);
+ OSMO_ASSERT(endp->net_end.codec.payload_type == 255);
+ OSMO_ASSERT(endp->net_end.alt_codec.payload_type == 0);
talloc_free(cfg);
}