From 0a1bc56e5a55393ed5294a0671cd8feab78f454b Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 10 Dec 2013 13:09:37 +0100 Subject: 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 --- openbsc/tests/mgcp/mgcp_test.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'openbsc/tests') 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; -- cgit v1.2.3