Commit Graph

2648 Commits

Author SHA1 Message Date
Matan Perelman 41e464e272 ctrl: Add cell reselection offset control
Change-Id: I159bbe14e71dbf1e1add60b57b0b2e03d3146682
2023-04-25 14:58:18 +03:00
Oliver Smith 712343c321 CSD: support non-transparent data rates
Implement gsm0808_data_rate_non_transp_to_gsm0408.

Related: OS#4393
Change-Id: Ib5f4bdf17a9833f65a0b623a033da838a2594d68
2023-04-20 11:02:31 +02:00
Oliver Smith d128791919 abis_rsl: fix encoding RSL_IE_IPAC_RTP_CSD_FORMAT
The A-bis/IP RTP CSD Format IR Values need to be shifted by 4 bits
instead of 5. See OsmoBTS Abis Protocol Specification § 5.8.14
RSL_IE_IPAC_RTP_CSD_FORMAT.

Related: https://ftp.osmocom.org/docs/osmo-bts/master/osmobts-abis.pdf
Related: OS#4393
Change-Id: I9ce0b2d9b77eef61a6d4dce417efe4e853217dc5
2023-04-19 11:16:02 +02:00
Neels Hofmeyr 2dfffad7e3 log: N-PCSTATE: use new value_strings
Related: SYS#6319
Depends: I873ea30e8f64280487769668c748c67ce4ff4023 (libosmo-sccp)
Change-Id: I7a13fcf2bfee232c6cebc3c1180b956a73abc24e
2023-04-14 14:33:07 +00:00
Neels Hofmeyr 8f8af40974 SCCP N-PCSTATE: trigger MSC status on PC availability
Related: SYS#6319
Related: Ia1aea4e33230d6a685b72ea5ba20dd9c7d265d44 osmo-ttcn3-hacks
Related: Ib4a5330df30a73e744c316898817b2fa3271d75e osmo-ttcn3-hacks
Change-Id: I3a0869598b8395601a16d78dbc46eec400c0ea84
2023-04-14 14:32:44 +00:00
Vadim Yanitskiy ba6fd4f8e4 si2quater: check return value of osmo_earfcn_del()
Change-Id: I227dad57737721c40a508f67616d9f5003bb1a3e
Fixes: CID#313584
2023-04-07 18:24:35 +07:00
Vadim Yanitskiy f2f0ab209d si2quater: add CTRL commands for deleting neighbor [EU]ARFCNs
EUTRAN neighbors can be deleted using the following command:

  $ osmo_ctrl.py \
	-d 127.0.0.1 -p 4249 \
	-s "bts.0.si2quater-neighbor-list.del.earfcn" EARFCN

UTRAN neighbors can be deleted using the following command:

  $ osmo_ctrl.py \
	-d 127.0.0.1 -p 4249 \
	-s "bts.0.si2quater-neighbor-list.del.uarfcn" UARFCN,SCRAMBLE

This commit implements only deletion, implementing the add command
would require slightly more effort (lots of manual string parsing),
so it's left as a TODO for later.

Change-Id: I890bffb003f2a0ee9438f6ea6e8067c092504f08
Related: SYS#6401
2023-04-06 22:34:46 +07:00
Pau Espin 58db3305d7 ipaccess nm: Handle TS_EV_OML_DOWN through NM FSM
This way we have much more control on where the events are expected to
happen.

Related: OS#5973
Change-Id: I314b8bbd8721b0420aa4a2a4da9e911834853324
2023-04-05 19:06:32 +00:00
Pau Espin 90b83f9195 ipaccess nm: Delay marking TS as usable until OML reports Enabled state
The BTS can immediatelly ACK the OPSTART, but that doesn't mean the TS
is already usable. It should only be used when the BTS reports it is in
Enabled state.

Related: OS#5973
Change-Id: I712aa22252d29ceea152c25a5da75542e1691faf
2023-04-05 19:06:32 +00:00
Vadim Yanitskiy 143dc67c99 si2quater: bts_earfcn_add(): do not add duplicate EARFCNs
We don't want to have duplicate EARFCNs in the config file.
The desired behavior is modifying existing EARFCNs.

Change-Id: Ia2fd8bd86d9f093967c1b0b0135151d2d5386dc1
Related: SYS#6401
2023-04-05 19:05:56 +00:00
Vadim Yanitskiy 117c699107 si2quater: bts_uarfcn_add(): modify existsing UARFCNs
Do not print an error, modify the existsing UARFCNs instead.

Change-Id: Iadc884aa8968e2dc01adf26ba68ba9597fa05d94
Related: SYS#6401
2023-04-05 19:05:56 +00:00
Vadim Yanitskiy a60d74ba9c si2quater: bts_uarfcn_add(): check if already added first
This way we print the proper message if the given UARFCN is already
added, no matter if the UTRAN neighbour list is full or not.

Change-Id: Ife83023f6a9e28d77e44e4757457d4d1c879e78f
Related: SYS#6401
2023-04-05 19:05:56 +00:00
Vadim Yanitskiy b8e115c646 cosmetic: bts_vty: switch is not a function, add a space
Change-Id: I3e21d8f31c8ca7359e4ed4e1c978984b7b776a82
Related: SYS#6401
2023-04-05 19:04:05 +00:00
Vadim Yanitskiy b96af7d7ec cosmetic: bts_uarfcn_add(): pass diversity directly to encode_fdd()
Change-Id: I274e5b7cf43b710a58b3c370334c5639c9f5e249
Related: SYS#6401
2023-04-05 19:04:05 +00:00
Oliver Smith 377c1e3fd7 bsc_mgw_setup: use mgcp_client_pool_empty()
Don't fall back to the legacy config if the pool is configured but no
connection to any pool member can be established.

Depends: osmo-mgw I009483ac9dfd6627e414f14d43b89f40ea4644db
Related: OS#5993
Change-Id: I3a8418fb5841c71049ec91439143e1fe5553ed40
2023-04-04 16:32:27 +02:00
Vadim Yanitskiy eb1de89024 gprs: fix has_valid_nsvc(): permit local udp port 0
NSVC local port 0 is actually a valid value, which tells the PCU to
pick a random port for bind()ing.  It was supported before 315af2f9e,
but now osmo-bsc would simply ignore NSVCs with 'local udp port 0'
and leave the respective MOs unconfigured in the BTS.

Change-Id: I0afd83e77f3daeeb082e7db911610428b5bc587c
Fixes: 315af2f9e "bts: ipa/osmo-bts/sysmobts: MO: add support for the second NSVC"
Related: OS#5979
2023-03-31 15:46:29 +00:00
arehbein fffd1b599c PCU interface: Log version when starting listener
Change-Id: Ie3d8ebcb3175412313dfae3b7d560202a98ff8ab
2023-03-31 13:46:23 +00:00
Pau Espin 27195c50a0 bts-rbs2k: Simplify osmo_fsm_inst_alloc_child_id()
Change-Id: I5344161e5a65ae9959684f0fda7f8b06cbb447f3
2023-03-31 12:13:43 +02:00
Pau Espin d38ccedad7 Move paging queue specific handling to signal callback outside RSL code
The signal is already there but not being used.
Let's further split generic paging code from RSL specificites.

Change-Id: Iabc1c29908a5136501d6dc6e60f8777dab511b86
2023-03-31 12:12:21 +02:00
Pau Espin 4de0769720 abis_rsl: Document spec ref of CCCH Load Ind
Change-Id: Iada13bb29688249eecbd492388a6d4b0cc95575d
2023-03-30 15:51:02 +02:00
arehbein 097925b626 main: Give specific error message
vty_read_config() returns an errno number or zero; add the appropriate error string in case of error

Change-Id: I0015824a29ebf8aaeaa996ab4d2cb2769ea48864
2023-03-25 08:04:25 +00:00
Pau Espin ad253850d8 Use new GSM0408 defines for half-octet tags
The old ones have been deprecated and shall not be used anymore·

Depends: libosmocore.git Change-Id I799e35dc8d4d153fa63bf50563a5482cdf4de2d7
Change-Id: Id3be8e38ec87ae39c4e1b4fab163563b24fb2cee
2023-03-25 01:12:25 +00:00
Neels Hofmeyr 7a0bef1ae4 segfault: verify lchan presence on Assignment Complete
User reports a SEGV:

 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  send_assignment_complete (conn=conn@entry=0x557dbabb75a0) at assignment_fsm.c:188
 #1  0x0000557db66aa6b0 in assignment_success (conn=0x557dbabb75a0) at assignment_fsm.c:277
 #2  0x00007f6007afee82 in _osmo_fsm_inst_dispatch (fi=0x557db9615b80, event=4, data=0x0, file=0x7f6007a7dc21 "mgcp_client_endpoint_fsm.c", line=513) at fsm.c:875
 #3  0x00007f6007a78c12 in ?? () from /lib/x86_64-linux-gnu/libosmo-mgcp-client.so.9

 version: osmo-bsc 1.9.0.111.fc339.202212220009

The situation apparently is conn->lchan == NULL (primary lchan is gone),
but Assignment has just concluded. Apparently an unexpected / orthogonal
event has interrupted operations.

During assignment_success(), do not assume that conn->lchan is still
present. This should normally be true, but if not, fail the assignment
procedure instead of crashing osmo-bsc.

Related: SYS#6382
Change-Id: I4db25d0458f620954a1ca345282f5d8316341919
2023-03-22 09:22:58 +00:00
arehbein d7b277ff01 gsm_bts_check_ny1: Prevent possible division by zero
Do this by setting the minimal value for T3105 to 1 in its timer definition.

Fixes: Coverity scan CID#307389
Change-Id: I1fd0b92ab507a58fed6e9649eaa4770f1ad1cbad
2023-03-21 20:16:15 +00:00
Philipp Maier 0625172265 pcu_sock: handle multiple BTSs with one BSC co-located PCU (in theory)
The current PCU implementation has never been tested with multiple BTS
attached to it. This is due to the fact that it has been used
exclusively in an BTS co-located setup where naturally only one BTS is
present. The PCU sock protocol supports multiple BTSs in theory and we
should handle this correctly.

Related: OS#5198
Change-Id: I0b42c2c130106f6ffca2dd08d079e1a7bda41f0b
2023-03-20 10:44:22 +01:00
Philipp Maier 10ae64a777 pcu_sock.c: Call osmo_fd_unregister() before closing and changing listen_bfd->fd
Change-Id: I48e0411c4cba9897bc04865d22d8f68ed4fe87a2
2023-03-20 10:44:22 +01:00
Philipp Maier 2af29ae92d pcu_sock: drop usage of PCUIF flag PCU_IF_FLAG_DT
The flag PCU_IF_FLAG_DT is no longer needed. The PCU implementation will
distinguish by the version number instead.

Change-Id: I0dc20e351deb14906b2edffc39499bad9659cc35
Related: OS#5198
2023-03-20 10:44:22 +01:00
Philipp Maier ec7842f816 pcu_sock: check BTS type properly in pcu_info_update()
When updating the BTS information in the bsc co-located PCU, first check
if the BTS has a BSC co-located PCU at all. Also check if the BTS is E1
based since those type of BTS require extra information about the E1
connection.

Related: OS#5198
Change-Id: I8da26debc0e27f24fae4ee88f22f8875de13bc84
2023-03-20 09:42:05 +00:00
Philipp Maier c4ab940544 pcu_sock: use is_ericsson_bts() to check for ericsson BTS
Do not access bts->type directly, we have is_ericsson_bts() to do that

Related: OS#5198
Change-Id: I274a9f0f1208dc17713ba2e1c7a1110eeb133cca
2023-03-20 09:41:00 +00:00
Philipp Maier 4af073c109 bts: add function to check if a BTS has a BSC co located PCU
At the momemnt we use is_ericsson_bts() to check if the BTS uses a BSC
co-located PCU, this is a bit ambiguous, lets have a function that
explicitly checks for a BSC co-located PCU and nothing else.

Change-Id: I23ed4219e5ebd188867c17f387ca877efa9bc3b0
Related: OS#5198
2023-03-20 10:30:47 +01:00
Neels Hofmeyr f2768d39c1 fix coverity (false) warning in codec-list vty
Since there were complaints about this old parsing code during recent
code review in Ifdc9e04bf1d623da65bfb8a2fddea765601f6d9b, and now also
coverity finds something odd in it, just rewrite this.

Related: CID#310912
Change-Id: I96cd5d88ec6808a2915c6bccd0c0140216f328f2
2023-03-18 02:08:03 +00:00
Neels Hofmeyr 2fda8dba70 vty: codec-list: fix error message
Change-Id: I89460229f894bfa67c6939dc3825f1865378d918
2023-03-18 02:08:03 +00:00
Pau Espin 9f7611a32f Fix Lb/A SCCP conn lookup after recent regression in optimization patch
In osmo-bsc, there's currently 0..1 Lb links and 0..N A links, where N
is the number of MSC, but links can be shared in the underlaying stack
(struct osmo_sccp_instance), hence range 0..N of different
osmo_sccp_instance (identified by PC).
Even more, the Lb and A link can share the same underlaying stack, so
osmo-bsc can end up with only 1 struct osmo_sccp_instance shared by all
the above mentioned links in case all are configured under the same PC.
Total range A+Lb is 0..(1+N).

A struct gsm_subscriber_conn stores 2 struct sccp_instance*, one for
Lb (conn->lcs.lb.*)and one for A (conn->sccp.*).
They can actually point to the same sccp_instance or to different ones,
as explained above, depending on the configured setup. In any case, a
gsm_subscriber_conn needs 2 rb_nodes since it can hold
any of the 2 conn_ids independently (A or Lb).

The previous patch forgot to add that 2nd rb_node as well as some
initialization and release code for the Lb conn. This patch addresses
that.

When the 2nd rb_node, a problem when iterating the rbtree appears: how to
find out the "conn" pointer from the rb_node pointer, since the rb_node pointer
can be any of the 2 rb_nodes inside the struct at a different offsets.

In order to solve that problem, a new struct bscp_sccp_conn_node is
added, which holds all the relevant information used by the rbtree lookup code
in a generic way (rb_node and conn_id), plus a backpointer to the struct
bsc_gsm_subcriber it relates too.

Fixes: 85062ccad3
Change-Id: If42d93adee71d646766929a09bc01ae92b734ef3
2023-03-17 18:08:26 +00:00
Vadim Yanitskiy cbf3e5d850 fix ipacc_rtp_csd_fmt_non_transp(): add missing breaks
Change-Id: I13adcabd26c5f6543681e418b87c70b2822e7dcf
Fixes: CID#310964, CID#310965, CID#310967
2023-03-17 16:42:34 +07:00
Vadim Yanitskiy f18397aac9 fix bs11_read_swl_file(): properly clean up stale file list
Calling talloc_free() on struct llist_head is wrong and will lead
to unexpected behavior.  Call it on the containing struct instead.

Change-Id: Ib5eaa328aaf6881ae9621ca14859e4e255af2b00
2023-03-16 06:17:08 +07:00
Pau Espin a4fd6d9371 bsc_subscriber: Optimize lookup of bsub by TMSI
It was found that on a busy osmo-bsc process (>1000 concurrent calls
spead over different BTSs), a good amount of time is spent iterating the
subscribers list trying to find a subscriber based on a TMSI (1.60% of
total CPU time used by osmo-bsc).

This patch introduces a new rbtree under struct bsc_subscr_store which
allows storing all the busbs ordered by TMSI.
This way, lookup time changes O(N) -> O(log(N)), at the expense of
increased insert/deletion time O(1) -> O(log(N)).

Related: SYS#6200
Change-Id: If27429e715ef4b327177e427249e68321a6e83cc
2023-03-15 10:45:13 +01:00
Pau Espin 08a7db6cd3 bsc_subscriber: Introduce bsc_subscriber_store object
This allows keeping the bsc_subscriber storage internals outside of main
gsm_network code, while easily allowing making the internal
implementation more complex (in order to optimize it in a follow-up
commit).
It is also nice since we get rid of uncommon procedures being used in
this code, like allocating an llist directly as a talloc context, etc.

Change-Id: I616e8872af4ac63a6985f8900909e324ba889192
2023-03-15 09:44:22 +00:00
Pau Espin 0c87d39faf bsc_subscriber: Mark functions used only internally as static
Change-Id: I846af993905aee0be75aa3021460b130362c6d3d
2023-03-15 09:44:22 +00:00
Pau Espin b4bbba72ad bsc_subscriber: Drop unused function bsc_subscr_find_by_mi()
Change-Id: I15a51fa8a5c30fd92b34ebb366d0a805f8902cd0
2023-03-15 09:44:22 +00:00
Pau Espin 1da0fcbbbc Move bsc_conn_by_bsub() and make it static
The function was currently in osmo_bsc_sigtran.c but was never used
there, and it really doesn't have any relation to that file.
Let's move it to the only place where it's used so far, and mark it as
static.

Change-Id: I8a8cef45aa378421e0ac328d3b29b9d194698a55
2023-03-15 09:44:22 +00:00
Pau Espin 85062ccad3 Optimize subscr_conns lookup
It was found that, on a busy osmo-bsc (>1000 concurrent calls spread over
several BTS), the CPU consumption looking up for gsm_subscriber_conn
based on SCCP conn_id can take a considerable amount of time (>5% of
osmo-bsc already taking 70% of the CPU time on the core it is running on).

The huge CPU consumption happens because a linear search is done (llist)
over the entire list of SCCP connections every time an SCCP message is
handled.

In order to optimize this lookup, this patch introduces a new struct
bsc_sccp_inst which becomes associated to the libosmo-sccp
osmo_sccp_instance. Each of this strucs maintains an rbtree of
gsm_subscriber_conn ordered by conn_id.
As a result algorithmic complexity adds O(log(N)) during insert, lookup
and delete of SCCP conns, but gets rid of O(N) previous lookup.
As a plus, finding a new conn_id now takes generally O(log(N)), while
before it used to take O(N).

Related: SYS#6200
Change-Id: I667d3ec1dad0ab7bc0fa4799d9611f3a914d07e5
2023-03-15 09:44:22 +00:00
Pau Espin 9c21dc3d16 pcu_sock.c: Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: I4f72f4fa80249ed2caafc87b9fdf9926e0f31976
2023-03-14 12:56:49 +00:00
Pau Espin 646d21f2db Assert conn_id being looked up is inside expected range
Change-Id: Iffe580ad5f974fdbef7061a14306b50bd4875eb1
2023-03-13 11:58:49 +01:00
Pau Espin 53cd4ad5fc bscc_sccp: Small optimiztion in bsc_sccp_inst_next_conn_id()
Refactor the double loop to check a code path matching the sccp_instance
once instead of doing so for every subscr_conn.

If for instance let's say we have 1000 concurrent calls in progress,
which means we have 1000 subscr_conn, which means we at least do the
extra check regarding SMLC vs MSC 1000 times (at least, xN times if N
conn_id already used are already found).
That overhead happens every time a new subscr_conn is created (which in
a BSC with already 1000 concurrent calls can potentially happen quite
frequently).

Change-Id: Ic32b1eeb201fc51110e1ee130110824845f81e82
2023-03-13 11:58:49 +01:00
Pau Espin 8958269ea9 get_bsc_conn_by_conn_id(): Properly match sccp_instance
Function bsc_sccp_inst_next_conn_id() allocating conn_id creates address
spaces based on sccp_instance, aka conn_id values can be reused given
the sccp_instance (MSC) is different.

Hence, when looking up a bsc_conn based on a conn_id, it must also match
the sccp_instance, otherwise a bsc_conn from another MSC could be
returned.

Change-Id: I80a54bdec3973917e88483a62bfc2e968b8c0490
2023-03-13 11:58:49 +01:00
Pau Espin 06d1cff11a bscc_sccp: Avoid allocating conn_id 0x00FFFFFF
The 0x00FFFFFF source local reference is reserved in M3UA/SCCP, hence
avoid allocating a conn_id with that value since later on when reused as
a source local reference it would fail to be encoded.

Change-Id: I5c62bbfa89140d754edccb4404503cb70d5fde89
2023-03-13 11:58:49 +01:00
Pau Espin c5b7d94e0f Clarify type and values of sccp.conn_id
Currently, the conn_id is allocated in a range 0..0xffffff by
bsc_sccp_inst_next_conn_id(), and -1 means it is unset.

This means allocation expects "int" to be at least 32 bits integer,
in order to fit 24 bits for 0..0xffffff plus the -1.
Hence, let's define the variable as uint32_t, as already done in
libosmo-sccp. Use last value 0xFFFFFFFF ((uint32_t)-1) and avoid playing
with the value being unsigned sometimes and signed only for "unset"
value.

The value is actually already handled as unsigned (printed with %u) in
most places.

Change-Id: If019bcbc1e28929fe8d981fef9103835fc6ead2e
2023-03-13 11:58:49 +01:00
Vadim Yanitskiy 2acc7b94d2 Makefile.am: remove unneeded AM_LDFLAGS with LIBS
Change-Id: I10150c00dbe69648b95ea4c414db0ad6c6bdd254
2023-03-11 03:56:01 +07:00
Pau Espin c90c63bec0 constify bsc_conn_by_bsub() ptr param
Change-Id: I44b1397e7771c803efdca6bf59750ca5568df365
2023-03-10 15:25:11 +01:00
Vadim Yanitskiy 30ecd0a767 ipaccess_drop_oml(): invalidate the feature vector
It's possible that a BTS gets disconnected, updated to a more recent
version or downgraded to an older version, and then connects to the
BSC again.  That more recent or older BTS version may have a different
set of supported features, so osmo-bsc must not trust the previously
reported feature vector.

Change-Id: Ie93af849d7771b4fff3cdf647c82510cd8543975
2023-03-10 13:43:43 +00:00
Philipp Maier fcb9890675 timeslot_fsm: fix PDCH activation
All non ericsson BTSs we support use a BTS co-located PCU, so we must
not depend on a PCU connection in those cases.

Related: OS#5943
Fixes: ecf825dc ("pcu_sock: activate/deactivate PDCH on pcu reconnect")
Change-Id: I296dfacb451d7b9b5ef1cec940bc1a577f3c43ad
2023-03-09 12:47:15 +01:00
Oliver Smith 2689ad73a8 abis_rsl: CSD: add RTP_CSD_FMT IE to CRCX/MDCX
Related: OS#4393
Change-Id: I4964b268124d29354e252c2ee509866ae75fab6d
2023-03-08 11:52:12 +00:00
Philipp Maier 6d3da5401f pcu_sock: cosmetic: remove whitespace after type cast
Change-Id: Iddc1bd703b4a200202ffa87d24a167e3fe39da18
2023-03-07 12:54:58 +00:00
Philipp Maier 280ad4d966 pcu_sock: rename rc to fd
The variable rc holds the return code of accept(), which returns a file
descriptor on success. So lets call the variable "fd" to make this
clear.

Change-Id: Ic8d22c2af18477f110a3a9115434314ebca95b25
2023-03-07 12:54:58 +00:00
Philipp Maier 7630b88fb5 pcu_sock: improve logging
In many places we have a pointer to the BTS object, so we can use
LOG_BTS.

Change-Id: I4a3ff23ffccf803b1a97e3f2604d3b422c6d6afd
Related: OS#5198
2023-03-07 12:54:58 +00:00
Philipp Maier 6902fccb1b pcu_sock: use struct to transfer IMMEDIATE ASSIGNMENT for PCH
When the IMMEDIATE ASSIGNMENT is sent from the PCU to the BSC using the
"direct TLLI" method, the TLLI (and the last three digits of the IMSI)
is prepended to the MAC block. Currently we are taking the fields apart
manually using offsets. The code for this is difficult to read and the
method is error prone. Let's define a struct that we can just overlay
to access the fields directly. Let's also transfer the full IMSI.

Change-Id: Id6acbd243adf26169e5e8319dd66bb68dd6a3c22
Related: OS#5198
2023-03-07 12:54:58 +00:00
Philipp Maier ecf825dc08 pcu_sock: activate/deactivate PDCH on pcu reconnect
When the PCU is disconnected while the BSC keeps running the PDCH should
be closed. Also the PDCH should be reopened when the PCU is
reconnected.

Change-Id: I9ea0c53a5e68a51c781ef43bae71f947cdb95678
Related: OS#5198
2023-03-07 12:54:58 +00:00
Oliver Smith a8f5dbce77 check_chan_mode_rate_against…: fix never true cond
Fixes: CID#310958
Fixes: 2150b307 ("assignment_fsm: chan mode check: support CSD")
Change-Id: Icb3d0f977267dca7b52fd05312ccb5237fcaa031
2023-03-07 09:50:01 +01:00
Philipp Maier f85f8dd4a1 pcu_sock: get rid of leaking message buffer
When a data request is received from the PCU, some of the switch cases
allocate a message buffer but the message buffer is only used to pass
its data and length to other functions. The message buffer itself is not
passed anywhere and it is also not freed. Lets get rid of the message
buffer and avoid unnecessary memcopy calls.

Related: OS#5198
Change-Id: Ibfaae177585a4d42d797b6bbd90e402641620140
2023-03-06 15:32:25 +00:00
Oliver Smith d83d22bad3 Cosmetic: channel_mode_from_lchan: remove fixme
Remove the FIXME comment, as the function handles CSD now.

Related: OS#4393
Change-Id: Ic074cb814662d73f52d4401d1cf9cdbf682040a9
2023-03-06 10:23:31 +01:00
Oliver Smith 722220f2dc chan_mode_to_mgcp_codec: support CSD
Related: OS#4393
Change-Id: Ib5876ee4dac9e8000cc3ae0c5dd87aae3d723829
2023-03-06 10:23:30 +01:00
Oliver Smith d5ca920cc3 rsl_tx_ipacc_crcx/mdcx: omit speech mode for CSD
Omit the A-bis/IP specific RSL_IE_IPAC_SPEECH_MODE, as it doesn't make
sense for circuit switched data.

Related: OS#4393
Change-Id: I6641b713177276bcf798f08123e1dd2e88ffdce6
2023-03-06 10:23:30 +01:00
Oliver Smith d5eb0f1b57 lchan_select: chan_mode_to_chan_type: support CSD
Related: OS#4393
Change-Id: I6b02d7edbf268a7f07134b54a7289529b2485122
2023-03-06 10:23:30 +01:00
Oliver Smith 41ede5345c requires_voice_stream -> ch_indctr
Use the full gsm0808_chan_indicator value throughout the lchan related
structs (assignment_fsm_data, gsm_lchan, lchan_activate_info,
lchan_modify_info) instead of reducing it to the boolean
requires_voice_stream.

This is needed so we don't lose the information whether an lchan was
requested for data or speech (both need an rtp stream).

Add a new bsc_chan_ind_requires_rtp_stream function and use it in
conditionals like the previous requires_voice_stream.

Related: OS#4393
Change-Id: I1538c1e6d5cd61559af7c1e2860afd0269dda367
2023-03-06 10:23:30 +01:00
Oliver Smith 2150b307c2 assignment_fsm: chan mode check: support CSD
Replace check_requires_voice_stream, which used to iterate over
ch_mode_rate_list and verify that all entries are either for speech or
signalling. Instead verify in check_chan_mode_rate_against_ch_indctr,
that all entries of ch_mode_rate_list have a chan_mode that matches the
ch_indctr (data, speech, signalling; called "speech / data indicator" in
3GPP TS 48.008 § 3.2.2.11).

This ensures that all of them are either data, speech or signalling and
not mixed.

Related: OS#4393
Change-Id: Iee5cbfee84d7f2ad59ee2d5a19891a2b59bbafff
2023-03-06 10:23:30 +01:00
Oliver Smith 0361b01614 bssmap_handle_ass_req_tp_codec_list: tweak log msg
Remove "speech mode" from the log message, as the log message is
relevant for CSD too. According to 3GPP TS 48.008 § 3.2.1.1 note 13 the
IE shall be included for AoIP unless channel type is signalling.

Related: OS#4393
Change-Id: Idfab0b7f6e97a6b67d140f967ddfe9b29818586e
2023-03-06 10:23:30 +01:00
Oliver Smith b11bf4d651 abis_rsl: ipacc_payload_type: handle CSD
Depends: libsmo-abis Ibf0bfb577faa5c82e10706b42ede8b72dd611655
Change-Id: Ie561d87ecdc161b9a69eb7683889f0395524faa8
2023-03-06 10:23:30 +01:00
Oliver Smith e6e81e09b3 bssmap_handle_ass_req_ct_data: implement
Handle assignment requests for CSD. In this initial version, the code
for non-transparent data mode is a stub.

Related: OS#5763
Depends: libosmocore Ia965cdd9f53af756e5ffaff9b8f389b5ad629969
Change-Id: I350bea15fd2158eb6edc9bc92f2dca48930736e9
2023-03-06 10:23:26 +01:00
Neels Hofmeyr 25947b7aa4 cosmetic: timeslot_fsm.c: move some code to separate function
Cosmetically prepare for patch I9ea0c53a5e68a51c781ef43bae71f947cdb95678

Change-Id: I2c26d937496211e4b876987bac3803f6b2e6c8be
2023-03-06 08:44:02 +00:00
Oliver Smith 17df53ea1a channel_mode_from_lchan: add GSM48_CMODE_DATA_3k6
Related: OS#4393
Change-Id: Id9ec34f77c96d3a209c6f78d2addf1ea0dfa228d
2023-03-05 18:04:41 +00:00
Oliver Smith 5a16fcee93 lchan.h: remove enum lchan_csd_mode
It looks like the idea was to translate the CSD rate from BSSAP to
lchan_csd_mode before translating it to RSL. But instead we can just
directly translate the BSSAP value to the RSL value.

The previous code was not used yet (nothing wrote to csd_mode).

Related: OS#4393
Depends: libosmocore I25bfd02aa1428a35492b20376a31635a442e545f
Change-Id: Ice914744da3a2084e82d125848fb69404b8e8a36
2023-03-05 18:04:41 +00:00
Neels Hofmeyr 220ef9a380 drop gsm_pchan_ids, use sanitized FSM ids instead
gsm_pchan_ids[] exists only to compose osmo_fsm compliant IDs. We do
have osmo_fsm_inst_update_id_f_sanitize() now, rather use that.

This removes some confusion about which value_string array has an effect
on the VTY command 'ts' / 'phys_chan_config'.

Note that tests/bsc_test.ok does not change, hence the new way of
composing FSM IDs is identical to using the old gsm_pchan_ids[].

Change-Id: Ib85b7aa4ea882ae37919dd3ea0c033e949c083e5
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 896d694977 tweak gsm_pchan_ids[]: DYNAMIC/{OSMOCOM,IPACCESS}
This patch affects *only* on osmo_fsm instance IDs, which are visible on
the CTRL and VTY interfaces to identify FSM instances, and in the log.

Why bother: An upcoming patch wants to replace gsm_pchan_ids[] with
osmo_fsm_inst_update_id_f_sanitize(gsm_pchan_name(x)), this is an
explicit step to match gsm_pchan_names[].

Change-Id: I4a540744cced466f0ca4fc605db4d0ec14ee8e87
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 879e7595f0 bsc_test.c: test FSM IDs that contain pchan names
Show the timeslot_fsm, lchan_fsm, assignment_fsm fi->id strings.

The IDs include the current pchan configuration. I want to tweak the
composition of these in an upcoming patch, so the test should show
whether any FSM IDs change from that.

Change-Id: If369f23fa140b9d7792f5a511815cbbd14b371e9
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 76ea8562db stat: change pchan naming to dynamic/{osmocom,ipaccess}
Change names of stat exports to be consistent with VTY,CTRL:
- from "chan_osmo_dyn" to "chan_dynamic_osmocom"
- from "chan_tch_f_pdch" to "chan_dynamic_ipaccess"

Change-Id: I863ad05e892563442041722bcd57f7c987e1f5ab
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 7214e56b49 VTY,CTRL: add pchan dynamic/{osmocom,ipaccess}
We already use "OSMO_DYN" as C name for "fully dynamic" timeslot config,
when working with osmo-bsc.cfg I dearly miss this short name, it is a
pain / has become ridiculous to write 'tch/f_tch/h_sdcch8_pdch'.

Introduce 'dynamic/osmocom' and 'dynamic/ipaccess' as default names for
our dynamic timeslots on VTY and CTRL. The old 'tch/f_tch/h_sdcch8_pdch'
and 'tch/f_pdch' are still supported.

Change-Id: I37719edd867c777d1ce944b8e2f1efffac38f00e
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 71e838ed02 ensure correct phys_chan_config doc string count on VTY
Add a static assert, and comments indicating the importance of the two
value_string arrays defining pchans on the VTY matching up.

Change-Id: I8118bec35400f7f00ca9ae43b603059ed701fa25
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 822b9dca1f vty: msc / codec-list: forbid invalid codec versions
Change-Id: I421c306aa22dfdad0f30c6ba8b482e1eff188a8e
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 72fe0bf142 vty: msc / codec-list: forbid duplicate entries
Change-Id: Ifdc9e04bf1d623da65bfb8a2fddea765601f6d9b
2023-03-04 22:44:10 +00:00
Neels Hofmeyr 89dd152577 simplify storage of bsc_msc_data->audio_support
Make it a plain array, no dynamic allocation needed.

Change-Id: I625cedc4bb040d649fd6e1794ba468f4c6ad6adc
2023-03-04 22:44:10 +00:00
Oliver Smith 5ea91cdae4 test_codec_support_bts_rate: add missing breaks
Fixes: 3db22c61 ("cosmetic: clarify test_codec_support_bts()")
Fixes: CID#310823
Change-Id: I951783b6310f0a6ef5546a36c962def9d6e66285
2023-03-03 09:05:37 +01:00
Neels Hofmeyr c729d82b17 assignment_fsm.c: make two functions static
Change-Id: I33eef9d105bacbb46538dff233502e834f7a3b51
2023-03-02 17:56:48 +01:00
Neels Hofmeyr b599836c7a implicitly register osmo_fsm definitions
I'm going to add a regression test that probes lchan_fsm. I noticed that
I have to call lchan_fsm_init() for osmo_fsm_register(). Let's make this
implicit as we usually do now, to not have to register FSMs in tests.

Change-Id: I58760e743c78a370aedc9720f265c0f8da5c2045
2023-03-02 17:56:48 +01:00
Neels Hofmeyr 7bd795515f select_codecs(): constify ct arg
Change-Id: Icb07374b40629e48d811a036b9a56d026c1d897c
2023-03-02 17:56:48 +01:00
Neels Hofmeyr 89493f76b1 select_codecs(): doc tweak
Change-Id: I52a111b1992db1e335c692d2caee7c5398a6f90e
2023-03-02 17:56:48 +01:00
Neels Hofmeyr 3db22c6116 cosmetic: clarify test_codec_support_bts()
Change-Id: I13d9b158d08f4938c5aa47ef3134819a4b1f7d29
2023-03-02 17:56:48 +01:00
Neels Hofmeyr ce8d39d97c vty: msc / codec-list: tweak error msg
Change-Id: I7ba508cceccb8a25db0936f756f3e4a28ec1333f
2023-03-02 15:03:44 +00:00
Neels Hofmeyr ec6360e005 bsc_vty.c write_msc(): fix weird printf format
Change-Id: I856c2d620b89efcf3239186ef53c6941577dbccc
2023-03-02 15:03:44 +00:00
Neels Hofmeyr f30f630a88 bsc_vty.c: s/bsc/msc for commands under msc node
Change-Id: Id91a82ca8e2eb91b52836e024ccf925245886ae6
2023-03-02 15:03:44 +00:00
Neels Hofmeyr 8196ef5405 vty: improve doc for 'codec-list'
Change-Id: I33e6568997bcb1a9466e1e0c1b00718b703e2904
2023-03-02 15:03:44 +00:00
Neels Hofmeyr 8b55573a73 cosmetic: use i++ instead of ++i in for loop
Change-Id: I9903e54e3eb59db9b9cd22e017bc81b9b86e01e9
2023-03-02 15:03:44 +00:00
Neels Hofmeyr 91ab3fe5a0 cosmetic: use char literals in cfg_net_bsc_codec_list()
Change-Id: I1a29fb54cdcd15c6e9b6447d929db0e9492264f7
2023-03-02 15:03:44 +00:00
Philipp Maier 52b74175dd abis_rsl: guard against over long IMMEDIATE ASSIGNMENT Messages
The length parameter in rsl_imm_assign_cmd_common() may cause a buffer
overflow when it is chosen larger than GSM_MACBLOCK_LEN. Lets make sure
this cannot happen.

Change-Id: I9417b35fb8c0517f2555e17059bf8ac60fa59791
2023-03-02 14:59:41 +01:00
Vadim Yanitskiy 4a61575917 utils: fix incorrect string checks in meas_db_insert()
Comparing an array to null is not useful, since the test will
always evaluate as true (NO_EFFECT).

Change-Id: I8a41078070119bc22d594c0dfff5d98b5d16f970
Fixes: fbead4327 utils: store more fields from meas-feed in db
Fixes: CID#310821
2023-03-01 21:53:24 +00:00
Philipp Maier 111b13f9a2 pcu_sock: print OML alerts from PCU
The PCU is able to send OML alerts via the BTS to the BSC. When the PCU
operates in co-location to the BSC we just print the alerts in the log
directly

Change-Id: Id32553556356c2affe32e47ae1c3ae6a514efdce
Related: OS#5198
2023-03-01 11:21:50 +01:00
Oliver Smith 4e54e16b9f codec_pref: split test_codec_support_bts_rate
Move the check for the rate into an extra function, so it can be used
for CSD without checking a speech codec at the same time.

Related: OS#4393
Change-Id: Iea8a23ef3c66ed556110038fe9f3bc7f6eef3e96
2023-03-01 08:11:15 +00:00
Oliver Smith f597a035fa bssmap_handle_ass_req_ct_speech: refactor
Move the translation from osmo_sockaddr_to_str_and_uint into
bssmap_handle_ass_req_tp_rtp_addr, which will be used by
bssmap_handle_ass_req_ct_data in a future patch too.

Pass pointers to variables in req, instead of duplicating variables and
filling it in later (like in bssmap_handle_ass_req_ct_sign).

Related: OS#4393
Change-Id: I6bb16b26d89056dffa50bd8296fefe9315c587ca
2023-03-01 08:11:15 +00:00
Oliver Smith 71c8bdfc56 bssmap_handle_ass_req_ct_speech: split up
Allow reusing common code in an upcoming bssmap_handle_ass_req_ct_data.
It won't use _osmux for now (maybe in the future?), but splitting it
out as well makes it consistent.

Related: OS#4393
Change-Id: I4d9a4df314b1e56b9c1f90c9d7914332b70b56f8
2023-03-01 08:11:15 +00:00
Oliver Smith 31f81d55fc bssmap_handle_assignm_req: split up
Prepare to implement GSM0808_CHAN_DATA without making this function even
longer.

Related: OS#4393
Change-Id: I8580e75e292cff1b52b6ba1bafd12c155c3bbe93
2023-03-01 08:11:15 +00:00
Michael Iedema fbead43271 utils: store more fields from meas-feed in db
More fields need to be captured from meas-feed
to perform meaningful analysis of data from
multi-bts and multi-trx systems.

This patch adds expands the existing db utils
to record nearly all available fields from
meas-feed.

Change-Id: I509c939524b11a4ee455bcfc3ebee6c5c35b9fba
2023-02-28 18:45:48 +00:00
Oliver Smith 146c228df2 Cosmetic: codec_pref: tweak comments
Remove "Helper function for match_codec_pref()" at the beginning of the
descriptions of these functions, looks like a leftover from before this
was moved to its own c file. Remove a duplicated "received" in a
comment.

Change-Id: I30f0744db9aebf2f05077fef840097c332b9dafd
2023-02-28 11:06:47 +00:00
Oliver Smith 0e552cc9c1 Cosmetic: fix various typos
Change-Id: I9225e733e3afa8171f24253e21eaffc654f689af
2023-02-28 11:06:47 +00:00
Oliver Smith 88133a746d osmo_bsc_main: don't allocate talloc_ctr_ctx
tall_ctr_ctx is not defined or used in osmo-bsc and apparently was only
exported by accident from libosmocore. It's not exported anymore since
libosmocore.map was introduced in I13169c00a59fb59513dfc598de5a71d094492422.

Fix for:
  /usr/bin/ld: osmo_bsc_main.o: in function `main':
  osmo_bsc_main.c:(.text+0x830d): undefined reference to `tall_ctr_ctx'
  /usr/bin/ld: osmo_bsc_main.c:(.text+0x8331): undefined reference to `tall_ctr_ctx'

Change-Id: I558e1ec722f3b1ff1f2e89b3cb97ed1dba9063e3
2023-02-28 09:36:00 +01:00
Oliver Smith 4bcfb7e034 fsms: use configurable timers instead of T23042
T23042 was a placeholder for timers to be filled in later. Replace it
with timers that can be configured via VTY.

Previous timeout for the states was 5s, from using the default of 5 for
undefined timers.

* ASSIGNMENT_ST_WAIT_MGW_ENDPOINT_TO_MSC and
  HO_ST_WAIT_MGW_ENDPOINT_TO_MSC:
  * Runs gscon_connect_mgw_to_msc() on enter, which waits for one MGCP
    CRCX or MDCX response (or changes state immediately)
  * Use existing X9 ("Timeout for availability of MGW endpoint"), 5s,
    which is already being used by lchan_rtp_fsm for a similar purpose

* HO_ST_WAIT_RR_HO_DETECT:
  * Handover initiation as described in 3GPP TS 04.08 § 3.4.4.1:
    "The network initiates the handover procedure by sending a HANDOVER
     COMMAND message to the mobile station on the main DCCH. It then
     starts timer T3103."
  * Use existing but unused timer T3103 ("Handover"), 5s

* HO_ST_WAIT_RR_HO_COMPLETE:
  * Handover completion as described in 3GPP TS 04.08 § 3.4.4.3:
    "When receiving the HANDOVER COMPLETE message, the network stops
     timer T3103 and releases the old channels."
  * Continue using T3103 with keep_timer = true

Closes: OS#5787
Change-Id: Id0d4d0788f609f3272fc81c80a754383dde25c16
2023-02-16 14:49:39 +01:00
Oliver Smith cb3eb23ec2 ho: remove timeout for HO_ST_WAIT_LCHAN_ESTABLISHED
Remove placeholder timer T23042. This handover fsm state waits for both
RSL/RR and RTP/MGW to be complete. I've added TTCN-3 tests to ensure
that both cases are covered by existing timer T3101 in lchan fsm state
LCHAN_ST_WAIT_RLL_RTP_ESTABLISH, which on timeout lets the handover
fail.

Related: OS#5787
Related: osmo-ttcn3-hacks I30e1811f97406cff6ba794fcd6882e2bb0205087
Related: osmo-ttcn3-hacks I2f79e3ff988a4315fbef3538f02403b818fa7839
Change-Id: I53468766c3c5fad7d7e275c0f20b5c20677fe4e8
2023-02-16 14:49:39 +01:00
Oliver Smith 23e3e29b7a ho: remove timeout for HO_ST_WAIT_LCHAN_ACTIVE
Remove placeholder timer T23042.

Neels wrote:
> I think the right thing here is to remove this timeout; this needs
> no timeout at all because we can rely on the lchan_fsm to either
> return HO_EV_LCHAN_ACTIVE or HO_EV_LCHAN_ERROR after the usual
> timeouts set for lchan activation. IOW since it is internal to
> osmo-bsc one of the two events is guaranteed to occur.
>
> If we superimpose a timer on top of the lchan timeouts, configuring
> larger lchan activation timeouts becomes complex, because the user
> has to take care to also allow a larger timeout for the same
> procedure during HO.

Related: OS#5787
Change-Id: Ibf740aaa9bddc2de85cf8087ad90bab47aac12c2
2023-02-16 10:37:17 +00:00
Philipp Maier 329e1cdc22 bsc_subscriber_conn_fsm: use subslot 0 in case of E1 full subslot
In classic E1 based GSM networks the audio is usually transfered through
16bkps I.460 subslots while 4 16kbps subslots are multiplexed into one
E1 timeslot. However, there may be setups where still 16kbps subslots
are used, but with 1 instead of 4 channels per timeslot. In those cases
the bit offset is 0, while the rate is still 16kbps.

Change-Id: I0d2bc44acaa8e5a28cccfdf7cfb945bf14a4ed30
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier d4044214ca bts_trx_vty: use define constant E1_SUBSLOT_FULL instead magic number
Change-Id: I0be228d4473215c6bd36c668e0e10e64965732e7
2023-02-13 12:39:22 +01:00
Philipp Maier ec1a0a102f pcu_sock: set direct TLLI flag in info indication
osmo-bsc requires the PCU to tag IMMEDIATE ASSIGNMENTS that shall be
sent via PCU with a TLLI. This is required to confirm the sending of the
IMMEDIATE ASSIGNMENT messages to the PCU.

Related: OS#5198
Change-Id: Ib804143a57824632e5435f7ba68f2e94f5f3fb21
2023-02-13 12:39:22 +01:00
Philipp Maier ee43e37528 pcu_sock: transfer E1 connection information to PCU
The BSC has all information about the E1 line configuration of each
timeslot/channel. The PCU is responsible for opening and managing the
CCU connection. To enable the CCU to do that, we have to transfer the E1
connection information (which TS, SS, rate) to the PCU.

Change-Id: I6d44373336b41009ff4c6e459d32d0a81081676c
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier f18e9c36f4 pcu_sock: transfer sysinfo to PCU
The PCU needs to be aware of the current system information in order to
work properly.

Change-Id: Ibbfbfaf588a4e406804c36570010aefdfc14328b
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier 8a0572256b abis_rsl: constify parameters of rsl_X_imm_assign_cmd
Related: OS#5198
Change-Id: I1bd2e0c844bf273d2c4381eec9e9bb9562254873
2023-02-13 12:39:22 +01:00
Philipp Maier 107d311d96 pcu_sock: use extract_paging_group() for PCU_IF_SAPI_PCH
We have introduced the function extract_paging_group() with the previous
patch. Lets use it for PCU_IF_SAPI_PCH as well to remove code
duplication

Change-Id: If4ffe8eafd2e54e323cbc075c09d457a74ebe83f
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier 7a346a547e abis_rsl: add support for sending IMMEDIATE ASSIGNMENT through PCH
The IMMEDIATE ASSIGNMENT for downlink TBFs needs to be sent through the
PCH instead of the AGCH. Since this method is not specified in RSL, it
is usually a vendor specific extension.

Change-Id: I4452f4973d1ec69c96aad527b057226e8a6edf99
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier 84811c901e pcu_sock: cosmetic: remove space before tab
Change-Id: I6f3f96120d8a106f7c9e8b428d89ed14999a10a8
2023-02-11 14:06:44 +01:00
Philipp Maier 3c4320f935 pcuif_proto: rename PCU_IF_SAPI_AGCH_DT to PCU_IF_SAPI_PCH_DT
The current name of PCU_IF_SAPI_AGCH_DT is a bit misleading as it
describes a method to send immediate assignment messages (normally AGCH)
via the PCH. The name in the constant should reflect that correctly

Change-Id: I78abeb62d0267baa31a4727c4bdd027b7230f137
Related: OS#5198
2023-02-11 14:06:44 +01:00
Max 54b7cd5392 doc: correct reference and add deprecation notice
Change-Id: I46f1f070cb00c4c27247593527b0173e1fd5de67
2023-02-10 11:41:23 +00:00
Vadim Yanitskiy dc634a8836 bsc_vty: use gsmnet_from_vty() everywhere, not vty->index
Change-Id: Ic08d1213c3b353bdf9b425e24382b6c5bd229c9c
2023-02-06 17:42:42 +00:00
Vadim Yanitskiy 3b5e469485 fix bsc_vty_go_parent(): add missing case for MGW_NODE
A new VTY node was added in commit [1], but bsc_vty_go_parent() was
not updated.  Because of that, commands following the MGW node may
crash osmo-bsc.  In the example below:

  network
   network country code 901
   mobile network code 70
   ...
   mgw 0
    remote-ip 127.0.0.1
    local-ip 127.0.0.1
   periodic location update 30

the 'periodic location update 30' will trigger a segfault:

  (gdb) bt
  #0  0x00005555555dfc09 in cfg_net_per_loc_upd ()
  #1  0x00007ffff7af6c3f in cmd_execute_command_strict () from /usr/local/lib/libosmovty.so.9
  #2  0x00007ffff7af6f1c in config_from_file () from /usr/local/lib/libosmovty.so.9
  #3  0x00007ffff7afd4e1 in vty_read_config_filep () from /usr/local/lib/libosmovty.so.9
  #4  0x00007ffff7afe375 in vty_read_config_file () from /usr/local/lib/libosmovty.so.9
  #5  0x0000555555579616 in bsc_network_configure ()
  #6  0x000055555557a352 in main ()

because vty->index would be NULL after returning from the MGW node.

Fix this by adding the missing case to bsc_vty_go_parent().

Change-Id: Id3050ff7e2402c33ee76c7bf0cc83603c0cc6dfc
Fixes: [1] 8d22e68706
2023-02-06 17:42:42 +00:00
Philipp Maier 38e4fb4014 timeslot_fsm: remove duplicate TS_ST_BORKEN from out_state_mask
The stete TS_ST_WAIT_PDCH_DEACT has TS_ST_BORKEN twice in
out_state_mask. This is unnecessary.

Change-Id: Ib758150ba7074adbb1b59008f0dfb57766763897
2023-02-06 16:09:17 +00:00
Philipp Maier c206cd7808 pcu_sock: rework log output
The code is easier to read when the log string is in one line

Change-Id: Idc673e0b15869c6966701524db1af7d7847c16ab
Related: OS#5198
2023-02-02 10:58:09 +01:00
Philipp Maier 364f7ec189 pcu_sock: remove unecessary OSMO_ASSERT()s
Change-Id: I8320cbc14361438d65642d15bc225e9960ce925b
Related: OS#5198
2023-02-02 10:55:06 +01:00
Philipp Maier b9558272f2 pcu_sock: Also fill in BSIC in gsm_pcu_if_info_ind
When filling in the info_ind parameters we lack the BSIC

Change-Id: I22158b18f50a7adf4ba1fed25bd7a880dc109e3d
Related: OS#5198
2023-02-02 10:54:32 +01:00
Philipp Maier 16b891ffb9 pcu_sock: fix endianess when populating gsm_pcu_if_info_ind
The intended endienaess for the remote_port member is host byte order,
while the endianess in the nsvc struct is in network byte order.

(see also pcu_sock.c in osmo-bts.git)

Change-Id: Ib62dcceb80fd500e477dd5e1a0e43de47e16eeb0
Related: OS#5198
2023-02-02 10:52:51 +01:00
arehbein 97ed3c8d97 bsc_ctrl_commands: Add GET for bts neighbor-list (local bts numbers)
Related: SYS#6287
Change-Id: I79aeffd93089086f57c66787fe20b439a4d8b6b4
2023-02-01 23:19:55 +00:00
Philipp Maier 3fff53aed7 timeslot_fsm: Warn in case Ercisson RBS uses static PDCH
The Ericsson RBS is a BTS that natively works with dynamic timeslots.
This colides with the current understanding of static PDCH channels
because the BTSs we support so far get thier static PDCH information on
startup and then handle everything related internally. The BSC does not
actively manage the channel in those cases. In the case of Ericsson we
have to activate the PDCH via RSL like any other channel and the timeslot
FSM has to manage it. Lets not add work arouds for this, lets just print
and error message and use the BTS in the dynamic scheme as intended by
the manufacturer.

Change-Id: Icc7c2956fc934691e3bfacb283d896a8767baf27
Related: OS#5198
2023-01-31 15:50:42 +01:00
Philipp Maier 373d4f05f6 pcu_sock: rework check logic for ts
Before filling in the TS in the info indication, it is checked that the
MO opstate is enabled. Also it is checked that the TS serves a PDCH.
Lets restructure this check and move the PDCH check into a helper
function as we need to check for PDCH from other location as well later.

Change-Id: Icaab52ab73c38889dfadb523b89bb54cafacc99a
Related: OS#5198
2023-01-31 12:05:02 +01:00
Philipp Maier cb3140faf6 abis_om2000: send TS_EV_OML_READY when TRX is fully done
We send the TS_EV_OML_READY event early, even though the TRX is not
fully done with all OML initialization steps. Lets complete the TRX
initialization first and then notify each timeslot FSM with
TS_EV_OML_READY.

Change-Id: If5251b102c8aa45dfc8cc4ee4e0223d7dc438938
2023-01-31 12:05:02 +01:00
Philipp Maier 4c680eb798 pcu_sock: clean up logging in info_ind_fill_trx
Change-Id: Ie5c1abcf7b25fe00b6c228c49648e018f94190f0
Related: OS#5198
2023-01-31 10:50:37 +01:00
Philipp Maier f21d423b0c pcu_sock: fix sourcecode formatting
Change-Id: I593c16efa1639aa8d2f90735bfdc9750cf695ecd
Related: OS#5198
2023-01-30 17:45:30 +01:00
Philipp Maier a68cdf57a3 pcu_sock: check trx mo state
Make sure that the TRX MO state is enabled and unlocked before filling
in any TRX information into the info indication

Change-Id: I7a93826e6b0df187425310cb82854e7d7fb47e72
Related: OS#5198
2023-01-30 10:36:08 +00:00
arehbein 2a24613e39 osmo-bsc: Fix 'apply-config-file' CTRL command
Make 'apply-config-file' check the neighbor config, just as is done after config parsing on startup

Related: OS#5866
Change-Id: I24ae8cd7e5e0d15eab9fd04b1858072bf0bad36a
2023-01-26 21:28:57 +00:00
Max 484f0771cd SI: set type 10 length properly
According to 3GPP TS 44.018 §9.1.50 SI10 is 168 bits long.

Related: OS#5783
Change-Id: Ifd76ebb10029b95a80a85bea4d102d5e100c182c
2023-01-23 18:24:18 +00:00
Max 715dc37b10 SI: use defined constant instead of magic number
Related: OS#5783
Change-Id: I2ecac86fb860241bccf56c03d0454f07552fdc9d
2023-01-23 18:23:48 +00:00
arehbein 945e2514ca osmo-bsc: Log error regarding BTS number explicitly
Related: OS#5864
Change-Id: I64d12b3ebadbf550ecb72ccde2845951e3e309ee
2023-01-23 10:39:37 +00:00
arehbein fd6b81a042 vty: Add check against sensible default value for Ny1
Related: OS#5475
Change-Id: If3f96a6bd4f9ae32b6421de43c1c5a5d64482089
2023-01-23 09:59:36 +00:00
arehbein 9ff26123b3 vty: Add support for Ny1 configuration
Related: OS#5475

Change-Id: I6318cceb4ebdce50005e39e2e9323c1c8433250a
2023-01-23 09:59:36 +00:00
Philipp Maier 8c8905302f pcu_sock: move code that fills in trx info to helper function
The function pcu_tx_info_ind() fills the trx information in the info
indication. Since the function is already quite long, move the trx
related part into a sperate helper function.

Change-Id: Ic30185c9364adcc61d0a9d3483b0550ac1cdf894
Related: OS#5198
2023-01-12 15:39:30 +01:00
Philipp Maier a8ad2b1b93 pcu_sock: guard against too many TRX
The pcuif only supports a limited but sufficient number of TRXs. When
filling in the TRX array in info_ind, we must guard against overflowing
the maximum number of TRXs

Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42
Related: OS#5198
2023-01-12 15:39:30 +01:00
Philipp Maier 0b7d9b26b6 abis_rsl: fix sourcecode formatting
Change-Id: I6c4b6bd86c081046e34f51625c86015fc58c55c2
2023-01-12 13:59:22 +00:00
Philipp Maier 9b45d86e5e abis_rsl: fix frame number calculation
The formula that is used to recover the (relative) frame number from the
T1, T2, T3 parameters matches the definition in the spec, but since the
partial term t3-t2 can be negative special precaution is required when
performing the MOD 26 operation.  This is due to the truncated modulo
implementation in C/C++, which has a very specific understanding on how
to deal with negative input parameters.

The libosmocore gsm_gsmtime2fn(() offers a correct implementation, so
lets use it.

Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Related: OS#5198
2023-01-12 13:55:49 +01:00
Philipp Maier 5cd6d86e94 pcu_sock: drop unused variable pcu_direct
The variable pcu_direct is set to one permanently, lets remove it.

Change-Id: I7917ee5abc3347776dc9793cfb4ec3e99df94683
Related: OS#5198
2023-01-10 12:53:42 +01:00
Philipp Maier c5476db6a5 pcu_sock: drop unused function prototype
The function trx_get_hlayer1() is defined as a prototype but it is not
used anywhere and there is also no implementation, lets drop it.

Related: OS#5198
Change-Id: I91ead9379140e971ccabc83cbf2b62b8aa1fc8a2
2023-01-10 12:53:06 +01:00
Philipp Maier 813e083f90 abis_rsl: when doing packet access, log t1,t3,t2 and fn
The (relative) frame number that is forwarded to the PCU is an
important parameter which is computed from t1,t3,t2.

Change-Id: I83d20ba9e0ce6488d458ccf4a85c8445c30e3a89
2023-01-10 12:29:50 +01:00
Philipp Maier f471b3932a abis_rsl: show full request reference in log
When a CHAN RQD is received via RSL, we show ra and other parameters.
Lets also show T1, T3 and T2.

Change-Id: I78499b49ae176b736e384e193fadc0bdd669dffa
2023-01-10 11:27:55 +00:00
Philipp Maier 71a4f1302b abis_rsl: add spec ref for frame number calculation
The frame number calculation in rsl_rx_pchan_rqd() is done using a
specific formula. Lets add a spec reference and also restructure the
code a bit.

Change-Id: I60500c8694dbc2e6e2c4bbffd4ff7057bbc324e6
2023-01-06 16:22:04 +01:00
Pau Espin 22cbe9a332 bsc_compl_l3(): Update documentation regarding no bsc_subscr in conn
TTCN3 have been improved in osmo-ttcn3-hacks.git Change-Id
I6e99ac39f32c9a981420b73f8d7d1568d2fa1c54 to use valid l3 data.

Related: SYS#6280
Change-Id: I4918f1741d465abf8b06a9c65199a44b09778299
2023-01-03 18:23:24 +01:00
Pau Espin c409977031 bsc_subscriber: Allow creating subscribers identified by IMEI
IMEI may be used as MobileIdentity during MO emergency call
establishment if the MS has no valid IMSI assigned.

Related: OS#5849
Change-Id: I586b1ee30cbb26ddf58788168d56c962e03ccd5c
2023-01-03 16:46:05 +01:00
Alexander Couzens 315af2f9ea bts: ipa/osmo-bts/sysmobts: MO: add support for the second NSVC
The second NSVC MO has been explicit skipped and never been interacted with.
osmo-bts is already supporting it for a long time as well the PCU is
supporting it at least since the NS2 code migration.
Fixes the ttcn3 test case BTS_Tests.TC_pcu_socket_two_nsvc.

Closes: OS#5835
Change-Id: I3486a7cc9a424602b73f8adc2fefce169213e46b
2023-01-03 09:13:52 +00:00
Pau Espin 6cc5f08eb8 bsc: Fix crash if PagingResponse with invalid MobileIdentity is received
It was found in a BSC on the field that an MS sending an incorrect
MobileIdentity IE (wrong length) in PagingResponse was generating a
crash on the BSC.

When the MobileIdentity cannot be parsed right now we keep on instead of
rejecting the conn. This should change in the future, but it needs
further improvements in our TTCN3 tests. For now let's simply validate
the subscriber is not NULL; since recently paging optimizations made
paging_request_stop() require the subscriber to be non-null.

Fixes: 27cb5d3e24
Related: SYS#6280
Change-Id: If8b439ff74c5dd690d637d3e3278c75d6cd6b928
2023-01-02 16:58:36 +01:00
arehbein 6c2798c5ce osmo-bsc: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: I9d4dc72f8296f82937d2b97fd40a202f1ac98403
2022-12-23 11:13:42 +00:00
Max c230853446 ctrl: take both address and port from vty config
Change-Id: Ic2c56ffee6237333d919c72bf26076ac24a1fa52
2022-12-20 15:22:23 +00:00
Neels Hofmeyr fc33972530 fix Speech Codec cfg in BSSMAP Assignment Complete
In send_assignment_complete(), obviously return the current channel
configuration from lchan->current_ch_mode_rate, which is the proper
place to get the channel mode after RSL Chan Activ Ack.

It is interesting to look at the history of this line of code.
lchan->current_ch_mode_rate was added later, so now the mistake is very
obvious.

Related: SYS#6229
Change-Id: I3bf8f5ea9ae2a3c12fc5b483818d550a069fe66e
2022-12-19 12:17:35 +00:00
Pau Espin aa292a482c vty: Write amount of timeouts elapsed for a paging request
Related: SYS#6200
Change-Id: I55c84c0d20fc4120b7b4cdd06ed95a8847a6600a
2022-11-30 20:23:39 +01:00
Pau Espin 867e73e96b paging: Optimize retrieving number of request per paging group
This patch caches the counts of initial paging requests for each paging
group. This count is needed to estimate T3113 when a new incoming paging
request is received and it has to be inserted into the queue.
With this there's no need to traverse the whole initial_req_list every
time a new incoming paging request is receiving, potentially saving lots
of iteration and hence lots of CPU when the queue is long.

Related: SYS#6200
Change-Id: I6994127827d120a0b4dd3de51e1ddde39f2fe531
2022-11-30 20:23:39 +01:00
Pau Espin d681b897b6 paging: Replace reqs waiting for retransmission with new incoming inital req if queue is full
If queue size (in transmit delay of requests) is too long (above
threshold) when a new initial incoming request arrives, instead of
directly discarding it, see if we can drop a pending retransmission and
insert the new one instead, in order to avoid losing initial requests.

This is done under the assumption that it is more important to transmit
intial requests than to retransmit already transmitted ones. The
rationale is that there's lower chances that an MS which didn't answer
lately will answer now (aka being reachable at the cell), so it's better
to allocate resources for new requests (new MS) which may be available
in the cell.

Change-Id: Idfd93254ae456b1ee08416e05479488299dd063d
Related: OS#5552
2022-11-30 20:23:34 +01:00
Pau Espin 3b5e898271 paging: Split paging queue into 2 queues: initial and retrans
Initial requests: paging requests which haven't been yet transmitted
Retrans requests: paging requests which have already been transmitted at
least once.
Until now one queue was used (llist) to store both. The initial requests
were stored at the start of the queue in FIFO order. After the last
initial requests, the retrans requests followed also in FIFO.

This ordering was used in order to prioritze scheduling of initial
paging requests over retransmit paging requests.
In the end, having both types in the same list only make code handling
the list more complex.
Hence, this patch splits the shared llist into 2 llists.

Related: SYS#6200
Change-Id: Ib68f2169e3790aea4ac77ec20ad79f242b7c2747
2022-11-30 20:10:35 +01:00
Pau Espin 8c723f5157 paging: Fix wrong count of reqs_before if queue only contains retransmissions
When adding a new incoming request (aka "initial_req"), if the queue is
full only of retransmis (no not-yet-ever-transmitted initial requests
queued), then the new incoming request is inserted at the start of the
queue, in order to take scheduling priority over retransmits.

This was already fine before this patch, but the counting of requests
before it (used to calculate its T3113) was wrong, because it counted all
the retransmissions. This patch fixes it to end up with
reqs_before(_same_group)=0.

Change-Id: Ib2e810b0bcc51eac117713584310272462c58867
2022-11-28 19:01:46 +01:00
Pau Espin 671811f4fc paging: Introduce VTY configurable X3113 (Maximum Paging Request Transmit Delay Threshold)
This allows configuring the maximum delay of paging requests to be
queued according to other parameters, such as MSC paging request
timeouts, etc.

Related: OS#5552
Change-Id: Ia556ef4e474e6a2d0d1618bab680a3330a3c062b
2022-11-28 16:30:12 +01:00
Pau Espin 8ff2931862 vty: Fix lost 'no timer-dynamic T3113' config when writing current config
The default is to have a dynamic T3113. However, if the user wished to
set it statically, it would show up when writing the current VTY config.

Change-Id: If121a97bbb4a0234a0c162ef37c3692d6408404d
2022-11-28 16:03:08 +01:00
Pau Espin 882602cdd8 paging: paging: Drop unneeded extra param in paging_remove_request()
The BTS can be obtained easily from the backpointer in req->bts. Having
the extra param can only lead to confusion and introduction of bugs, as
happened in bug fixed by Change-Id
I8c6828f86b7ccbb2c4a09ca1aec859a2c597b679.

Related: SYS#6200
Change-Id: I545fd853fdffce7f23f0d99203c66c3b39144e4b
2022-11-24 18:24:47 +01:00
Pau Espin 346c6011bc paging: Fix regression stopping active requests on unanswered BTS
When rewriting the loop, the pointer passed all the time to
paging_remove_request() was the one of the BTS which answered the
request, not the one actually handling the related unanwared still
active paging request.

Fixes: 70a1d60a83
Related: SYS#6200
Change-Id: I8c6828f86b7ccbb2c4a09ca1aec859a2c597b679
2022-11-24 18:14:26 +01:00
Pau Espin 5f46039f68 subscriber: constify bsub func param
Change-Id: I8603162abf9df71f94aa1549ea449f29ecd73b6d
2022-11-24 17:46:40 +01:00
Pau Espin 934a9b06c7 paging: constify bts param in some functions
Related: libosmocore.git Change-Id Ib11bfe57f546a5618f70152b9b75115808e54bf6
Change-Id: Icb85fecba142151b05f289adae8894cd50396224
2022-11-24 17:15:36 +01:00
Pau Espin 94951af66a paging: Introduce BTS stat paging:available_slots
This allows analysing the behavior of paging queue at the BTS over time.

Related: SYS#6200
Change-Id: I5f44ac9b9da3ed7120b04d199e52215c0fd3e8a9
2022-11-23 11:09:05 +00:00
Pau Espin a3e5b0db7d paging: Introduce BTS stat paging:request_queue_length
This allows tracking each BTS active paging request queue length over
time, and evaluate CPU load based on the number of active paging
requests queued.

Related: SYS#6200
Change-Id: I6d296cdeba1392ef95fc31f6c04210c73f1b23e5
2022-11-23 11:09:05 +00:00
Pau Espin fd62ac483e paging: Rename stat t3113 -> paging:t3113
This way all paging related stats can be grouped  (more will be added in
follow-up commits).

Related: SYS#6200
Change-Id: Iede1b6f68df468c7a3b3bf5fce7f68bb08b78832
2022-11-23 11:09:05 +00:00
Oliver Smith 1784524392 Cosmetic: fix spaces around timers
Use spaces around equals signs inside structs, as expected from the
kernel coding style we mostly follow.

Neels wrote:
> IIUC "T=123" without spaces is my personal favorite that goes against
> the accepted linter standard, i guess rather than everyone else
> adapting to my weird style, i should start adding spaces in my
> patches.

Change-Id: I01ce986a1b0cdd74d945a04ae62a07f2850d366f
2022-11-23 10:18:32 +00:00
Oliver Smith a68b80eb9e lchan_fsm: fix lchan_fsm_on_error size
Set it to 32, because osmo_fsm allows 32 states.

Change-Id: I62f5e0f380513c52ea6932b270cf0c852930eb9f
2022-11-23 10:18:32 +00:00
Oliver Smith adb55f1fe0 Cosmetic: lchan_fsm: drop obsolete comment
Neels wrote:
> i guess we can drop this comment now, it is a remnant from separating
> osmo-nitb -> osmo-bsc + osmo-ms

Change-Id: I2ce4d691715c1ea5c7c7896693a03b0aefbdb5b9
2022-11-23 10:18:13 +00:00
Pau Espin 27cb5d3e24 paging: Use bsub->active_paging_requests to optimize cancelling based on reason
Prior to this patch the whole paging queue of each BTS was iterated.
After the patch only the active paging_req for a given subscriber are
iterated.

Related: SYS#6200
Change-Id: I225d5e08427c6bb9d92ce6a1dccb6ce36053eab5
2022-11-22 19:55:46 +01:00
Pau Espin ccba3a9e4f lcs: Fix passing NULL bsc_subscr to paging_request_cancel()
This is triggered by BSC_Tests.TC_lcs_loc_req_no_subscriber.
Before, the NULL ptr was not a problem because paging_request_cancel()
only used the pointer to compare it against other pointers, but never
accessing it. A follow-up patch is, however, changing the implementation
to optimize the lookup by using the subscriber pointer, which generates
a crash.

Related: SYS#6200
Change-Id: Id0de43ac5bde0f52f258de6c9bf58b173301c8db
2022-11-22 19:55:46 +01:00
Pau Espin 0ed7700c1e paging: Use bsub->active_paging_requests to allow early loop termination adding paging_req
Before this patch, the entire queue of paging_request had to be iterated
in order to find if the subscriber already had an active paging request
(discarding duplicates).

Now that bsc_subscriber holds a list of its active paging requests, it's
easier to look at its list to find out if it is already active on that
BTS.

As a result, there's no need to unconditionally iterate the whole list
and we can optimize the loop finding the spot to insert the new queue:
- First the potentially way smaller loop over
  bsub->active_paging_requests is done
- Second, only if the first loop allowed, the bts->pending_requests is
  iterated and potentially early terminated.

Related: SYS#6200
Change-Id: I7912275026c4d4983269c8870aa5565c93277c5a
2022-11-22 19:55:10 +01:00
Pau Espin 70a1d60a83 paging: Store list of gsm_paging_request in bsc_subscr
This allows havily decreasing the algorithmic cost of removing all
pending active paging requests for a given subscriber once it answers
on a given BTS.

Beforehand, the whole paging queue of all BTS were iterated. Now, only
the active requests for that subscriber are iterated.

Related: SYS#6200
Change-Id: I831d0fe01d7812c34500362b90f47cd65645b666
2022-11-22 19:53:17 +01:00
Pau Espin 2709614011 paging: Get rid of unneeded count returned
The return count is not used since there's no use for it. Get rid of it
to simplify the code.

Change-Id: I7bf04b94173f0ae7b26caf5d7f9abeeb9abf9b6c
2022-11-22 16:05:09 +01:00
Pau Espin ae07416208 paging: Avoid repeated paging req lookup on BTS receiving paging resp
This saves the BSC from iterating twice the whole paging list of the BTS
which received the paging response.

Related: SYS#6200
Change-Id: I5f9215f31428ce0249cd9ece6d2d4e93155f429f
2022-11-22 12:49:13 +01:00
Alexander Couzens cf3145c966 nm_rcarrier_fsm: fix indention of ENABLED state
Change-Id: I52945babd2b31b20a578ec6818af763b0dd98d1a
2022-11-15 11:32:26 +00:00
Alexander Couzens af189fb786 Add BTS setup ramping to prevent BSC overloading
Prevent BSC overloading in the event of too many BTS try to connect.
E.g. a network outage between the BSC and BTS.
The BSC will accept incoming OML connection, but will delay sending
any BSC originated messages.

Change-Id: Id56dde6d58f3d0d20352f6c306598d2cccc6345d
2022-11-15 11:32:16 +00:00
Harald Welte 55c81a9b61 update very outdated vty copyright statement
Change-Id: I9bf6466a6b7f3347453a89ab754c372f6afa920d
2022-11-11 21:55:58 +00:00
Harald Welte 6c8ca97546 Support building with -Werror=strict-prototypes / -Werror=old-style-definition
Unfortunately "-std=c99" is not sufficient to make gcc ignore cold that
uses constructs of earlier C standards, which were abandoned in C99.

See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.

Change-Id: Ic92aa70d569778a776f4c5d24c455f71fd50b61b
2022-11-10 00:28:46 +00:00
Vadim Yanitskiy 2986ee497b bts_vty: fix wrong description used for C/I threshold values
Found this bug when building with CPPFLAGS="-Wunused-macros".

Change-Id: I02828acebe2d607f0e7fd3c61ce45f2af5237e49
2022-11-09 02:46:16 +07:00
Alexander Couzens 4f057d028d bts_ipaccess_nanobts: remove unused assignment
Change-Id: I811f7c596de42eff250b1882a9e2e7cdece6259d
2022-10-30 12:27:40 +00:00
Philipp Maier 79d2f44e65 abis_rsl: be more clear about vendor specif RSL extension
The function rsl_ericsson_imm_assign_cmd has a comment "Chapter 8.5.6"
above it. However, thats only half true. The function implements
ericsson vendor specific RSL IEs, so lets be more clear about this in
the spec reference.

Change-Id: Id27662e208ca8ac0a48851583c11fbacf85f988c
2022-10-28 14:26:02 +00:00
Oliver Smith 2b6c58fddb Cosmetic: fix desc of neighbor_ident_add_neighbor
Change-Id: I6d78220156f8a4a4b246f9fcc5e9d066c2a90bbb
2022-10-27 14:07:40 +02:00
Oliver Smith 5bdc3eca68 gsm48_parse_meas_rep: fix parsing multi-band list
When looking up "BCCH-FREQ-NCELL i" from the measurement report, don't
treat the BCCH channel list as one list sorted by ascending ARFCN.
Instead, treat it as two sub lists, one for the same band, and one for
channels in different bands, as described in 3GPP TS 04.08 § 10.5.2.20.

This fixes getting the wrong ARFCN from measurement reports in
multi-band BSS, which leads to failing handovers.

Fixes: OS#5717
Related: osmo-ttcn3-hacks I4fe6bb9e4b5a69ea6204585ebdf1f157a68a8286
Change-Id: Ic5e4f0531e08685460948b102367825588d839ba
2022-10-27 09:19:52 +00:00
Pau Espin 69db1e9498 vty: Fix and deprecate typo in cmd 'amr-payload bandwith-efficient'
Related: OS#6161
Change-Id: Iefbadea374974587a421ec981e246b87c7b5de59
2022-10-26 18:10:51 +02:00
Pau Espin da4af65a51 sccplite: Use mgwpool config to set up socket forwarding IPA-MGCP from MSC to MGW
In SCCPlite, the BSC receives the CN-side MGCP from the MSC through an
IPA conn, and it then forwards those messages to its co-located MGW
through a rawUDP socket created at startup.

This forwarding UDP socket still relied exclusively on the "mgw.conf"
struct which was filled only by the old VTY interface which was been
deprecated lately.

This patch moves the mgw-pool setup before the msc setup so that if the
VTY config file still uses the old VTY, the single MGW is added to the
MGW pool through mgcp_client_pool_register_single(). It then simply
picks the first available MGW from the pool when creating the raw UDP
MGCP-forwarding socket.

This means SCCPLite is still left with supporting only 1 MGW. If more
than one MGW is defined in the pool, then when the call is being set up
a different MGW could be picked from the pool while the CN-side MGCP
would still be sent to the MGW pool selected at osm-bsc startup.

This limitation coul be removed later on  by adding a new VTY command
under the "msc" to pin calls for an MSC to an MGW with a given "mgw_nr"
from the pool, and that same MGW be looked for in the pool every time a
new call is being established.
Another possibility would be to avoid creating the "connected" UDP
socket at osmo-bsc startup, and rather use it in non-connected mode and
transmit (sendto) using the mgcp_client remote address during call
establishment.
In any case, this is left as future excercise since so far there hasn't
been any need for multiple MGWs in SCCPLite setups.

Related: SYS#5987
Change-Id: If105dee52b8d36161c759f979eaef4579b47d365
2022-10-26 11:42:30 +02:00
Neels Hofmeyr 50c5f50f83 gscon_pre_term: properly clear mgw ep
Commit 53b23c252e introduced a weird line
duplication that instead should have been the way this patch does it.

Change-Id: I5a9a983bb6135059ec01edf054ea3f7165bb6a6f
2022-10-21 17:35:34 +00:00
Pau Espin 9e136f52c1 vty: Make use of new mgcp_client_pool_config_write() API
Let's use the new API available in libosmo-mgcp-client to control more
consciously where the mgw pool config is printed.
Before this patch, the place where the node was printed was defined
based on implementation details on how the enum of nodes are defined and
installed.

Change-Id: Ib2f04d96ca846d2d61af0b0c0ea1924609004952
Related: SYS#5987
Depends: osmo-mgw.git Change-Id I7a620cf47886d8ecab30ce369cf123d98ab842c5
2022-10-18 14:37:17 +02:00
Pau Espin 1b11dd31a3 cosmetic: Fix typo in comment
Change-Id: I6afe7a7a2ae977782e7f13b1ee90b6c8aafe3050
2022-10-17 18:16:27 +02:00
Pau Espin 78e3983526 cosmetic: Fix indentation whitespace
Change-Id: I16f4c8018ac906e865885332fec3912c6e539d4e
2022-10-17 18:00:50 +02:00
Pau Espin 7048d2f0ae gscon_ensure_mgw_endpoint(): Set mgw_enpoint ptr to NULL not needed
The condition prior to this conditional branch already asserts the var is
NULL.

Change-Id: I94c9532045c657fc07e4ad53d567847915bae367
2022-10-17 17:54:32 +02:00
Pau Espin 9d17451a0d vty: Move all MSC_NODE commands to be together
Change-Id: Ib35282bf4f2f671d700560a5284115a39dd695eb
2022-10-17 17:03:24 +02:00
Pau Espin 0690c5bc75 Introduce support for MGW-pinning per BTS
This feature allows pinning each BTS to a specific MGW from the
configured pool. The pinning can be soft or hard (strict). If strict
pinning is not set, the configured MGW is selected with priority, but
other MGWs can still be selected during each call setup if the
preferred MGW is found not available at that time, hence avoiding denial
of service for the entire BTS if that MGW goes down.
If strict mode is selected, the call will be refused if the configured
preferred MGW is not available at the time the call is set up.

It is useful to use this feature when Osmux is configured between
the BTS and the BSC and an MGW pool is in use. This way the BSC is
capable of grouping all the calls of a BTS towards one MGW, hence taking
advantage of the Osmux trunking optimizations to reduce link data usage
(AMR payload of several concurrent calls ending up sharing the same
underlaying UPD packet).
Furthermore, this allows the operator to intelligently spread load over
the MGW pool in order to avoid ending up with more than 256 concurrent
Osmux circuits on any of the co-located MGWs in the pool (maximum supported
at the moment).

Related: SYS#5987
Depends: osmo-mgw.git 5d8b5b093595e1203e288c3175c163c0994b1102
Change-Id: I9a7a5af72795faed0d12d9d73b59951b6a0e9c7d
2022-10-16 22:21:17 +02:00
Philipp Maier ad27ef2b15 abis_rsl: delete CHAN RQD from queue when rach ind was sent
The CHAN REQ entry is not deleted after its information was passed on to
the PCU. This causes the same entry to be used over and over again while
blocking other incoming CHAN RQD.

Change-Id: Ia4abc55fc6fcb1c00991cc84d09529131d014910
Related: OS#5198
2022-10-14 16:08:17 +02:00
Pau Espin 62c13d99d0 vty: Fix indentation in osmux cmd during write-config output
Change-Id: I24b381f5944b0b48b6bb93e2cf1646b22e1b35cf
2022-10-13 18:11:41 +02:00
Pau Espin d9e11fbf41 cosmetic: Fix whitespace indentation
Change-Id: I7d713872220e665e126dee670cdd77f7eb44eba4
2022-10-13 13:42:29 +02:00
Pau Espin f9e5f65eb3 vty: 'hopping arfcn add': succeed if adding arfcn already in set
There's no need to fail, simply make it a noop in that case,
everything's fine and everybody is happy (specially when using CTRL
command "apply-config-file" to load a .cfg file containing
modifications.

Related: SYS#6138
Change-Id: Ia4e70d20d48a28c46a21dd10358577e5c798744c
2022-10-06 19:42:06 +02:00
Pau Espin 52fb5be52a ctrl: Introduce hopping-arfcn-{add,del} commands
Related: SYS#6138
Change-Id: Ib886cff70dd8940aa2f4095b84f9e60056c9588e
2022-10-05 17:25:27 +02:00
Pau Espin 5c7f2602f2 Rearrange ctrl interface code
Current organization is totally mess, there's actually no organization
at all for lots of commands.
Let's organize most commands based on CTRL node where they are applied:
global, bts, trx, etc.
Specific set of commands such as neighbor-related, rf-related, etc.
are left in separate files as subsections inside the same node, so the
hierarchy is still clear.

Change-Id: I51a9b31780a4a8026aafb2d732369cdc10c8bb70
2022-10-05 17:25:23 +02:00