Commit Graph

7299 Commits

Author SHA1 Message Date
Philipp Maier be027ad003 abis_rsl: prioritize emergency calls over regular calls
when an emergency call arrives while all TCH are busy, the BSC should
pick an arbitrary (preferably the longest lasting) call / lchan and
release it in favor of the incoming emergancy call.

The release of the existing call is a process that can not be done
synchronously while the ChanRQD is handled sonce multiple messages are
exchanged between BTS and MSC and multiple FSMs need to do their work.

To be able to release one lchan while handling a ChanRQD a queue is
implemented in which the incomming channel requests are collected. The
queue is checked regulary for incoming requests. If one of the requests
is for an emergency call and if all channels are busy one channel is
picked and released. It is also made sure that the incoming emergency
call directly gets the TCH that was just released.

Change-Id: If8651265928797dbda9f528b544931dcfa4a0b36
Related: OS#4549
2020-08-31 09:36:55 +02:00
Philipp Maier 43a00c945b lchan_fsm: make rsl mode-modify working again
osmo-nitb supports the modification of an lchan if the lchan is
compatible but in the wrong mode. This feature was dropped in the
transition to AoIP/bsc-split. However, osmo-bsc still has code to
generate and parse the messages, but the FSMs do not support a mode
modify yet

Lets add handling for mode-modify to the lchan_fsm and assignment_fsm in
order to support mode modify again

Change-Id: I2c5a283b1ee33745cc1fcfcc09a0f9382224e2eb
Related: OS#4549
2020-08-31 09:36:51 +02:00
Philipp Maier 83c2e06be0 lchan_fsm: make internal functions static.
The functions lchan_fsm_allstate_action, lchan_fsm_allstate_action and
lchan_fsm_cleanup are only used internally in lchan_fsm.c, lets make
them static

Change-Id: If1ceb69d14a7840e1f753b0dd911726257125e99
2020-08-21 15:20:46 +02:00
Philipp Maier fdf45b47e4 lchan_fsm: merge lchan_mr_config()
There are some preperations and checks done before calling
lchan_mr_config(), those checks could also be done from inside
lchan_mr_config(), so lets merge them into lchan_mr_config()

Change-Id: I068aadda53b2c3a85ed4fb1e513b17bf9870bd50
2020-08-21 15:15:15 +02:00
Daniel Willmann 45062b42ce Remove punctuation in counter description
Change-Id: I304dcc9e88afc5e607d5b010df3e95f40fb8c49b
2020-08-20 18:44:46 +02:00
Pau Espin da5b2f8094 Support setting rt-prio and cpu-affinity mask through VTY
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
Change-Id: Ie68883666657fc8faa76e2422335c0ceb98c5a88
2020-08-20 08:40:17 +00:00
Vadim Yanitskiy 6624c22d83 vty: fix copy-pasted 'no gprs control-ack-type-rach' description
Change-Id: If2538ab88d551da5167344e1a86d3a41c5d2dfdd
2020-08-18 11:50:11 +00:00
Harald Welte 210aa95d49 Implement support for receiving BSSMAP CommonID from MSC
The MSC may at any time send a BSSMAP CommonID message via a
SCCP connection to inform us of the IMSI of the subscriber.  Let's
make use of that information by associating a related bsc_subscr
and updating the identity of the bsc_subscr_conn_fsm for improved
logging / filtering.

Closes: OS#2969
Change-Id: I52c43fb940f0db796adf4c0adb2260321c721c39
2020-08-17 13:04:03 +02:00
Vadim Yanitskiy fe12b70ce5 debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: I82a5e175c6d70af1ee07521a0e17f9f5cbf300dc
2020-08-13 15:00:02 +00:00
Neels Hofmeyr 59da48609c info, error log: show MSC nr for new conn
Change-Id: I0a7e0a638515f48d49e2d2e1d905d9e574994fd5
2020-08-13 12:54:08 +00:00
Neels Hofmeyr 4829015b55 debug log: add RR Release cause code to the log
Change-Id: I53d524b5521804d80463079fa2e20221ee1b15f1
2020-08-13 12:54:08 +00:00
Neels Hofmeyr e8ec9e5e79 gscon timeout: use proper cause code for lchan release
Since we verify the cause code of the RSL channel release in ttcn3-bsc-tests,
BSC_Tests.TC_chan_act_ack_est_ind_noreply shows an invalid release cause code
of 127. Fix that.

On gscon timeout, don't send the unrelated RSL code RSL_ERR_INTERWORKING, but a
proper RR cause code. GSM48_RR_CAUSE_ABNORMAL_TIMER is defined as the proper
cause for an expired timer (3GPP TS 44.018 10.5.2.31).

Should fix this error in BSC_Tests.TC_chan_act_ack_est_ind_noreply:

  BSC_Tests.ttcn:1590 Dynamic test case error: Assigning invalid numeric value 127 to a variable of enumerated type @GSM_RR_Types.RR_Cause.

Change-Id: Ic2e4b692e78f7b134fe57d1077a08adb48398e06
2020-08-13 12:31:51 +00:00
Neels Hofmeyr 6a67fa589c cosmetic: bscon: use GSM48_RR_CAUSE_NORMAL instead of 0
Change-Id: Ia0e23bbc5506e9be3e0682c4dab5b9ecb91cf477
2020-08-13 12:31:51 +00:00
Philipp Maier f954e35464 abis_rsl.c: make sure emergency calls are rejected early
If a CHAN RQD indicates an emergency call on a BTS that does not allow
emergency calls, then respond with an IMMEDIAGE ASSIGNMENT REJECT
message to deny the emergency call early.

Related: OS#4548
Change-Id: I148c540269bffd703f38233a1e689e863c175e97
2020-08-12 19:02:11 +00:00
Alexander Chemeris abf03a1d64 timeslot_fsm: Name TS FSM instances on allocation.
Before this patch FSM instances of configured but not connected BTS's
look like this:
FSM Instance Name: 'timeslot[0x612000004a20]', ID: '(null)'
 Log-Level: 'DEBUG', State: 'NOT_INITIALIZED'

Now they look like this:
FSM Instance Name: 'timeslot(0-0-7-NONE)[0x612000004a20]', ID: '0-0-7-NONE'
 Log-Level: 'DEBUG', State: 'NOT_INITIALIZED'

which makes it possible to attribute them to where they belong.
Otherwise, they look like lingering or leaking unattributed FSM
instances.

Change-Id: Idc74ea142b96323b48826f8a52e13e45d535512a
2020-08-12 18:38:18 +00:00
Alexander Chemeris 29993a9138 chan_alloc: Fix typo in a comment.
Change-Id: Iaed3fcd99ec8c08faa75e23af5b50a1d0e0905eb
2020-08-12 18:38:06 +00:00
Alexander Chemeris ca3b18c4c7 paging: Remove obsolete comment.
I beleive MSC split is finished a long time ago and everything is
already re-wired for the A-interface.

Change-Id: If2a0b15e360c44abc92fdeb9004be7ccc0537cdd
2020-08-12 18:37:55 +00:00
Philipp Maier e8296d285b gsm_04_08_rr: block EMERGENCY SETUP when EMERGENCY CALLS are denied
If the BSC configuration is set up to deny emergency calls, make sure
that an EMERGENCY SETUP will not be passed to the MSC, instead ensure
that the call is released.

Change-Id: Ia6eb38370ce4165d221d2ffbe1cd105c0628313c
Related: OS#4548
2020-08-12 18:07:33 +00:00
Philipp Maier a7f02c6899 e1: encode line number as trunk number in MGCP endpoint
The MGCP endpoint name, that is generated when an E1 endpoint is
selected does have a hardcoded trunk id number, which is permanantly set
to 1. Lets use the E1 line number instead.

Related: OS#2547
Change-Id: Ic5447bb4426e31d119667bdfddfd2c91fd591fc6
2020-08-12 10:21:29 +00:00
Vadim Yanitskiy 6728085988 vty: allow enabling freq. hopping regardless of the feature vector
The hard-coded per-BTS feature vector for osmo-bts currently lacks
BTS_FEAT_HOPPING, and this is unlikely to change, because only the
recent osmo-bts-trx does support freq. hopping, while the other
(DSP based) back-ends do not seem to be capable of doing it.

Let's allow enabling freq. hopping regardless of the feature vector,
so either it would work if it's supported, or the BTS would reject
Set Channel Attributes message by sending NACK on the A-bis/OML.

Change-Id: Iff23109cacb5d314f7bcbf34b25e89af9281ce40
Related: SYS#4868, OS#4546
2020-08-11 06:33:28 +00:00
Vadim Yanitskiy f1d4f366d6 vty: introduce and use GPRS_CHECK_ENABLED() macro
Change-Id: I39907a569e80344fc73596bea32a1b474ec720e0
2020-08-11 06:33:28 +00:00
Vadim Yanitskiy 5e465d52cf vty: fix missing comma in a warning message
Change-Id: I4219bff4286ddff3339d5da40b11ee360c239358
2020-08-11 06:33:28 +00:00
Vadim Yanitskiy 9c0b6ba73a vty: ensure that all warning messages are prefixed with '%%'
Change-Id: I6f2348c481ed43904d05b42fd7d5ce04dedbf46b
2020-08-11 06:33:28 +00:00
Neels Hofmeyr bd6a4c3e40 hodec2: log requirements of best candidate, log rxlev in dBm
Instead of logging a hex value for the met requirements, fully expand the "ABC"
flags for both TCH/F and TCH/H.

From HO_CANDIDATE_FMT/_ARGS, split off into REQUIREMENTS_FMT/_ARGS and use that
when logging the chosen HO candidates.

Also change the RX level to dBm, to match general logging and reduce confusion
between rxlev number variants in the log.

Change-Id: I1b30a6e98bdb4bd92e72864fafdd2f4f3ae3134c
2020-08-10 21:25:57 +02:00
Neels Hofmeyr 9ed0d17d53 hodec2: do not keep candidates with zero requirements met
When check_requirements() returns zero, do not keep such an entry in the
candidates list at all. This removes logging confusion, where some "candidates"
are still listed even though not meeting any handover requirements.

Change-Id: I12e48292d5731cb601165c870b9570003bc488ec
2020-08-10 21:25:57 +02:00
Neels Hofmeyr f5dab9a2c8 hodec2 congestion: consider only congested pchan types
If no TCH/H need to be moved, then don't collect TCH/H candidates.
Same for TCH/F.

Examining a specific congestion scenario, I realized that ho decision 2
collects candidates of pchan types that are not actually considered congested:

- handover decision 2 wants to move 2 TCH/F only; TCH/H is fine.
- still it collects active TCH/H lchans as candidates.

  (BTS 0) Congestion check: (free/want-free) TCH/F=0/2 TCH/H=12/0
  (BTS 0) Attempting to resolve congestion...
  (BTS 0) congested: 2 TCH/F and 0 TCH/H should be moved
  [...]
  (BTS 0) Considering 8 candidates to solve congestion:
  (lchan 0.020 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #0: req=0x0 avg-rxlev=42
  (lchan 0.030 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #1: req=0x0 avg-rxlev=42
  (lchan 0.040 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #2: req=0x0 avg-rxlev=42
  (lchan 0.050 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #3: req=0x0 avg-rxlev=42
  (lchan 0.160 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #4: req=0x0 avg-rxlev=42
  (lchan 0.161 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #5: req=0x0 avg-rxlev=42
  (lchan 0.170 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #6: req=0x0 avg-rxlev=42
  (lchan 0.171 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #7: req=0x0 avg-rxlev=42

Change-Id: I5077a62c6d77838513eecf3f0e4810c3d3d3a247
2020-08-10 21:25:57 +02:00
Neels Hofmeyr dfc2d84005 hodec2: fix logging of requirements flags
Fix typo to log the "C" requirements accurately.

Change-Id: I15ce607f354918167ba81192230db63a5948c742
2020-08-10 21:25:57 +02:00
Neels Hofmeyr 1336d942d8 handover_test.c: typo s/more/less in test 19 description
Change-Id: Ia46fa9bb4f340d35515168f82dd23a1270f6fcd5
2020-08-10 21:25:29 +02:00
Philipp Maier 7a11fce611 lchan_rtp_fsm: use E1 endpoints if the BTS is not ipaccess type
When the BTS is is not an ipaccess BTS, the BTS can only be an E1 bts.
In that case E1 endpoints must be used and there will be no RTP stream
setup towards the BTS.

Change-Id: I4f1f39bf90b0a7c9ea448dab255daf99cd36bb4a
Related: OS#2547
2020-08-06 15:52:16 +00:00
Philipp Maier e1ec35a1f6 lchan_rtp_fsm: make _fsm_timer_cb and _fsm_cleanup static
The functions lchan_rtp_fsm_timer_cb() and lchan_rtp_fsm_cleanup() only
used in lchan_rtp_fsm.c, lets make them static.

Change-Id: I31940aff166ccd7a9612574536674e4e483a3cb9
2020-08-03 15:13:36 +02:00
Neels Hofmeyr 7b2b4309cc handover_test.c: add test case 29: TCH/F -> TCH/H
Change-Id: I5439beec4d295a8acaa1c49a0fa575dc2f7b973d
2020-08-02 03:25:09 +02:00
Harald Welte 2428bab7c0 BS-11: Fix "CONNECT TERRESTRIAL TRAFFIC"
On a TS 12.21 spec compliant BTS, each Um traffic channel must be mapped
to an E1 sub-slot on the terrestrial back-haul.  This happens via
the CONNECT TERRESTRIAL TRAFFIC message.

We always had code to sen that message, but it got deactivated when
ts->pchan_is / ts->pchan_from_config was introduced.  Of course,
while we are bringing up OML, there is no 'pchan_is' set yet. We only
have 'pchan_from_config' and must use it.

Change-Id: I8988a027b0e897bd9dda460590f974d6be34a4fa
2020-08-01 17:13:36 +02:00
Pau Espin 1e5e7004dc Introduce support for ACC ramping during whole BTS life cycle
Prior to this patch, ACC ramping was only used to go 0->N in the
number of allowed ACCs during BTS startup. It could optionally
dynamically stretch or extend the ramping time based on channel load.

With this patch, ACC ramping is kept alive during the entire time the
BTS is active, and subset of allowed ACCs can now be incresed or
decreased based on channel load. A new VTY command
"access-control-class-ramping-chan-load" is added to configure a lower
and an upper threshold. Channel load under the low threshold will
potentially trigger an increment of the subset size of allowed ACCs,
while a channel load over the upper threshold will potentially trigger
the opposite (a decrease in size).
The time between checks is kept fixed per VTY command (reusing old
"access-control-class-ramping-step-size"), but the "dynamic" option
is deprecated and ignored from now on since it provides nothing valuable
in the new implementation, because the size always dynamically changes
based on channel load (configured thresholds).

Related: SYS#4912
Change-Id: Id17f947c92cdfc0eb9541a9bf066338169caaeb5
2020-07-31 09:56:46 +00:00
Neels Hofmeyr b764f449a2 fix CBSP server: actually open the srv_link
Change-Id: Ic688573e179381f7798055b647200e508f1bc37f
2020-07-30 14:45:48 +00:00
Harald Welte c4b25704f5 acc.c: Don't use C99 constructs, this breaks builds on Debian 8
[  160s] acc.c: In function 'get_highest_allowed_acc':
[  160s] acc.c:117:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  160s]   for (int i = 9; i >= 0; i--) {
[  160s]   ^
[  160s] acc.c:117:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
[  160s] acc.c: In function 'get_lowest_allowed_acc':
[  160s] acc.c:127:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[  160s]   for (int i = 0; i < 10; i++) {
[  160s]   ^
[  160s] Makefile:617: recipe for target 'acc.o' failed

Change-Id: I03722854634b2d6d6f1abac7c7553762b5fc6890
2020-07-30 10:40:24 +02:00
Harald Welte 981a7cc6a9 Add example config files for Ericsson DUG20 based BTS
The files have been used successfully in the past weeks to bring up a
variety of different combinations of Ericsson DUG20 + RUS.

Change-Id: I046f786d68f7cd3fd21693142bd1315bf40696f5
2020-07-30 08:38:56 +02:00
Pau Espin deaa6fd624 Introduce support for ACC subset rotation
See updated documentation section in manuals/chapters/bts.adoc regarding
an explanation on how the system works.

Related: SYS#4911
Change-Id: I952c9eeae02809c7184078c655574ec817902e06
2020-07-29 20:09:47 +00:00
Harald Welte 3e2e820d52 lchan_fsm: silently ignore LCHAN_EV_RLL_ERR_IND
The RLL ERR IND is sent by the BTS in any number of casese that lead
to a disconnect of a radio link layer, for example due to bad RF
conditions.  The lchan FSM currnently prints error messages about
this event not being permitted, leading to confusion among users.

Let's ignore this event, I don't think the lchan FSM should or could
be doing anything as a result.  We could also simply remove that event,
but let's keep it in case we should need it in the future.

Change-Id: I07aad62d25566d6068a95797915bb97fc3c66328
2020-07-26 11:59:23 +02:00
Harald Welte 2abb5067b7 debian: Package E1 configuration file examples
Change-Id: Idf06c5fa7eb0ea6b73dcc3b67718b3a0a755796f
2020-07-26 11:57:09 +02:00
Pau Espin 02f2056ccf rename files acc_ramp.* -> acc.c*
With upcoming next commit, the file will contain far more code that
simply ramping, so rename it to be more generic.

Change-Id: I8c368ab87e264439dea4ccf556821a44664cdbb0
2020-07-20 16:21:59 +02:00
Pau Espin 5487387345 {bts,bsc}.adoc: Drop deprecated OsmoNITB references
dyn_ts_allow_tch_f is also deprecated and should not be used, so drop
that too.

Change-Id: Icc91dd41a237531cb512fa36d8b18d4d8d5ca8ed
2020-07-20 14:05:01 +02:00
Pau Espin 1db53c868a doc: Copy {bsc,bts}.adoc from osmo-gsm-manuals
Those adoc files are only used by osmo-bsc.git and openbsc.git
(osmo-nitb), and the later is deprecated and no longer maintained, which
means new features are only added to BSC. Hence it makes no sense to
keep the doc shared between both.

Change-Id: I20aa60d2f4111d66e922f3e2a73a20352ec1f7e4
2020-07-20 13:12:10 +02:00
Pau Espin 911d076f0f configure.ac: Fix trailing whitespace
Change-Id: Id57b953cbeea4ac5c384c0b77cff079c13248a0e
2020-07-20 12:21:29 +02:00
Harald Welte 01eedbfd6c osmo-bsc.spec.in: Add missing directories to package
CentOS is happy with the spec file as-is, but OpenSuSE is more strict:

[   62s] osmo-bsc-1.6.0.191.bd5b-lp152.1.1.x86_64.rpm: directories not owned by a package:
[   62s]  - /usr/share/doc/packages/osmo-bsc/examples/osmo-bsc/ericsson
[   62s]  - /usr/share/doc/packages/osmo-bsc/examples/osmo-bsc/nokia
[   62s]  - /usr/share/doc/packages/osmo-bsc/examples/osmo-bsc/siemens

Change-Id: I40ad5d38b968db847cf5f733f82163ecac1151e0
2020-07-19 12:48:00 +02:00
Pau Espin bd5b92fa7d Move acc_ramp_init inside gsm_bts_alloc
The function initializes the struct owned by a bts, so it makes sense to
have it done there instead of somewhere else later.

It was most probably put in bsc_vty when it was initially introduced
because of all the data structure and object file mess I untangled
during last set of patches.

Change-Id: I66c4b208583e92070793183b83b3a7b7edf6ba00
2020-07-18 21:45:32 +00:00
Pau Espin 8d4f94a176 Move gsm_bts_{trx_}set_system_infos APIs to bts{_trx}.*
Change-Id: I2aa83b499d6e5d06a0fa1001fee3111f7e639c94
2020-07-18 21:45:32 +00:00
Pau Espin aca53203d1 Move struct gsm_bts_trx: gsm-data.* => bts_trx.*
See rant fro similar recent commit moving stuff to bts.*.

Change-Id: I11758ca3d255d849d77bd068f24bb68bde1f89a5
2020-07-18 21:45:32 +00:00
Pau Espin e2f1c95774 bts: Drop duplicated function to get trx by number
In the big mess of gsm_data we reached a point where we have multiple
functions doing the same thing, most probably because it's hard finding
stuff in there. Let's drop one of them (the one which less callers) and
move it to bts.*, where it belongs.

Change-Id: I9071a0ab250844619280fbe2be63ed99f2c87eb1
2020-07-18 21:45:32 +00:00
Pau Espin 388ed58482 Move struct gsm_bts: gsm_data.* => bts.*
Place all code related to the object into the related file.

Having all the data model in one file made sense in early stage of
development to make progress quickly, but nowadays it hurts more than
helps, due to constantly growing size and more and more bits being
added to the model, gaining in complexity.

Currently, having lots of different objects mixed up in gsm_data.h is a hole
of despair, where nobody can make any sense were to properly put new stuff
in, ending up with functions related to same object in different files
or with wrong prefixes, declarations of non-existing functions, etc.
because people cannot make up their mind on strict relation to objects
in the data model.
Splitting them in files really helps finding code operating on a
specific object and helping with logically splitting in the future.

Change-Id: I00c15f5285b5c1a0109279b7ab192d5467a04ece
2020-07-18 21:45:32 +00:00
Harald Welte 6b23d71832 osmo-bsc.spec.in: Package E1 config files
This resolves:

[  272s] error: Installed (but unpackaged) file(s) found:
[  272s]    /usr/share/doc/packages/osmo-bsc/examples/osmo-bsc/ericsson/osmo-bsc.rbs2308.cfg
[  272s]    /usr/share/doc/packages/osmo-bsc/examples/osmo-bsc/nokia/osmo-bsc.insite.cfg
[  272s]    /usr/share/doc/packages/osmo-bsc/examples/osmo-bsc/siemens/osmo-bsc.bs11.cfg

Change-Id: I07329564152d6b4314f1ed90a221478e2d765b47
2020-07-17 13:26:44 +02:00