accept MGCP without SDP
SDP is an optional part of MGCP messages. Do not fail when there is no SDP part. Practically this is useful to compose simpler MGCP responses from TTCN3 tests. osmo-mgw itself always includes SDP, so there is no real impact on operating libosmo-mgcp-client with osmo-mgw from osmo-bsc or osmo-msc. Change-Id: I608001626459ea72415fb142f857550bbb90c683
This commit is contained in:
parent
923d60bb12
commit
e827831514
|
@ -466,9 +466,8 @@ int mgcp_response_parse_params(struct mgcp_response *r)
|
|||
/* Find beginning of the parameter (SDP) section */
|
||||
data_ptr = mgcp_find_section_end(data);
|
||||
if (!data_ptr) {
|
||||
LOGP(DLMGCP, LOGL_ERROR,
|
||||
"MGCP response: cannot find start of SDP parameters\n");
|
||||
rc = -EINVAL;
|
||||
LOGP(DLMGCP, LOGL_DEBUG, "MGCP response contains no SDP parameters\n");
|
||||
rc = 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -360,7 +360,7 @@ struct sdp_section_start_test {
|
|||
static struct sdp_section_start_test sdp_section_start_tests[] = {
|
||||
{
|
||||
.body = "",
|
||||
.expect_rc = -EINVAL,
|
||||
.expect_rc = 0,
|
||||
},
|
||||
{
|
||||
.body = "\n\n",
|
||||
|
@ -399,19 +399,19 @@ static struct sdp_section_start_test sdp_section_start_tests[] = {
|
|||
.body = "some mgcp header data\r\nand header params"
|
||||
"\n\r\n"
|
||||
"m=audio 23\r\n",
|
||||
.expect_rc = -EINVAL,
|
||||
.expect_rc = 0,
|
||||
},
|
||||
{
|
||||
.body = "some mgcp header data\r\nand header params"
|
||||
"\r\n\r"
|
||||
"m=audio 23\r\n",
|
||||
.expect_rc = -EINVAL,
|
||||
.expect_rc = 0,
|
||||
},
|
||||
{
|
||||
.body = "some mgcp header data\r\nand header params"
|
||||
"\n\r\r"
|
||||
"m=audio 23\r\n",
|
||||
.expect_rc = -EINVAL,
|
||||
.expect_rc = 0,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -17,8 +17,9 @@ test_mgcp_client_cancel() done
|
|||
|
||||
test_sdp_section_start() test [0]:
|
||||
body: ""
|
||||
DLMGCP MGCP response: cannot find start of SDP parameters
|
||||
got rc=-22
|
||||
DLMGCP MGCP response contains no SDP parameters
|
||||
got rc=0
|
||||
got audio_port=0
|
||||
|
||||
test_sdp_section_start() test [1]:
|
||||
body: "\n\n"
|
||||
|
@ -52,18 +53,21 @@ got audio_port=23
|
|||
|
||||
test_sdp_section_start() test [7]:
|
||||
body: "some mgcp header data\r\nand header params\n\r\nm=audio 23\r\n"
|
||||
DLMGCP MGCP response: cannot find start of SDP parameters
|
||||
got rc=-22
|
||||
DLMGCP MGCP response contains no SDP parameters
|
||||
got rc=0
|
||||
got audio_port=0
|
||||
|
||||
test_sdp_section_start() test [8]:
|
||||
body: "some mgcp header data\r\nand header params\r\n\rm=audio 23\r\n"
|
||||
DLMGCP MGCP response: cannot find start of SDP parameters
|
||||
got rc=-22
|
||||
DLMGCP MGCP response contains no SDP parameters
|
||||
got rc=0
|
||||
got audio_port=0
|
||||
|
||||
test_sdp_section_start() test [9]:
|
||||
body: "some mgcp header data\r\nand header params\n\r\rm=audio 23\r\n"
|
||||
DLMGCP MGCP response: cannot find start of SDP parameters
|
||||
got rc=-22
|
||||
DLMGCP MGCP response contains no SDP parameters
|
||||
got rc=0
|
||||
got audio_port=0
|
||||
DLMGCP ptmap contains illegal mapping: codec=113 maps to pt=2
|
||||
DLMGCP ptmap contains illegal mapping: codec=0 maps to pt=100
|
||||
DLMGCP ptmap contains illegal mapping: codec=113 maps to pt=2
|
||||
|
|
Loading…
Reference in New Issue