summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-27 00:37:23 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-27 00:37:23 +0100
commit27fa7901bb97823add780eb75df14bde8a02bd82 (patch)
tree32c2c5b1f3bdf74f4c040ed6edcfb710d2885e83
parentf74da14c0105dae12179acf8c94348c4b84ced84 (diff)
MGCP: Add CRCX test cases
The second test case (CRCX_ZYN) fails as the message is not compliant with the spec. However, our parer should be more tolerant, just in case...
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index 6add9b375..bbbdff5e2 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -29,6 +29,33 @@
#define AUEP2 "AUEP 18983213 ds/e1-2/1@172.16.6.66 MGCP 1.0\r\n"
#define AUEP2_RET "500 18983213 FAIL\r\n"
+#define CRCX "CRCX 2 1@mgw MGCP 1.0\r\n" \
+ "M: sendrecv\r\n" \
+ "C: 2\r\n" \
+ "\r\n" \
+ "v=0\r\n" \
+ "c=IN IP4 123.12.12.123\r\n" \
+ "m=audio 5904 RTP/AVP 97\r\n" \
+ "a=rtpmap:97 GSM-EFR/8000\r\n"
+
+#define CRCX_RET "200 2 OK\r\n" \
+ "I: 1\n" \
+ "\n" \
+ "v=0\r\n" \
+ "o=- 1 23 IN IP4 0.0.0.0\r\n" \
+ "c=IN IP4 0.0.0.0\r\n" \
+ "t=0 0\r\n" \
+ "m=audio 0 RTP/AVP 126\r\n" \
+ "a=rtpmap:126 AMR/8000\r\n"
+
+
+#define CRCX_ZYN "CRCX 2 1@mgw MGCP 1.0\r" \
+ "M: sendrecv\r" \
+ "C: 2\r\r" \
+ "v=0\r" \
+ "c=IN IP4 123.12.12.123\r" \
+ "m=audio 5904 RTP/AVP 97\r" \
+ "a=rtpmap:97 GSM-EFR/8000\r"
struct mgcp_test {
const char *name;
@@ -39,6 +66,8 @@ struct mgcp_test {
const struct mgcp_test tests[] = {
{ "AUEP1", AUEP1, AUEP1_RET },
{ "AUEP2", AUEP2, AUEP2_RET },
+ { "CRCX", CRCX, CRCX_RET },
+ { "CRCX_ZYN", CRCX_ZYN, CRCX_RET },
};
static struct msgb *create_msg(const char *str)