Commit Graph

2648 Commits

Author SHA1 Message Date
Andreas Eversberg fd35bc917a ASCI: Do not release channel, if SAPI 0 is released
A VGCS channel must not release, if all SAPIs (including 0) are
released. lchan FSM will ignore this.

Change-Id: Ief1e1894362c4917f6e0092268690f68c8193750
Related: OS#4852
2023-07-21 11:15:27 +00:00
Andreas Eversberg 0a2e79e946 ASCI: Add new debug category "ASCI" for VGCS/VBS state machines
Change-Id: I4714fa4ff2b1327183a365223a3e3d89ae0357f7
Related: OS#4852
2023-07-21 11:15:27 +00:00
Andreas Eversberg 87a6e6b651 ASCI: Prepare bssmap_handle_ass_req_ct_speech() for VGCS/VBS
bssmap_handle_ass_req_ct_speech() calls select_codecs(), which requires
a bts pointer.

An extra bts pointer is added to both function and used instead of
deiving it from the conn->lchan pointer. This funcion can then be called
if no channel is assigned (yet). (conn->lchan is NULL)

This function will be used by the VGCS/VBS call control also.
(Chg-Id: Id9e94fb4f27bb438b7093c031344a3400bfa34f1)

Change-Id: Ifc1e315d5282f01f8d1bd600d62476c2ae74eca9
Related: OS#4852
2023-07-21 11:15:27 +00:00
Andreas Eversberg b18cae1952 ASCI: Make function to add OSMUX IE public
Rename _gsm0808_ass_compl_extend_osmux() to gsm0808_extend_osmux().

This IE is also used for VGCS/VBS assignment command that is located in
a different file.

Change-Id: I1452cabb142f9e7a169f4ddfeac85908abaf8dfc
Related: OS#4852
2023-07-21 11:15:27 +00:00
Andreas Eversberg 2193f98f3e ASCI: Add TX support for UPLINK RELEASE message
Change-Id: Ie3d8ad1ea8325c13759838d8083c6e47a0f54497
Related: OS#4852
2023-07-21 11:14:44 +00:00
Andreas Eversberg 2436f40b4c ASCI: Add selection reason for VGCS/VBS channels
"enum lchan_select_reason" gets a new selection reason: "SELECT_FOR_VGCS"

The selection "direction" can also be changed via VTY.

Change-Id: I6b96d0a1df68efa5858b98297ebe0944b1473aaf
Related: OS#4852
2023-07-21 11:14:44 +00:00
Andreas Eversberg 4827437a26 ASCI: Add support for Group/Broadcast channel activation
"struct lchan_activate_info" is expanded to support flags for VGCS and
VBS. These are used to send the correct Channel Mode to the BTS.

"enum lchan_activate_for" is expanded to indicate and activation of
VGCS/VBS calls.

Change-Id: Ic0c0597d149d0758d6766937d99660fa02e0e139
Related: OS#4852
2023-07-21 11:14:44 +00:00
Andreas Eversberg bcb7b32f5a ASCI: Add support for NOTIFICATION COMMAND (RSL) message
This message will be sent to each BTS with a VGCS/VBS channel to notify
the served MSs about ongoing group/broadcast calls. It is also used to
remove the notification, if the call is terminated.

Change-Id: I96ec0ee5d1a772a45f1ebfd64210718c8bf5aa58
Related: OS#4852
2023-07-21 11:14:44 +00:00
Andreas Eversberg a7e3e0064d Cleanup code style of rate counters in osmo_bsc_msc.c
Change-Id: I7cfd4f20ebfee0c8df9305372977d6628d6337c5
2023-07-21 11:14:44 +00:00
Andreas Eversberg e45fdd42d7 Fix typo in rate counters ASSIGMENT->ASSIGNMENT
Change-Id: I73079948afbdde35594660959b5335118a810d7b
2023-07-21 11:14:44 +00:00
Andreas Eversberg aee1db9dc1 ASCI: Add new rate counters to support VGCS/VBS messages
Change-Id: I18e4ca3599e480de2d0f64cc1b6f4bb6ce8020d4
Related: OS#4852
2023-07-21 11:14:44 +00:00
Vadim Yanitskiy 121461669e lchan_select: fix lchan selection for GSM48_CMODE_DATA_{14k5,12k0}
Change-Id: I271ebf7e64e3d0861586e9bc63bec113cb5fb410
Fixes: d5eb0f1b5 "lchan_select: chan_mode_to_chan_type: support CSD"
Related: OS#4393
2023-07-20 08:01:17 +00:00
Oliver Smith e6337315d0 configure: add --enable-meas-udp2db/pcap2db/vis
Do not build these utils implicitly if libsqlite3/libpcap/libcdk are
installed. Add configure flags for explicit building and fail if
dependencies are missing.

Keep behavior in deb and rpm packaging:
* deb: build meas_vis
* rpm: build none of these (libcdk dependency for meas_vis is not
  available in most rpm-based distributions we build for)

Fixes: OS#5173
Depends: docker-playground I015b6d7cb834e99ea5d04206ba5f8c519c4e6af1
Change-Id: I8b3d5efb769437a5d3036e1e627b8d477275d93e
2023-07-20 07:20:05 +00:00
Matan Perelman 241e594f7a ctrl: Support adding si2quater earfcn neighbor
Change-Id: Ifd2740ee54db66742785437a278cb9244e1f76d0
2023-07-17 09:00:49 +00:00
Matan Perelman 1bae98e2d6 ctrl: Add getting si2quater earfcn neighbor list
Change-Id: Ib942bfa95aca2b514ac68f602545b9e7cbed097a
2023-07-17 09:00:49 +00:00
Matan Perelman 8b64e032e2 ctrl: Support adding si2quater uarfcn neighbor
Change-Id: I8116175b5dff1ee4bbff0dc3b4f93890ce4c975b
2023-07-17 09:00:49 +00:00
Matan Perelman 4e13aab269 ctrl: Add getting si2quater uarfcn neighbor list
Change-Id: Iab1d2e264c0deb75f03aec6ae38ac406bc7b58cb
2023-07-17 09:00:49 +00:00
Pau Espin bc8b61139d cosmetic: Document DRX_TIMER_MAX upper limit on BCCH smaller than possible range
Related: OS#6097
Change-Id: I5c8699bb5357a74805c25e8d02e982b25b47555d
2023-07-14 19:02:11 +02:00
Pau Espin 74b34b4395 SI13: Set DRX_TIMER_MAX value actually transmitted
The set of values in seconds which can be expressed in the 3-bit field
DRX_TIMER_MAX (0s, 1s, 2s, 4s,...64s) don't include the "3s" that where
being specified. Instead, libosmocore's encode_drx_timer() was
taking both upper boundary "4s" and encoding it "0b011".
Hence, better write the value actually being transmitted to MS, to avoid
users/readers confusion.

More related info can be found on TS 44.060 Table 12.24.2 and TS 45.002
6.5.6.

Related: OS#6097
Change-Id: Ibf01a50b258e197ba5e3173492513349ddffdb38
2023-07-14 19:01:44 +02:00
Oliver Smith 40f5b3ff97 Fix various typos
Change-Id: I2726f18156f96999159f7b5f7c6c5a2d93667131
2023-07-11 12:48:27 +02:00
Matan Perelman 08b7b008c2 ctrl: Add rach max delay
Change-Id: I113211cc7e7ef20fac7e9d30e156522406ad62f7
2023-06-30 17:59:12 +03:00
Matan Perelman 1dd9afe582 ctrl: Add bsic
Change-Id: I5c941770924e5373733c3a3939671fab518f7a58
2023-06-25 06:26:22 +00:00
Matan Perelman 03b7b76a9f ctrl: Add setting SI5 neighbor list
Change-Id: I1bab242cdbd0d7b39636d69027bf75794a5d5ba7
2023-06-25 06:26:22 +00:00
Pau Espin caad230e99 Use new libosmo-sccp APIs osmo_ss7_asp_get_{name,proto}()
Depends: libosmo-sccp.git Change-Id If9acfca1abc9ab7eb6d2388f548d7ee577b9c5ac
Change-Id: I0479f7bfb8337a6a955ba66c7b403db3565659d6
2023-06-21 11:01:35 +00:00
Harald Welte 6153c619fc prevent bogus NCH related error message if no NCH is configured
Back in Change-Id  Iefde0af44a663f22462a54d68a58caa560eceb2f I
introduced indication of the NCH position in the SI1 rest octets.

However, a related ERROR messages is accidentially also printed in
case no NCH is configured at all.

Let's split the already overly-complex if clause into a separate
function which then also handles the "bts->nch.num_blocks == 0"
case as permitted.

Change-Id: Iab2120a343cb0f6553f13a821b44b3c312587579
Related: OS#5781
2023-06-21 11:48:45 +02:00
Philipp Maier faff9f8fdc pcu_sock: use correct SAPI in message PCUIF PCU_IF_MSG_DATA_CNF_DT
The message PCU_IF_MSG_DATA_CNF_DT uses SAPI PCU_IF_SAPI_PCH, which is
formally not correct. It should use SAPI PCU_IF_SAPI_PCH_DT

Depends: osmo-pcu.git I0883b51fc232ec0267f1511c3a37c0bcd0967a08
Change-Id: Id5c799e625c56e57f7b51cd4fb57f5bea9c973d2
2023-06-16 15:20:48 +02:00
Daniel Willmann ee8205b46b cosmetic: Fix type in VTY description
Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5
2023-06-15 18:42:16 +02:00
Pau Espin ea9a6a1aea Use new mgcp_client_conf_alloc() API to alloc mgcp_client_conf
Depends: osmo-mgw.git Change-Id Iba0853ed099a32cf1dde78c17e1b34343db41cfc
Change-Id: I9d342d2eff7b57b0c542ff0c1c579f708451637c
2023-06-13 19:53:30 +02:00
Harald Welte 43440e1fc5 nanobts: Request "supported features" attribute from BTS and BB_TRANSC
The nanoBTS feature reporting works significantly different from what
osmo-bts implements.  They have a "Supported Features" IE in potentially
each of their MOs, and within this have nested IEs expressing respective
feature sets.

Let's start by requesting those for at least those MOs where we already
implement a GET ATTRIBUTES call in the FSM.

Change-Id: I15116044fb354ec0a0682c62078fbfa907b318f3
2023-06-11 19:32:33 +00:00
Matan Perelman 633b7a9caf ctrl: Add getting SI5 neighbor list
Change-Id: I71f5f23473b94059ac64770ceb256b4df36c0ef7
2023-06-11 19:26:34 +00:00
Matan Perelman d76bc795f7 ctrl: Add getting neighbor list
Change-Id: Icba0b7d92f4c67e617d707ca651d674f0d1ba8a7
2023-06-11 19:26:34 +00:00
Harald Welte 8798689f3b Support (optional) indication of NCH position in SI1 rest octets
This adds the vty commands and respective logic to allow the user to
specify the NCH (notification channel) position in the SI1 rests octets.

Change-Id: Iefde0af44a663f22462a54d68a58caa560eceb2f
Related: OS#5781
Requires: libosmocore.git I24a0095ac6eee0197f9d9ef9895c7795df6cdc49
2023-05-31 09:19:53 +00:00
Philipp Maier a1ff30920d pcu_sock: fix PCUIF interface (PCH)
The PCUIF interface implementation in osmo-bsc provides two ways to
access the paging channel (PCH).

1) Under the SAPI PCU_IF_SAPI_PCH PAGING COMMAND messages are accepted
as whole MAC block but the format is in the style that we are going
to deprecate with PCUIF v.11. Also at the moment those PAGING COMMANDs
are not confirmed towards the PCU. This is also not necessary since
osmo-pcu would silently drop such confirmations. (see pcu_rx_data_cnf
in pcu_l1_if.cpp)

2) Under the SAPI PCU_IF_SAPI_PCH_DT messages are also accepded as
MAC blocks but the SAPI will only accept IMMEDIATE ASSIGNMENT messages.
The messages are encapsulated in a struct that holds IMSI (paging group)
and TLLI (used for confirmation) as separate struct members. The
messages are also confirmed towards the PCU as it should be.

Since we want to depreacete the older V.10 version of PCUIF and there is
not much benefit in maintaining two interfaces we should use
SAPI PCU_IF_SAPI_PCH_DT for both message types. This also requires small
adjustments to osmo-pcu (see Depends).

Depends: osmo-pcu.git I99cfe373fa157cfb32b74c113ad9935347653a71
Related: OS#5927
Change-Id: I82443f2b402aa2416469c8c50b1c050323ef3b8f
2023-05-24 12:29:00 +02:00
Vadim Yanitskiy 1f3bfff668 copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
Change-Id: I849a18a3bfd15aad00de3e103339540a7548e097
2023-05-18 17:22:26 +07:00
Max c1e2888050 pcu_connected(): constify parameter
Change-Id: I6d18ec0ad2bd6f71e0187ed70b03c3a2d0447f21
2023-05-11 18:19:23 +00:00
Harald Welte ea7b53850b cosmetic: Clarify language ip.access nanoBTS vs. all IPA Abis/IP
Don't explicitly mention ip.access/nanoBTS if we actually want to refer
to all BTSs implementing an IPA-style Abis/IP interface.

Also, remove some bogus "is_ipa_abisip_bts(bts) || is_osmobts(bts)".
is_ipa_abisip_bts includes osmobts.

Change-Id: I31696d9a21a799511741a561085686cfa0728f93
2023-05-08 06:28:52 +02:00
Harald Welte ceccba70a9 cosmetic: Rename is_ipaccess_bts() to is_ipa_abisip_bts()
This function is used to check if the BTS is using the IPA Abis-IP
transport, and not whether its manufacturer/vendor is ip.access.

Let's use a less confusing name.

Change-Id: I202c58341c1536489064d2671c0842c6f70b5429
2023-05-08 06:28:51 +02:00
Harald Welte 5d8ab13b34 abis_nm: Only osmo-bts re-purposes the MANUF_ID for BTS feature flags
The Manufacturer ID IE is normally used to indicate the [name of] the
manufacturer.  In case of ip.access nanoBTS it is, for example, "com.ipaccess".

Osmocom decided to re-pupose this IE to indicate bts-specific feature
flags.  Stop interpreting the string "com.ipaccess" as feature bitmap.

In fact, nanoBTS doesn't support runtime reporting of features (at
least not in this way), so let's mark features_get_reported = false,
resulting in the copy of bts_model->features to bts->features at the
time a BTS is initialized.

Change-Id: I76cee190dc1f074464df570cdfc3d38559f04846
Closes: OS#5959
2023-05-04 05:23:42 +00:00
Matan Perelman ba3fe2c908 ctrl: Add setting access control class
Change-Id: I7abbf0adc3798e9224834a68d7cdce4bbe03c9a3
2023-05-01 22:16:30 +03:00
Matan Perelman a8fcc1bb73 ctrl: Add getting access control class
Change-Id: I279249f9047f5edacc9edf3d231e3e74023fc84e
2023-05-01 22:16:30 +03:00
Matan Perelman f4d9dfe6bd ctrl: Add cell reselection hysteresis control
Change-Id: Ia96f6656d99381c039a4b3fd02674215fbbaec91
2023-05-01 22:15:33 +03:00
Matan Perelman 639cd00a22 ctrl: Add penalty time control
The penalty time gives the duration for which the temporary
offset is applied.

Change-Id: Idfdd54dec72fb5f52eee22df018161d75b8c48c8
2023-05-01 19:13:49 +00:00
Neels Hofmeyr 5d8d6d2079 fix mscpool for large msc NRs
Use the proper type that can handle the entire range of MSC numbers we
allow on the VTY, we have:
 #define MSC_NR_RANGE "<0-1000>"

Before this patch, MSC pool round robin would glitch around for any
'msc' numbers 'msc 256' thru 'msc 1000'.

Change-Id: I98bee022c1a78508554d2ff4a10fbce3c53f1128
2023-05-01 00:11:48 +00:00
Neels Hofmeyr a70d6b25c4 fix length check in abis_rsl_rx_rll()
In abis_rsl_rx_rll(), we do the following header length check -- quick
challenge, can you spot the two bugs hidden here?

  struct abis_rsl_rll_hdr *rllh;
  if (msgb_l2len(msg) >
      sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh))
           msg->l3h = &rllh->data[3];

Fix these bugs:

- struct abis_rsl_common_hdr is already included as the first member of
  abis_rsl_rll_hdr, no need to add that.
- We are going to be accessing rrlh->data[3], so we must check for at
  least sizeof(*rllh) + 4.

Change-Id: Ie4aee615c8c904ae8308ec0074d8bc5208137061
2023-05-01 00:11:48 +00:00
Vadim Yanitskiy ea3e3c258d gsm_bts_send_c0_power_red(): check if BTS is online first
... and print a proper error message instead of "not supported".  We
don't know for sure whether it's supported before the BTS is connected.

Change-Id: I080aa7ef331b76918ae48d555eea6e4290c57120
Related: SYS#6435
2023-04-28 18:05:37 +07:00
Vadim Yanitskiy 16922c5017 bts: st_op_enabled_on_enter(): resume C0 power reduction
If power saving is enabled for a BTS, it should remain enabled even
if the BTS is restarted for whatever reason.  This persistence can be
achieved by re-sending the configured power reduction value whenever
the BTS NM FSM enters the ENABLED state again (i.e. reconnects).

Separate gsm_bts_send_c0_power_red() from gsm_bts_set_c0_power_red()
and call the former from st_op_enabled_on_enter().  All we need to do
is to send the value that was configured before, per-timeslot power
reduction limits remain and need not to be updated.

Take a chance to move logging from BTS specific to the generic code.

Change-Id: Ic3f8a2ab0ffd049a8ed84361a3a588c1e1b23ac6
Related: SYS#6435
2023-04-28 18:05:37 +07:00
Vadim Yanitskiy 05e2deb49c bootstrap_rsl(): cosmetic: cache trx->bts and use it directly
Change-Id: I736ebf185028976dad5ff6f61386b6d2eeab8fbd
Related: SYS#6435
2023-04-28 02:21:20 +07:00
Vadim Yanitskiy 253f67f625 struct gsm_bts_model: rename power_ctrl_{set->send}_c0_power_red
Change-Id: I13d9e6ea2a2b7b11f92532d377e71f0e83974622
Related: SYS#6435
2023-04-28 02:19:44 +07:00
Vadim Yanitskiy 856c6dc2f5 bts_is_online(): make the BTS pointer const, return bool
Change-Id: Idb4f9f8862041c5902df0e6e8d1ac2a60ada95df
2023-04-28 02:19:44 +07:00
Matan Perelman 1619a82825 ctrl: Remove dots from OOM
Change-Id: Ic2c6a052a9f9dcdca225225b38eb0ebdd05ac959
2023-04-25 15:52:09 +03:00
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