falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/41678?usp=email )
Change subject: rtp_stream: drop use of codecs[] in struct mgcp_conn_peer
......................................................................
rtp_stream: drop use of codecs[] in struct mgcp_conn_peer
struct mgcp_conn_peer in libosmo-mgcp-client API used to have a
mandatory codecs[] array for codec specification and an optional
ptmap[] array to be used only when the default payload type needs
to be overridden. But now the codecs[] array is deprecated;
the new way is to use ptmap[] to communicate both codecs and
payload types.
These .codecs[] and .codecs_len members in struct mgcp_conn_peer
have been marked as deprecated (and the new way of using only
ptmap[] became available as API) several release cycles ago,
but osmo-msc kept filling out both arrays, leading to compilation
warnings. Remove this use of deprecated API.
Change-Id: I165be5c00bad3d293db2469ee4bedcbe968afcdc
---
M src/libmsc/rtp_stream.c
1 file changed, 0 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/78/41678/1
diff --git a/src/libmsc/rtp_stream.c b/src/libmsc/rtp_stream.c
index eb9ba7e..14014c0 100644
--- a/src/libmsc/rtp_stream.c
+++ b/src/libmsc/rtp_stream.c
@@ -329,13 +329,11 @@
codec->subtype_name);
continue;
}
- verb_info.codecs[i] = m->mgcp;
verb_info.ptmap[i] = (struct ptmap){
.codec = m->mgcp,
.pt = codec->payload_type,
};
i++;
- verb_info.codecs_len = i;
verb_info.ptmap_len = i;
}
rtps->codecs_sent_to_mgw = true;
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/41678?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I165be5c00bad3d293db2469ee4bedcbe968afcdc
Gerrit-Change-Number: 41678
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41675?usp=email )
Change subject: unittest/test_files.TransparentEF_Test: Actually test encoder
......................................................................
unittest/test_files.TransparentEF_Test: Actually test encoder
In the test_encode_file() method, we should actually test the encoder,
and not the decoder. I suppose this was a copy+paste mistake at some
point? In the LinearFixedEF_Test.test_encoder_record we were already
testing the encoder. Just TransparentEF_Test got it wrong...
Change-Id: Id23305a78ab9acd2e006f2b26b72408795844d23
---
M tests/unittests/test_files.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/75/41675/1
diff --git a/tests/unittests/test_files.py b/tests/unittests/test_files.py
index a3ccf06..ab70771 100755
--- a/tests/unittests/test_files.py
+++ b/tests/unittests/test_files.py
@@ -256,8 +256,8 @@
encoded = t[0]
decoded = t[1]
logging.debug("Testing encode of %s", name)
- re_dec = inst.decode_hex(encoded)
- self.assertEqual(decoded, re_dec)
+ re_enc = inst.encode_hex(decoded)
+ self.assertEqual(encoded, re_enc)
def test_de_encode_file(self):
"""Test the decoder and encoder for a transparent EF. Performs first a decoder
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41675?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id23305a78ab9acd2e006f2b26b72408795844d23
Gerrit-Change-Number: 41675
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41676?usp=email )
Change subject: unittests/test_files: Pass to-be-encoded length to encoder functions
......................................................................
unittests/test_files: Pass to-be-encoded length to encoder functions
Some of the encoders can only generate valid output if they are told
the expected output size. This is due to variable-length fields that
depend on the size of the total record (or file). Let's always pass
the expected length to the encoder methods.
Change-Id: I88f957e49b0c88a121a266d3582e79822fa0e214
---
M tests/unittests/test_files.py
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/76/41676/1
diff --git a/tests/unittests/test_files.py b/tests/unittests/test_files.py
index ab70771..5bbbddd 100755
--- a/tests/unittests/test_files.py
+++ b/tests/unittests/test_files.py
@@ -96,7 +96,7 @@
inst = c()
encoded, rec_num, decoded = self._parse_t(t)
logging.debug("Testing encode of %s", name)
- re_enc = inst.encode_record_hex(decoded, rec_num)
+ re_enc = inst.encode_record_hex(decoded, rec_num, len(encoded)//2)
self.assertEqual(encoded.upper(), re_enc.upper())
def test_de_encode_record(self):
@@ -122,7 +122,7 @@
self.assertEqual(decoded, re_dec)
# re-encode the decoded data
logging.debug("Testing re-encode of %s", name)
- re_enc = inst.encode_record_hex(re_dec, rec_num)
+ re_enc = inst.encode_record_hex(re_dec, rec_num, len(encoded)//2)
self.assertEqual(encoded.upper(), re_enc.upper())
if hasattr(c, '_test_no_pad') and c._test_no_pad:
continue
@@ -196,7 +196,7 @@
self.assertEqual(decoded, re_dec)
# re-encode the decoded data
logging.debug("Testing re-encode of %s", name)
- re_enc = inst.encode_record_hex(re_dec)
+ re_enc = inst.encode_record_hex(re_dec, len(encoded)//2)
self.assertEqual(encoded.upper(), re_enc.upper())
# there's no point in testing padded input, as TransRecEF have a fixed record
# size and we cannot ever receive more input data than that size.
@@ -256,7 +256,7 @@
encoded = t[0]
decoded = t[1]
logging.debug("Testing encode of %s", name)
- re_enc = inst.encode_hex(decoded)
+ re_enc = inst.encode_hex(decoded, len(encoded)//2)
self.assertEqual(encoded, re_enc)
def test_de_encode_file(self):
@@ -280,7 +280,7 @@
self.assertEqual(decoded, re_dec)
logging.debug("Testing re-encode of %s", name)
re_dec = inst.decode_hex(encoded)
- re_enc = inst.encode_hex(re_dec)
+ re_enc = inst.encode_hex(re_dec, len(encoded)//2)
self.assertEqual(encoded.upper(), re_enc.upper())
if hasattr(c, '_test_no_pad') and c._test_no_pad:
continue
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41676?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I88f957e49b0c88a121a266d3582e79822fa0e214
Gerrit-Change-Number: 41676
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>