Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
neels has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15135 ) Change subject: test_mgcp_codec_pt_translate(): more tests .. test_mgcp_codec_pt_translate(): more tests Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 --- M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 2 files changed, 76 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 2c1e690..460ea9b 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1770,6 +1770,49 @@ }, }, { + .descr = "different order and different payload type numbers", + .codecs = { + { + { 0, "PCMU/8000/1", NULL, }, + { 111, "GSM-HR-08/8000/1", NULL, }, + { 112, "AMR/8000/1", _param_octet_aligned_true, }, + }, + { + { 97, "GSM-HR-08/8000/1", NULL, }, + { 0, "PCMU/8000/1", NULL, }, + { 96, "AMR/8000/1", _param_octet_aligned_true, }, + }, + }, + .expect = { + { .payload_type_map = {112, 96}, }, + { .payload_type_map = {0, 0}, }, + { .payload_type_map = {111, 97} }, + { .payload_type_map = {123, -EINVAL} }, + { .end = true }, + }, + }, + { + .descr = "both sides have the same payload_type numbers assigned to differing codecs", + .codecs = { + { + { 0, "PCMU/8000/1", NULL, }, + { 96, "GSM-HR-08/8000/1", NULL, }, + { 97, "AMR/8000/1", _param_octet_aligned_true, }, + }, + { + { 97, "GSM-HR-08/8000/1", NULL, }, + { 0, "PCMU/8000/1", NULL, }, + { 96, "AMR/8000/1", _param_octet_aligned_true, }, + }, + }, + .expect = { + { .payload_type_map = {96, 97}, }, + { .payload_type_map = {97, 96}, }, + { .payload_type_map = {0, 0}, }, + { .end = true }, + }, + }, + { .descr = "conn0 has no codecs", .codecs = { { diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok index 677cdc8..708e0c3 100644 --- a/tests/mgcp/mgcp_test.ok +++ b/tests/mgcp/mgcp_test.ok @@ -1235,7 +1235,38 @@ - mgcp_codec_pt_translate(conn0, conn1, 111) -> 97 - mgcp_codec_pt_translate(conn1, conn0, 97) -> 111 - mgcp_codec_pt_translate(conn0, conn1, 123) -> -22 -#1: conn0 has no codecs +#1: different order and different payload type numbers + - add codecs on conn0: +0: 0 PCMU/8000/1 -> rc=0 +1: 111 GSM-HR-08/8000/1 -> rc=0 +2: 112 AMR/8000/1 octet-aligned=1 -> rc=0 + - add codecs on conn1: +0: 97 GSM-HR-08/8000/1 -> rc=0 +1: 0 PCMU/8000/1 -> rc=0 +2: 96 AMR/8000/1 octet-aligned=1 -> rc=0 + - mgcp_codec_pt_translate(conn0, conn1, 112) -> 96 + - mgcp_codec_pt_translate(conn1, conn0, 96) -> 112 + - mgcp_codec_pt_translate(conn0, conn1, 0) -> 0 + - mgcp_codec_pt_translate(conn1, conn0, 0) -> 0 + - mgcp_codec_pt_translate(conn0, conn1, 111) -> 97 + - mgcp_codec_pt_translate(conn1, conn0, 97) -> 111 + - mgcp_codec_pt_translate(conn0, conn1, 123) -> -22 +#2: both sides have the same payload_type numbers assigned to differing codecs + - add codecs on conn0: +0: 0 PCMU/8000/1 -> rc=0 +1: 96 GSM-HR-08/8000/1 -> rc=0 +2: 97 AMR/8000/1 octet-aligned=1 -> rc=0 + - add codecs on conn1: +0: 97 GSM-HR-08/8000/1 -> rc=0 +1: 0 PCMU/8000/1 -> rc=0 +2: 96 AMR/8000/1 octet-aligned=1 -> rc=0 + - mgcp_codec_pt_translate(conn0, conn1, 96) -> 97 + - mgcp_codec_pt_translate(conn1, conn0, 97) -> 96 + - mgcp_codec_pt_translate(conn0, conn1, 97) -> 96 + - mgcp_codec_pt_translate(conn1, conn0, 96) -> 97 + - mgcp_codec_pt_translate(conn0, conn1, 0) -> 0 + - mgcp_codec_pt_translate(conn1, conn0, 0) -> 0 +#3: conn0 has no codecs - add codecs on conn0: (none) - add codecs on conn1: @@ -1245,7 +1276,7 @@ - mgcp_codec_pt_translate(conn0, conn1, 112) -> -22 - mgcp_codec_pt_translate(conn0, conn1, 0) -> -22 - mgcp_codec_pt_translate(conn0, conn1, 111) -> -22 -#2: conn1 has no codecs +#4: conn1 has no codecs - add codecs on conn0: 0: 112 AMR/8000/1 octet-aligned=1 -> rc=0
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15135 ) Change subject: test_mgcp_codec_pt_translate(): more tests .. Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 Gerrit-Change-Number: 15135 Gerrit-PatchSet: 5 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: neels Gerrit-Reviewer: osmith Gerrit-Reviewer: pespin Gerrit-Comment-Date: Wed, 28 Aug 2019 07:22:53 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15135 ) Change subject: test_mgcp_codec_pt_translate(): more tests .. Patch Set 4: Code-Review+1 Thanks, much clearer now -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 Gerrit-Change-Number: 15135 Gerrit-PatchSet: 4 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-Reviewer: pespin Gerrit-Comment-Date: Wed, 14 Aug 2019 09:11:45 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
Hello pespin, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 to look at the new patch set (#4). Change subject: test_mgcp_codec_pt_translate(): more tests .. test_mgcp_codec_pt_translate(): more tests Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 --- M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 2 files changed, 76 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/35/15135/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 Gerrit-Change-Number: 15135 Gerrit-PatchSet: 4 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15135 ) Change subject: test_mgcp_codec_pt_translate(): more tests .. Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/15135/3/tests/mgcp/mgcp_test.c File tests/mgcp/mgcp_test.c: https://gerrit.osmocom.org/#/c/15135/3/tests/mgcp/mgcp_test.c@1795 PS3, Line 1795: .descr = "both sides have the same payload_type numbers assigned to conflicting codecs", > Are they really conflicting? This looks misleading, since it's actually fine, > right? with conflicting I mean the same number means something different on the other side. The test verifies that even those get translated properly. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 Gerrit-Change-Number: 15135 Gerrit-PatchSet: 3 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: neels Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 13 Aug 2019 22:21:56 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin Gerrit-MessageType: comment
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15135 ) Change subject: test_mgcp_codec_pt_translate(): more tests .. Patch Set 3: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/15135/3/tests/mgcp/mgcp_test.c File tests/mgcp/mgcp_test.c: https://gerrit.osmocom.org/#/c/15135/3/tests/mgcp/mgcp_test.c@1795 PS3, Line 1795: .descr = "both sides have the same payload_type numbers assigned to conflicting codecs", Are they really conflicting? This looks misleading, since it's actually fine, right? -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 Gerrit-Change-Number: 15135 Gerrit-PatchSet: 3 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 13 Aug 2019 09:32:33 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 to look at the new patch set (#2). Change subject: test_mgcp_codec_pt_translate(): more tests .. test_mgcp_codec_pt_translate(): more tests Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 --- M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 2 files changed, 76 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/35/15135/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 Gerrit-Change-Number: 15135 Gerrit-PatchSet: 2 Gerrit-Owner: neels Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15135 Change subject: test_mgcp_codec_pt_translate(): more tests .. test_mgcp_codec_pt_translate(): more tests Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1 --- M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 2 files changed, 112 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/35/15135/1 diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 2c1e690..44e8234 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1770,6 +1770,49 @@ }, }, { + .descr = "different order and different payload type numbers", + .codecs = { + { + { 0, "PCMU/8000/1", NULL, }, + { 111, "GSM-HR-08/8000/1", NULL, }, + { 112, "AMR/8000/1", _param_octet_aligned_true, }, + }, + { + { 97, "GSM-HR-08/8000/1", NULL, }, + { 0, "PCMU/8000/1", NULL, }, + { 96, "AMR/8000/1", _param_octet_aligned_true, }, + }, + }, + .expect = { + { .payload_type_map = {112, 96}, }, + { .payload_type_map = {0, 0}, }, + { .payload_type_map = {111, 97} }, + { .payload_type_map = {123, -EINVAL} }, + { .end = true }, + }, + }, + { + .descr = "both sides have the same payload_type numbers assigned to conflicting codecs", + .codecs = { + { + { 0, "PCMU/8000/1", NULL, }, + { 96, "GSM-HR-08/8000/1", NULL, }, + { 97, "AMR/8000/1", _param_octet_aligned_true, }, + }, + { + { 97, "GSM-HR-08/8000/1", NULL, }, + { 0, "PCMU/8000/1", NULL, }, + { 96, "AMR/8000/1", _param_octet_aligned_true, }, + }, + }, + .expect = { + { .payload_type_map = {96, 97}, }, + { .payload_type_map = {97, 96}, }, + { .payload_type_map = {0, 0}, }, + { .end = true }, + }, + }, + { .descr = "conn0 has no codecs", .codecs = { { diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok index 6f4da10..13d1870 100644 --- a/tests/mgcp/mgcp_test.ok +++ b/tests/mgcp/mgcp_test.ok @@ -1218,6 +1218,75 @@ p10, aPCMU -> (null) '10,a :PCMU' -> '(null)' +Testing mgcp_codec_pt_translate() +#0: same order, but differing payload type numbers + - add codecs on conn0: +0: 112 AMR/8000/1 octet-aligned=1 -> rc=0 +1: 0 PCMU/8000/1 -> rc=0 +2: 111 GSM-HR-08/8000/1 -> rc=0 + - add codecs on conn1: +0: 96 AMR/8000/1 octet-aligned=1 -> rc=0 +1: 0 PCMU/8000/1 -> rc=0 +2: 97 GSM-HR-08/8000/1 -> rc=0 + - mgcp_codec_pt_translate(conn0, conn1, 112) -> 96 + - mgcp_codec_pt_translate(conn1, conn0, 96) -> 112 + - mgcp_codec_pt_translate(conn0, conn1, 0) -> 0 + - mgcp_codec_pt_translate(conn1, conn0, 0) -> 0 + - mgcp_codec_pt_translate(conn0, conn1, 111) -> 97 + - mgcp_codec_pt_translate(conn1, conn0, 97) -> 111 + - mgcp_codec_pt_translate(conn0, conn1, 123) -> -22 +#1: different order and different payload type numbers + - add codecs on conn0: +0: 0 PCMU/8000/1 -> rc=0 +1: 111 GSM-HR-08/8000/1 -> rc=0 +2: 112 AMR/8000/1 octet-aligned=1 -> rc=0 + - add codecs on conn1: +0: 97 GSM-HR-08/8000/1 -> rc=0 +1: 0 PCMU/8000/1 -> rc=0 +2: 96 AMR/8000/1 octet-aligned=1 -> rc=0 + - mgcp_codec_pt_translate(conn0, conn1, 112) -> 96 + - mgcp_codec_pt_translate(conn1, conn0, 96) -> 112 + - mgcp_codec_pt_translate(conn0, conn1, 0) -> 0 + - mgcp_codec_pt_translate(conn1, conn0, 0) -> 0 + - mgcp_codec_pt_translate(conn0, conn1, 111) -> 97 + - mgcp_codec_pt_translate(conn1, conn0, 97) -> 111 + - mgcp_codec_pt_translate(conn0, conn1, 123) -> -22 +#2: both sides have the same payload_type numbers assigned to conflicting codecs + - add codecs on conn0: +0: 0 PCMU/8000/1 -> rc=0 +1: 96 GSM-HR-08/8000/1 -> rc=0 +2: 97 AMR/8000/1 octet-aligned=1 -> rc=0 + - add codecs on conn1: +0: 97 GSM-HR-08/8000/1 -> rc=0 +1: 0 PCMU/8000/1 -> rc=0 +2: 96 AMR/8000/1 octet-aligned=1 -> rc=0 + - mgcp_codec_pt_translate(conn0, conn1, 96) -> 97 + - mgcp_codec_pt_translate(conn1, conn0, 97) -> 96 + - mgcp_codec_pt_translate(conn0, conn1, 97) -> 96 + -