aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2013-12-10 13:09:37 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-12-13 13:51:29 +0100
commit0a1bc56e5a55393ed5294a0671cd8feab78f454b (patch)
treecf2ee13ad6bff930d5243814db15c256b54e331e /openbsc/tests/mgcp
parent24754f0490b0f77fca4110402bbff08603a29360 (diff)
mgcp: Optionally send ptime in SDP
Currently the SDP 'ptime' media attribute is never set in generated MGCP responses. This patch optionally includes the 'ptime' attribute if packet_duration_ms is != 0. This behaviour can be enabled/disabled by using the VTY command "sdp audio-payload send-ptime" (enabled by default). Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/mgcp')
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index 8b5e17ddc..9777a4df9 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -81,7 +81,8 @@ static void test_strline(void)
"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"
+ "a=rtpmap:126 AMR/8000\r\n" \
+ "a=ptime:20\r\n"
#define MDCX4 "MDCX 18983216 1@mgw MGCP 1.0\r\n" \
"C: 2\r\n" \
"I: 1\r\n" \
@@ -102,7 +103,8 @@ static void test_strline(void)
"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"
+ "a=rtpmap:126 AMR/8000\r\n" \
+ "a=ptime:20\r\n"
#define MDCX4_PT1 "MDCX 18983217 1@mgw MGCP 1.0\r\n" \
"C: 2\r\n" \
@@ -168,7 +170,8 @@ static void test_strline(void)
"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"
+ "a=rtpmap:126 AMR/8000\r\n" \
+ "a=ptime:20\r\n"
#define CRCX_ZYN "CRCX 2 1@mgw MGCP 1.0\r" \
"M: sendrecv\r" \
@@ -186,7 +189,8 @@ static void test_strline(void)
"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"
+ "a=rtpmap:126 AMR/8000\r\n" \
+ "a=ptime:20\r\n"
#define DLCX "DLCX 7 1@mgw MGCP 1.0\r\n" \
"C: 2\r\n"
@@ -371,6 +375,13 @@ static void test_retransmission(void)
mgcp_endpoints_allocate(mgcp_trunk_alloc(cfg, 1));
+ /* reset endpoints */
+ for (i = 0; i < cfg->trunk.number_endpoints; i++) {
+ struct mgcp_endpoint *endp;
+ endp = &cfg->trunk.endpoints[i];
+ endp->bts_end.packet_duration_ms = 20;
+ }
+
for (i = 0; i < ARRAY_SIZE(retransmit); i++) {
const struct mgcp_test *t = &retransmit[i];
struct msgb *inp;