neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35247?usp=email )
Change subject: drop (now) unused code
......................................................................
drop (now) unused code
Removing the duality of codecs[] and ptmap[] in structs mgcp_msg,
mgcp_response and mgcp_conn_peer has removed the need to "map" from
codec type enum to payload type number. They are stored together now.
Remove functions that are no longer used.
None of our current libosmo-mgcp clients call these functions.
Change-Id: I84e5285831397c992af59deee12dea8458d16cc6
---
M TODO-RELEASE
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.err
M tests/mgcp_client/mgcp_client_test.ok
6 files changed, 21 insertions(+), 177 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/35247/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 82368ff..7335858 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -35,3 +35,8 @@
mgcp_client_cancel()
mgcp_msg_gen()
mgcp_msg_trans_id()
+libosmo-mgcp-client remove public API Since codecs[] has been deprecated in favor of ptmap[], there is no use
+ for the following functions; all known callers have been within
+ osmo-mgw.git:
+ map_codec_to_pt()
+ map_pt_to_codec()
diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h
index 1d33690..e1748a6 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -119,9 +119,5 @@
}
enum mgcp_codecs map_str_to_codec(const char *str);
-unsigned int map_codec_to_pt(const struct ptmap *ptmap, unsigned int ptmap_len,
- enum mgcp_codecs codec);
-enum mgcp_codecs map_pt_to_codec(struct ptmap *ptmap, unsigned int ptmap_len,
- unsigned int pt);
const char *mgcp_client_name(const struct mgcp_client *mgcp);
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 8ccb859..3daa10f 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -105,94 +105,6 @@
return -1;
}
-/* Check the ptmap for illegal mappings */
-static int check_ptmap(const struct ptmap *ptmap)
-{
- /* Check if there are mappings that leave the IANA assigned dynamic
- * payload type range. Under normal conditions such mappings should
- * not occur */
-
- /* Its ok to have a 1:1 mapping in the statically defined
- * range, this won't hurt */
- if (ptmap->codec == ptmap->pt)
- return 0;
-
- if (ptmap->codec < 96 || ptmap->codec > 127)
- goto error;
- if (ptmap->pt < 96 || ptmap->pt > 127)
- goto error;
-
- return 0;
-error:
- LOGP(DLMGCP, LOGL_ERROR,
- "ptmap contains illegal mapping: codec=%u maps to pt=%u\n",
- ptmap->codec, ptmap->pt);
- return -1;
-}
-
-/*! Map a codec to a payload type.
- * \ptmap[in] payload pointer to payload type map with specified payload types.
- * \ptmap[in] ptmap_len length of the payload type map.
- * \ptmap[in] codec the codec for which the payload type should be looked up.
- * \returns assigned payload type */
-unsigned int map_codec_to_pt(const struct ptmap *ptmap, unsigned int ptmap_len,
- enum mgcp_codecs codec)
-{
- unsigned int i;
-
- /*! Note: If the payload type map is empty or the codec is not found
- * in the map, then a 1:1 mapping is performed. If the codec falls
- * into the statically defined range or if the mapping table isself
- * tries to map to the statically defined range, then the mapping
- * is also ignored and a 1:1 mapping is performed instead. */
-
- /* we may return the codec directly since enum mgcp_codecs directly
- * corresponds to the statically assigned payload types */
- if (codec < 96 || codec > 127)
- return codec;
-
- for (i = 0; i < ptmap_len; i++) {
- /* Skip illegal map entries */
- if (check_ptmap(ptmap) == 0 && ptmap->codec == codec)
- return ptmap->pt;
- ptmap++;
- }
-
- /* If nothing is found, do not perform any mapping */
- return codec;
-}
-
-/*! Map a payload type to a codec.
- * \ptmap[in] payload pointer to payload type map with specified payload types.
- * \ptmap[in] ptmap_len length of the payload type map.
- * \ptmap[in] payload type for which the codec should be looked up.
- * \returns codec that corresponds to the specified payload type */
-enum mgcp_codecs map_pt_to_codec(struct ptmap *ptmap, unsigned int ptmap_len,
- unsigned int pt)
-{
- unsigned int i;
-
- /*! Note: If the payload type map is empty or the payload type is not
- * found in the map, then a 1:1 mapping is performed. If the payload
- * type falls into the statically defined range or if the mapping
- * table isself tries to map to the statically defined range, then
- * the mapping is also ignored and a 1:1 mapping is performed
- * instead. */
-
- /* See also note in map_codec_to_pt() */
- if (pt < 96 || pt > 127)
- return pt;
-
- for (i = 0; i < ptmap_len; i++) {
- if (check_ptmap(ptmap) == 0 && ptmap->pt == pt)
- return ptmap->codec;
- ptmap++;
- }
-
- /* If nothing is found, do not perform any mapping */
- return pt;
-}
-
static void _mgcp_client_conf_init(struct mgcp_client_conf *conf)
{
/* NULL and -1 default to MGCP_CLIENT_*_DEFAULT values */
diff --git a/tests/mgcp_client/mgcp_client_test.c b/tests/mgcp_client/mgcp_client_test.c
index 3883c3a..e3dd10a 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -571,57 +571,6 @@
OSMO_ASSERT(map_str_to_codec("AMR-WB####################################################################################################################") == -1);
}
-static void test_map_codec_to_pt_and_map_pt_to_codec(void)
-{
- struct ptmap ptmap[10];
- unsigned int ptmap_len;
- unsigned int i;
-
- ptmap[0].codec = CODEC_GSMEFR_8000_1;
- ptmap[0].pt = 96;
- ptmap[1].codec = CODEC_GSMHR_8000_1;
- ptmap[1].pt = 97;
- ptmap[2].codec = CODEC_AMR_8000_1;
- ptmap[2].pt = 98;
- ptmap[3].codec = CODEC_AMRWB_16000_1;
- ptmap[3].pt = 99;
- ptmap_len = 4;
-
- /* Mappings that are covered by the table */
- for (i = 0; i < ptmap_len; i++)
- printf(" %u => %u\n", ptmap[i].codec, map_codec_to_pt(ptmap, ptmap_len, ptmap[i].codec));
- for (i = 0; i < ptmap_len; i++)
- printf(" %u <= %u\n", ptmap[i].pt, map_pt_to_codec(ptmap, ptmap_len, ptmap[i].pt));
- printf("\n");
-
- /* Map some codecs/payload types from the static range, result must
- * always be a 1:1 mapping */
- printf(" %u => %u\n", CODEC_PCMU_8000_1, map_codec_to_pt(ptmap, ptmap_len, CODEC_PCMU_8000_1));
- printf(" %u => %u\n", CODEC_GSM_8000_1, map_codec_to_pt(ptmap, ptmap_len, CODEC_GSM_8000_1));
- printf(" %u => %u\n", CODEC_PCMA_8000_1, map_codec_to_pt(ptmap, ptmap_len, CODEC_PCMA_8000_1));
- printf(" %u => %u\n", CODEC_G729_8000_1, map_codec_to_pt(ptmap, ptmap_len, CODEC_G729_8000_1));
- printf(" %u <= %u\n", CODEC_PCMU_8000_1, map_pt_to_codec(ptmap, ptmap_len, CODEC_PCMU_8000_1));
- printf(" %u <= %u\n", CODEC_GSM_8000_1, map_pt_to_codec(ptmap, ptmap_len, CODEC_GSM_8000_1));
- printf(" %u <= %u\n", CODEC_PCMA_8000_1, map_pt_to_codec(ptmap, ptmap_len, CODEC_PCMA_8000_1));
- printf(" %u <= %u\n", CODEC_G729_8000_1, map_pt_to_codec(ptmap, ptmap_len, CODEC_G729_8000_1));
- printf("\n");
-
- /* Try to do mappings from statically defined range to danymic range and vice versa. This
- * is illegal and should result into a 1:1 mapping */
- ptmap[3].codec = CODEC_AMRWB_16000_1;
- ptmap[3].pt = 2;
- ptmap[4].codec = CODEC_PCMU_8000_1;
- ptmap[4].pt = 100;
- ptmap_len = 5;
-
- /* Apply all mappings again, the illegal ones we defined should result into 1:1 mappings */
- for (i = 0; i < ptmap_len; i++)
- printf(" %u => %u\n", ptmap[i].codec, map_codec_to_pt(ptmap, ptmap_len, ptmap[i].codec));
- for (i = 0; i < ptmap_len; i++)
- printf(" %u <= %u\n", ptmap[i].pt, map_pt_to_codec(ptmap, ptmap_len, ptmap[i].pt));
- printf("\n");
-}
-
void test_mgcp_client_e1_epname(void)
{
char *epname;
@@ -700,7 +649,6 @@
test_mgcp_msg();
test_mgcp_client_cancel();
test_sdp_section_start();
- test_map_codec_to_pt_and_map_pt_to_codec();
test_map_str_to_codec();
test_mgcp_client_e1_epname();
diff --git a/tests/mgcp_client/mgcp_client_test.err b/tests/mgcp_client/mgcp_client_test.err
index 22ad3cc..5bd34a84 100644
--- a/tests/mgcp_client/mgcp_client_test.err
+++ b/tests/mgcp_client/mgcp_client_test.err
@@ -128,10 +128,6 @@
body: "some mgcp header data\r\nand header params\r\n\r\nc=IN IP4 \r\n"
DLMGCP Failed to parse MGCP response header (audio ip)
got rc=-22
-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
-DLMGCP ptmap contains illegal mapping: codec=0 maps to pt=100
DLMGCP MGW(mgw) MGCP client: using endpoint domain '@mgw'
DLMGCP MGW(mgw) Cannot compose MGCP e1-endpoint name (ds/e1-15/s-1/su128-0@mgw), rate(128)/offset(0) combination is invalid!
DLMGCP MGW(mgw) Cannot compose MGCP e1-endpoint name (ds/e1-15/s-1/su8-16@mgw), rate(8)/offset(16) combination is invalid!
diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok
index 039fbd9..b16d1bc 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -181,35 +181,6 @@
test_sdp_section_start() test [17]:
test_sdp_section_start() test [18]:
- 110 => 96
- 111 => 97
- 112 => 98
- 113 => 99
- 96 <= 110
- 97 <= 111
- 98 <= 112
- 99 <= 113
-
- 0 => 0
- 3 => 3
- 8 => 8
- 18 => 18
- 0 <= 0
- 3 <= 3
- 8 <= 8
- 18 <= 18
-
- 110 => 96
- 111 => 97
- 112 => 98
- 113 => 113
- 0 => 0
- 96 <= 110
- 97 <= 111
- 98 <= 112
- 2 <= 2
- 100 <= 100
-
ds/e1-1/s-15/su64-0@mgw
ds/e1-2/s-14/su32-0@mgw
ds/e1-3/s-13/su32-4@mgw
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35247?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I84e5285831397c992af59deee12dea8458d16cc6
Gerrit-Change-Number: 35247
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
neels has uploaded a new patch set (#10) to the change originally created by dexter. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34350?usp=email )
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: mgcp_client_fsm: explain member param in struct mgcp_conn_peer better
......................................................................
mgcp_client_fsm: explain member param in struct mgcp_conn_peer better
The struct member param specifies additional codec parameters. Let's
improve its explaination.
Change-Id: Iea4dc1e72fccaa464ce503fae88b5d8a867b1d19
Related: OS#6171
---
M include/osmocom/mgcp_client/mgcp_client_fsm.h
1 file changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/34350/10
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34350?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Iea4dc1e72fccaa464ce503fae88b5d8a867b1d19
Gerrit-Change-Number: 34350
Gerrit-PatchSet: 10
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter, neels.
neels has uploaded a new patch set (#11) to the change originally created by dexter. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34404?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by neels, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: mgcp_client_fsm: allocate struct mgcp_conn_peer dynamically
......................................................................
mgcp_client_fsm: allocate struct mgcp_conn_peer dynamically
The struct mgcp_conn_peer is allocated statically at the moment. This is
an ABI compatibility in case the struct changes.
Add an alloc function for this struct that API users can use, and
indicate its use in a comment on struct mgcp_conn_peer.
It is not necessary to dynamically allocate the mgcp_conn_peer struct
within libosmo-mgcp-client, because the problem arises only when ABIs
interact. Hence leaving mgcp_client_endpoint_fsm.c's use static.
Related: OS#6171
Change-Id: I523d0fcb020f7d46323c497a4be9ee00d5f242ba
---
M include/osmocom/mgcp_client/mgcp_client_fsm.h
M src/libosmo-mgcp-client/mgcp_client_endpoint_fsm.c
M src/libosmo-mgcp-client/mgcp_client_fsm.c
3 files changed, 59 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/04/34404/11
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34404?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I523d0fcb020f7d46323c497a4be9ee00d5f242ba
Gerrit-Change-Number: 34404
Gerrit-PatchSet: 11
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, neels, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-mgw/+/34900?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Code-Review+1 by pespin, Code-Review+2 by laforge, Code-Review-1 by neels, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: add fmtp string to ptmap: allow all possible fmtp
......................................................................
add fmtp string to ptmap: allow all possible fmtp
Remove the limit of having only one AMR octet-aligned fmtp parameter per
MGCP message. Instead allow any arbitrary fmtp options, one per every
codec.
Deprecate all use of struct mgcp_codec_param. Instead, store and pass
plain fmtp strings.
We need to know fmtp details only for AMR, and only to probe whether it
is octet-aligned. So add a separate fmtp string parser that returns that
information flexibly, as in
if (osmo_mgcp_fmtp_get_int("octet-aligned", 0) == 1) ...
Provide legacy shims that still act correctly for any callers that may
pass the old struct mgcp_codec_param. (I'm not sure if we need to keep
this, but we can always drop it in another patch.)
Adjust one mgcp_test.c: instead of returning only the octet-aligned
parameter, now osmo-mgw keeps and returns all the fmtp parameters that
the user provided. So add the missing "mode-change-capability".
Related: OS#6171
Change-Id: If58590bda8627519ff07e0b6f43aa47a274f052b
---
M include/osmocom/mgcp/Makefile.am
A include/osmocom/mgcp/fmtp.h
M include/osmocom/mgcp/mgcp_codec.h
M include/osmocom/mgcp/mgcp_common.h
M include/osmocom/mgcp/mgcp_network.h
M include/osmocom/mgcp_client/mgcp_client.h
M include/osmocom/mgcp_client/mgcp_client_fsm.h
M src/libosmo-mgcp-client/mgcp_client.c
M src/libosmo-mgcp/Makefile.am
A src/libosmo-mgcp/fmtp.c
M src/libosmo-mgcp/mgcp_codec.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
M tests/mgcp/mgcp_test.c
15 files changed, 268 insertions(+), 100 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/00/34900/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34900?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If58590bda8627519ff07e0b6f43aa47a274f052b
Gerrit-Change-Number: 34900
Gerrit-PatchSet: 7
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/35132?usp=email )
(
7 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Transmit invalid AMR speech blocks instead of dummy FACCH
......................................................................
Transmit invalid AMR speech blocks instead of dummy FACCH
Every BTS needs to have some graceful handling for the scenario
where it is time to send out a speech frame on TCH DL, but there is
no frame to be sent. One possible solution is to transmit dummy
FACCH, but this option is unattractive for TCH/AHS where FACCH
displaces two speech frames rather than one. A more elegant solution
is to emit a speech frame that is bad, causing the MS receiver to
declare a BFI condition to trigger substitution and muting procedure.
A bad frame is generated by gsm0503_tch_{afs,ahs}_encode() by setting
the payload length to 0.
Depends: libosmocore.git I82ce2adf995a4b42d1f378c5819f88d773b9104a
Related: OS#6049
Change-Id: I056f379715c91ad968f198e112d363a9009dc1c3
---
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
2 files changed, 57 insertions(+), 8 deletions(-)
Approvals:
Jenkins Builder: Verified
falconia: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 0138a2a..b621b23 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -538,15 +538,14 @@
/* - If the channel mode is TCH/FS or TCH/EFS, transmit a dummy
* speech block with inverted CRC3, designed to induce a BFI
* condition in the MS receiver.
+ * - If the channel mode is TCH/AFS, transmit a dummy speech
+ * block with inverted CRC6, designed to induce a BFI
+ * condition in the MS receiver.
* - If the channel mode is one of the CSD modes, transmit an
* idle frame as described in 3GPP TS 44.021, sections 8.1.6
* and 10.2.3 (all data, status and E-bits set to binary '1').
* - In all other channel modes, transmit dummy FACCH
* like we always did before.
- *
- * FIXME: someone who knows AMR needs to look at this problem
- * and decide what is the correct BTS Tx behavior for frame
- * gaps in TCH/AFS. See OS#6049.
*/
switch (tch_mode) {
case GSM48_CMODE_DATA_12k0:
@@ -562,6 +561,21 @@
/* fall-through */
case GSM48_CMODE_SIGN:
default:
+ if (tch_mode == GSM48_CMODE_SPEECH_AMR) {
+ /* the first FN 4,13,21 defines that CMI is included in frame,
+ * the first FN 0,8,17 defines that CMR is included in frame.
+ */
+ rc = gsm0503_tch_afs_encode(BUFPOS(bursts_p, 0),
+ NULL, 0,
+ !sched_tchf_dl_amr_cmi_map[br->fn % 26],
+ chan_state->codec,
+ chan_state->codecs,
+ chan_state->dl_ft,
+ chan_state->dl_cmr);
+ if (rc == 0)
+ goto send_burst;
+ }
+
/* TODO: use randomized padding */
msg_facch = tch_dummy_msgb(GSM_MACBLOCK_LEN, GSM_MACBLOCK_PADDING);
/* dummy LAPDm func=UI frame */
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index e0d7aca..05e1af4 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -453,15 +453,14 @@
/* - If the channel mode is TCH/HS, transmit a dummy speech block
* with inverted CRC3, designed to induce a BFI condition in
* the MS receiver.
+ * - If the channel mode is TCH/AHS, transmit a dummy speech
+ * block with inverted CRC6, designed to induce a BFI
+ * condition in the MS receiver.
* - If the channel mode is one of the CSD modes, transmit an
* idle frame as described in 3GPP TS 44.021, sections 8.1.6
* and 10.2.3 (all data, status and E-bits set to binary '1').
* - In all other channel modes, transmit dummy FACCH
* like we always did before.
- *
- * FIXME: someone who knows AMR needs to look at this problem
- * and decide what is the correct BTS Tx behavior for frame
- * gaps in TCH/AHS. See OS#6049.
*/
switch (tch_mode) {
case GSM48_CMODE_DATA_6k0:
@@ -474,6 +473,21 @@
/* fall-through */
case GSM48_CMODE_SIGN:
default:
+ if (tch_mode == GSM48_CMODE_SPEECH_AMR) {
+ /* the first FN 4,13,21 or 5,14,22 defines that CMI is included
+ * in frame, the first FN 0,8,17 or 1,9,18 defines that CMR is
+ * included in frame. */
+ rc = gsm0503_tch_ahs_encode(BUFPOS(bursts_p, 0),
+ NULL, 0,
+ !sched_tchh_dl_amr_cmi_map[br->fn % 26],
+ chan_state->codec,
+ chan_state->codecs,
+ chan_state->dl_ft,
+ chan_state->dl_cmr);
+ if (rc == 0)
+ goto send_burst;
+ }
+
/* FACCH/H can only be scheduled at specific TDMA offset */
if (!sched_tchh_dl_facch_map[br->fn % 26]) {
/* FACCH/H is not allowed, send half-filled bursts with even numbered
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35132?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I056f379715c91ad968f198e112d363a9009dc1c3
Gerrit-Change-Number: 35132
Gerrit-PatchSet: 8
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35243?usp=email )
Change subject: tlv: Fix encoding of zero-valued TLVs
......................................................................
tlv: Fix encoding of zero-valued TLVs
If a TLV was elementary (no nested IEs), and it had only a single
integer content whose value is 0, we erroneously encoded that as
zero-length TLV (len=0, no value part):
>>> rf = pySim.euicc.RefreshFlag(decoded=0);
>>> rf.to_bytes()
b''
>>> rf.to_tlv()
b'\x81\x00'
After this change it is correct:
>>> rf = pySim.euicc.RefreshFlag(decoded=0);
>>> rf.to_bytes()
b'\x00'
>>> rf.to_tlv()
b'\x81\x01\x00'
Change-Id: I5f4c0555cff7df9ccfc4a56da12766d1bf89122f
---
M pySim/tlv.py
1 file changed, 28 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/43/35243/1
diff --git a/pySim/tlv.py b/pySim/tlv.py
index 1ecc806..c85d92b 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -87,7 +87,7 @@
def to_bytes(self) -> bytes:
"""Convert from internal representation to binary bytes. Store the binary result
in the internal state and return it."""
- if not self.decoded:
+ if self.decoded == None:
do = b''
elif self._construct:
do = self._construct.build(self.decoded, total_len=None)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35243?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5f4c0555cff7df9ccfc4a56da12766d1bf89122f
Gerrit-Change-Number: 35243
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/35242?usp=email )
Change subject: vty: Retrieve IP addr set from sk when dumping xUA server
......................................................................
vty: Retrieve IP addr set from sk when dumping xUA server
Until now we simply printed back the configured set of IP addresses, not
the one retrieved from the socket at the time, because we didn't have
any easy means to retrieve multiple addresses from a socket.
This is possible since recently using libosmocore APIs. Use them.
Depends: libosmo-netif.git Change-Id osmo_stream_srv_link_get_sockname()
Depends: libosmocore.git Change-Id I48950754ed6f61ee5ffa04a447fab8903f10acc0
Related: SYS#6636
Change-Id: I331b6e2fe11cd97e286b7ba684d4a17b8055f9d4
---
M TODO-RELEASE
M src/osmo_ss7_vty.c
2 files changed, 44 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/42/35242/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 1e4c41a..2b15a91 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -9,3 +9,4 @@
#library what description / commit summary line
libosmocore >1.9.0 osmo_sock_multiaddr_{add,del}_local_addr()
libosmo-netif >1.4.0 osmo_stream_{srv,cli}_get_fd()
+libosmocore >1.9,0 osmo_sock_multiaddr_get_ip_and_port(), osmo_multiaddr_ip_and_port_snprintf()
\ No newline at end of file
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 5a637b4..6ab2401 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -610,11 +610,33 @@
static void vty_dump_xua_server(struct vty *vty, struct osmo_xua_server *xs)
{
- char buf[512];
+ char buf[OSMO_SOCK_MAX_ADDRS * INET6_ADDRSTRLEN + OSMO_SOCK_MAX_ADDRS + 2 + 6 + 1];
const char *proto = get_value_string(osmo_ss7_asp_protocol_vals, xs->cfg.proto);
- if (osmo_ss7_asp_peer_snprintf(buf, sizeof(buf), &xs->cfg.local) < 0)
- snprintf(buf, sizeof(buf), "<error>");
- vty_out(vty, "xUA server for %s on %s%s", proto, buf, VTY_NEWLINE);
+ int fd = xs->server ? osmo_stream_srv_link_get_fd(xs->server) : -1;
+
+ if (fd < 0) {
+ if (osmo_ss7_asp_peer_snprintf(buf, sizeof(buf), &xs->cfg.local) < 0)
+ snprintf(buf, sizeof(buf), "<error>");
+ } else {
+ char hostbuf[OSMO_SOCK_MAX_ADDRS][INET6_ADDRSTRLEN];
+ size_t num_hostbuf = ARRAY_SIZE(hostbuf);
+ char portbuf[6];
+ int rc;
+ rc = osmo_sock_multiaddr_get_ip_and_port(fd, ss7_asp_proto_to_ip_proto(xs->cfg.proto),
+ &hostbuf[0][0], &num_hostbuf, sizeof(hostbuf[0]),
+ portbuf, sizeof(portbuf), true);
+ if (rc < 0) {
+ snprintf(buf, sizeof(buf), "<error>");
+ } else {
+ if (num_hostbuf > ARRAY_SIZE(hostbuf))
+ num_hostbuf = ARRAY_SIZE(hostbuf);
+ osmo_multiaddr_ip_and_port_snprintf(buf, sizeof(buf),
+ &hostbuf[0][0], num_hostbuf, sizeof(hostbuf[0]),
+ portbuf);
+ }
+ }
+ vty_out(vty, "xUA server for %s on %s is %s%s",
+ proto, buf, fd >= 0 ? "listening" : "inactive", VTY_NEWLINE);
}
DEFUN(show_cs7_xua, show_cs7_xua_cmd,
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/35242?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I331b6e2fe11cd97e286b7ba684d4a17b8055f9d4
Gerrit-Change-Number: 35242
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/35240?usp=email )
Change subject: stream: Use new multiaddr APIs to log whole set of sock addresses
......................................................................
Patch Set 3: Code-Review-1
(1 comment)
File src/stream_srv.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/35240/comment/5fafd316_11155afc
PS3, Line 373: return link->sockname;
I think I will undo this change. I think is desirable to get stuff from the socket directly when calling this, in the event that we want to add dynamic binding add/rem for the sctp listening socket in the future.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35240?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I7ae300595825836cc7d6fa07238c0c2f15d14e85
Gerrit-Change-Number: 35240
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 06 Dec 2023 17:10:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/35241?usp=email )
Change subject: stream: Add missing osmo_stream_srv_link_get_fd() API
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I'll need this in libosmo-sccp in order to avoid using the _get_ofd() API.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35241?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I1bd3f790d93af74c150938a59108b882ad2820f3
Gerrit-Change-Number: 35241
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 06 Dec 2023 16:57:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment