Commit Graph

6994 Commits

Author SHA1 Message Date
Oliver Smith 3f1f857378 debian: create -doc subpackage with pdf manuals
I have verified, that the resulting debian packages build in my own OBS
namespace (see the -doc packages):
https://download.opensuse.org/repositories/home:/osmith42/Debian_9.0/all/
https://build.opensuse.org/project/show/home:osmith42

Depends: Ib7251cca9116151e473798879375cd5eb48ff3ad (osmo-ci)
Related: OS#3899
Change-Id: I8dfb5658e567978aa8fe82f45d8287dbd1df969c
2019-05-29 12:14:07 +02:00
Harald Welte 052ab5ed3f rx_fail_evt_rep(): Don't recycle variable
the 'p_val' variable should represent he 'probabl cause value' and
nothing else.  Let's use other local variables for other things.

Change-Id: Ie79279fc1d42cd57e7478820493b250fe38c2f4f
2019-05-26 09:30:00 +00:00
Harald Welte 1540025181 Allow VTY to set the CCCH Load Indication Threshold
Add a new VTY command "ccch load-indication-threshold <0-100>"
by which the user can configure the threshold after which the BTS
shall send CCCH LOAD IND.  It used to be hard-coded to a
default value of 10.

Change-Id: I059fe4627438e26a06e00d84e342b736ab7af440
2019-05-26 09:10:32 +00:00
Harald Welte aae00e4255 vty: Dump per-bts stat_item group in 'show bts' output
Change-Id: Ie56d3f0951b56d9b3677bf8cc725ac777d9aa446
2019-05-24 09:12:57 +00:00
Harald Welte be86caacdf keep per-BTS stat_items about RACH busy / RACH access percentage
Change-Id: I3ad0cc4866d6210181cbafbab876e8028ad27540
2019-05-24 09:12:57 +00:00
Harald Welte 744886ae96 chan_alloc: Don't include CBCH channels in load computation
When displaying the channel (lchan) load, we are interested in the
dedicated channels as available for communication with mobile
stations.  If CBCH is enabled, it "steals" one of the SDCCH slots,
so we have to exclude this channel from the count of available
dedicated channels.

Before this patch, A CBCH would show up as "in use" dedicated channel
(so both the total and the in_use count were incremented).

After this patch, neither "total" nor "use" are affected; The CBCH
slot is completely excluded from load statistics.

Change-Id: I606962e4977f122ff05a2d4e756c04c7f38bdaa0
2019-05-24 09:12:57 +00:00
Harald Welte 228daade29 smscb: Allow transmit of SCHEDULE and DEFAULT SMSCB
Change-Id: Iad41d24c87d091b8eb144544802d44def925ca70
2019-05-24 09:12:57 +00:00
Harald Welte 112467586d abis_rsl: Fix log message about unimplemented common channel msg
The log is about an unimplemented CChan message, not a TRX message.

Change-Id: I52bcf1fd79417ee5bfb054456a0b427e174114dd
2019-05-24 08:51:43 +00:00
Harald Welte c9dc25bee9 abis_rsl: Avoid "Unimplemented" log message for every CBCH LOAD IND
Now that OsmoBTS is generating CBCH LOAD IND messages, let's avoid
spamming the BSC log with notices about receiving this unimplemented
message.

Change-Id: Ida5045ec7a18c1062a3b80a381db52d5c98e9966
2019-05-24 10:50:10 +02:00
Harald Welte ae46685a63 abis_rsl: Add support for extended CBCH to rsl_sms_cb_command()
Now that OsmoBTS understands about extended CBCH, let's at least
update the BSC side function to allow for other code to generate
such messages.

Change-Id: I77a16b75ce311d63fb022475c8ff25fbbcee7f55
2019-05-24 10:46:37 +02:00
Pau Espin 46b1c81c19 lcls: Fix MDCX with garbage on LCLS loop break
Commit c997ceb750 which added initial code
did use memset(0) on the structure. However, later commit
b407a8aca4 modifying the code forgot to
initialize it, and as a result most of its fields contain garbage.

This results in an MDCX with strange/incorrect values sent when LCLS
loop breaks, breaking TTCN3 test BSC_Tests_LCLS.TC_lcls_connect_break.

Change-Id: Ib1a7d825690db782a5d14f2d8817acf6cb6a52ea
2019-05-23 16:32:22 +02:00
Pau Espin 6de754cdde bssap: Feed Assign Complete with Osmux CID retrieved from MGW
The CID is sent back to the MSC so it can configure its MGW to send
Osmux frames to the BSC MGW using this CID.

Change-Id: I77dfdd965ae828c39a9818669177aefd22bc02f2
2019-05-19 22:36:18 +00:00
Pau Espin 83c0f76d21 bssap: Parse Osmux CID on BSSAP Assign Req recv and use it in MGCP
The Osmux CID obtained from the MSC is passed to the co-located BSC MGW
to configure the MSC-side MGW conn of a call leg.

Depends on: osmo-mgw.git I73b4c62baf39050da81d65553cbea07bc51163de
Change-Id: I86e7e13fc7921e3209fb764c0e7797e7ec09b79e
2019-05-19 22:36:18 +00:00
Pau Espin 4dc9559728 bssap: Announce Osmux support on RESET (ACK) send
Related: OS#2551
Depends on: libosmocore I28f83e2e32b9533c99e65ccc1562900ac2aec74e
Change-Id: I6b5b475b6109a2882051445762e27046d015b770
2019-05-19 07:26:28 +00:00
Pau Espin a94907ec06 bssap: Detect MSC Osmux support on RESET (ACK) recv
Related: OS#2551
Depends on: libosmocore I28f83e2e32b9533c99e65ccc1562900ac2aec74e
Change-Id: I830e38cc1ffb8b6ebbe299567507160f19beb528
2019-05-19 07:26:28 +00:00
Pau Espin 6c548dc615 vty: Add option to enable osmux towards MSC
Change-Id: I30c485c022f2d55e0a004f69b2503da7f91ecb74
2019-05-19 07:26:28 +00:00
Harald Welte bad82d31a9 Make sure to default to AMR octet-aligned mode
In Change-Id If6d40b2407b87aad2227ea7f15533ef01a3771b3 we introduced
the support for both octet-aligned and bandwidth-efficient mode, and
added a related VTY option about it.

However, we accidentially also changed the default behavior.  Without
any explicit configuration, we should behave just like we behaved all
those years before: Continue with octet-aligned mode.

Change-Id: I8b6fd8bec05b35d84ad16275d84f9d363e238d2b
Closes: OS#4002
2019-05-15 14:59:24 +02:00
Vadim Yanitskiy 13245d98c2 handover_fsm.c: fix: prevent possible buffer overflow
Change-Id: If51f8f82d3b2462cb7d7a531fe4411509344842b
Fixes: CID#197643
2019-05-07 06:30:46 +00:00
Neels Hofmeyr a77798f681 abis_rsl.c: missing newlines on log lines
Change-Id: Ic8885ca75ff23e4813a133f8fe34b7e67a1bc3e3
2019-05-06 23:41:50 +02:00
Neels Hofmeyr 67f9fd5526 fix inter-BSC-HO-incoming for AoIP (2/2)
For AoIP, the AoIP Transport Layer Address IE must be included in the Handover
Request Acknowledge message, so the MSC can send RTP to the right place. Add
this IE for AoIP.

Depends: Ia71542ea37d4fd2c9fb9b40357db7aeb111ec576 (libosmocore)
Depends: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore)
Change-Id: Ia05e37da125eb6e7b7be9b974b73261bd72de1f4
2019-05-05 13:27:25 +02:00
Neels Hofmeyr 5a06da1a95 fix inter-BSC-HO-incoming for AoIP (1/2)
Move the HO_ST_WAIT_MGW_ENDPOINT_TO_MSC state up to right after the lchan is
done establishing. For AoIP, the local RTP address towards the MSC already
needs to be known before the Handover Request Acknowledge is sent, so the AoIP
Transport Layer Address IE can be included. This patch only modifies the
handover FSM, a subsequent patch adds the IE.

Change-Id: I00c18b78573386145af71c4b39f7f22aec24579b
2019-05-05 13:27:25 +02:00
Sylvain Munaut aa82492ad6 assignment_fsm: Properly support assigning signalling mode TCH/x
To support the 3 possible preferences, the changes needed were:
 - Replace 'full_rate' bool with a 3 option enum to represent
   the channels types for signalling
 - Switch from _pref/_alt to using an array sorted in preference
   order

Originally merged as Change-Id I4c7499c8c866ea3ff7b1327edb3615d003d927d3,
reverted because the change broke voice calls. Re-submitting with the fix:
don't forget to set conn->assignment.requires_voice_stream.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I7513d2cbe8b695ba6f031ad11560c63a6535cf2d
2019-05-03 16:10:33 +02:00
Neels Hofmeyr f14aaa4ba1 move mgw endpoint FSM to osmo-mgw.git
osmo-mgw.git also includes fixes of the MGW endpoint FSM, for example
I92a9944acc96398acd6649f9c3c5badec5dd6dcc.

Depends: I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw)
Change-Id: I03e6b48d9b0a5370310d5f56809259ff7909cf9d
2019-04-30 02:24:18 +02:00
Neels Hofmeyr a6078fe1d8 use libosmocore osmo_tdef
Move the T_defs API to libosmocore as osmo_tdefs: remove the local T_defs API
and use libosmocore's osmo_tdef* API instead.

The root reason is moving the mgw_endpoint_fsm to libosmo-mgcp-client to be
able to use it in osmo-msc for inter-MSC handover.

When adding osmo_tdef, the new concept of timer groups was added to the API. It
would make sense to apply group names here as well, but do not modify the VTY
configuration for timers. The future might bring separate groups (or not).

Depends: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5 (libosmocore)
Change-Id: I66674a5d8403d820038762888c846bae10ceac58
2019-04-23 21:57:44 +02:00
Daniel Willmann 62f3b302b0 Revert "fix inter-BSC-HO-incoming for AoIP (1/2)"
This reverts commit 94c9324fe0.
Multiple ttcn3 handover tests were broken due to this commit. Let's
merge this once all the other commits pertaining to that fix can be
merged as well.

Fixes: OS#3942
Change-Id: I01d93778fb19c601c21f99ec4d2a3ab8a4a48f67
2019-04-19 10:31:11 +02:00
Daniel Willmann 1d5eda4b4c gsm_data.h: Remove unused variable from OpenBSC times
This variable does not seem to be used anywere in OsmoBSC, seems to be a
remnant from OpenBSC times.

Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb
2019-04-17 16:01:11 +00:00
Daniel Willmann 2dcdf44338 Change comments/strings from OpenBSC to OsmoBSC
Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1
2019-04-17 16:01:11 +00:00
Daniel Willmann 803a4dc76c manuals: Fix example config to reflect OsmoBSC commands
Change-Id: Ic38eec67a2cbbef57d1d6349f08249ec20ff7e8c
Related: OS#2299
2019-04-17 16:01:11 +00:00
Daniel Willmann f2572c4ff4 doc: Add generic counter chapter in manual
Depends: I01b8529136450cb50e48b0fb5c17cb2daa5e24c3 (osmo-gsm-manuals)
Change-Id: Ida53d79787aedc5b37a68e6795a863cb0b4a343a
2019-04-17 16:01:11 +00:00
Pau Espin d46a7a0f2a Drop unused old osmux leftover code
Let's better clean up old stuff before doing new implementation.

Change-Id: Id4e254a1c24831afaba9ab7b330d4e09a2474c8e
2019-04-15 20:36:48 +02:00
Neels Hofmeyr 94c9324fe0 fix inter-BSC-HO-incoming for AoIP (1/2)
Move the HO_ST_WAIT_MGW_ENDPOINT_TO_MSC state up to right after the lchan is
done establishing. For AoIP, the local RTP address towards the MSC already
needs to be known before the Handover Request Acknowledge is sent, so the AoIP
Transport Layer Address IE can be included. This patch only modifies the
handover FSM, a subsequent patch adds the IE.

Change-Id: I4a5acdb2d4a0b947cc0c62067a67be88a3d467ff
2019-04-08 16:26:28 +02:00
Neels Hofmeyr c15f6cd640 Handover Request: also parse Chosen Algorithm IE, pass to lchan activation
During inter-BSC-incoming, the MSC sends the chosen encryption algorithm in the
Handover Request message. Actually parse this Chosen Encryption Algorithm IE.

Place the chosen algorithm and the CK into lchan_activate_info->encr so that
the new lchan will use the same ciphering on this new BSS as it did on the old
BSS.

Change-Id: I5b269f50bd2092516bfdf87746196983d3ac49d1
2019-04-08 16:26:28 +02:00
Neels Hofmeyr 58cf1b1f66 lchan activation: add explicit encryption info to activation
For intra-BSC handover, the previous encryption is copied from the old lchan,
which of course is not available during inter-BSC handover.  Hence the lchan
activation info needs to include an explicit encryption information, and we
must not rely on the presence of the previous lchan to copy encryption
information from.

Add struct lchan_activate_info.encr to allow passing encryption info through
lchan_activate() without requiring a previous struct gsm_lchan to be present.

Instead of copying from the old lchan, always copy encryption info to
lchan_activate_info, and during activation, just before sending the Channel
Activation, copy the lchan_activate_info.encr to the new lchan.

This prepares for upcoming I5b269f50bd2092516bfdf87746196983d3ac49d1 which
obtains the encryption information from an intra-BSC-incoming Handover Request
message.

Related: OS#3842
Related: I5b269f50bd2092516bfdf87746196983d3ac49d1
Change-Id: Ib3d259a5711add65ab7298bfa3977855a17a1642
2019-04-08 16:26:28 +02:00
Vadim Yanitskiy e94ce889f0 ipaccess-config: use POSIX regex for Unit ID format check
Instead of counting digits and slashes of the IPA Unit ID manually,
use POSIX regex functions, so the code is easier to maintain and
read. As a bonus, this fixes CID#188854: variable 'remain_slash'
was of type 'uint8_t', so it could never be lower than zero.

Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1
Related: CID#188854 Unsigned integer overflow
2019-04-08 07:30:45 +00:00
Vadim Yanitskiy c53ca91594 osmo_bsc_lcls.c: cosmetic: make Coverity happy
The 'return' that makes Coverity angry can be safely replaced by 'break'.

Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556
Fixes: CID#188873 Identical code for different branches
Fixes: CID#188850 Identical code for different branches
Fixes: CID#188845 Identical code for different branches
2019-04-08 07:30:41 +00:00
Vadim Yanitskiy e6ab8c1bc7 gsm_data.c: use REG_NOSUB flag of regcomp()
We don't need to know position of matches: just yes or no.
This change would save some computation power.

Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b
2019-04-07 00:34:23 +07:00
Vadim Yanitskiy ac88f5a5c9 abis_nm.c: fix broken logging in abis_nm_rx_ipacc()
Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef
2019-04-04 21:18:06 +07:00
Vadim Yanitskiy a8a1b148dc abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magic
Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b
2019-04-04 20:50:01 +07:00
Vadim Yanitskiy a388d64d02 abis_nm.c: use abis_nm_ipa_magic from libosmocore
Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1
2019-04-04 20:40:14 +07:00
Vadim Yanitskiy ac6ca52d77 abis_nm.c: also print TRX number in abis_nm_get_attr()
Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862
2019-04-04 20:27:46 +07:00
Vadim Yanitskiy c40bf9b44f abis_nm.c: use proper format specifiers for BTS / TRX number
Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e
2019-04-04 20:15:48 +07:00
Max 85e29892e9 nanobts: use libosmocore's osmo_store*() for OML attr. patching
This slightly simplifies things by making endianness more obvious and
removing abstraction.

Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
2019-03-27 12:26:32 +00:00
Philipp Maier 023fc49ed6 osmo_bsc_bssap: check bssmap length field
At the moment the length field of the bssmap header is not parsed.
Instead the length is computed out of the known header length and the
number of bytes received. This is prone to error, lets make sure that
extranous data at the end of a message is ignored by parsing the bssmap
length correctly.

Change-Id: Idef2e783d2377a2ad1f697ea4d26491a32b3e549
Related: OS#3806
2019-03-27 08:01:38 +00:00
Neels Hofmeyr e51a0b53fc avoid use-after-free: on MGW endpoint dealloc, also forget it in conn->ho.*
With the FORGET_MGW_ENDPOINT event, the MGW endpoint FSM notifies the gscon
that it has deallocated and that hence the gscon should forget all references
to it (to avoid a use-after-free).

Also do this for the endpoint FSM and endpoint ci pointers in the conn->ho.*
sub struct.

I saw a use-after-free after a Handover Failure message tears down the lchan
and MGW endpoint before triggering the handover_fsm.c cleanup code, which also
tries to clean up an endpoint CI if it was created for the failed Handover.

Change-Id: I6702ccd0df44bea5eb8b26d471d7903c24e6e30b
2019-03-24 16:41:57 +00:00
Philipp Maier e605097506 lchan_fsm: add missing header file.
The symbol GSM0808_SC_CFG_AMR_4_75_5_90_7_40_12_20 is used in
lchan_fsm.c, but gsm_08_08.h, where the symbol is declared is not
included.

Change-Id: I46f910b3e0f2c7d8c78c1681acef30b9419e39f0
2019-03-19 18:38:59 +01:00
Philipp Maier 0d9a1a7583 AMR: Signal usage of octet-aligned or bandwith-efficient mode to MSC
MGCP/SDP provides fmtp parameters in order to signal which of the two
available AMR framing modes (octet-aligned or bandwith-efficient) should
be used on the link between BSS and core network. osmo-bsc currently
does not set up this mode which means that the RTP packets from the BTS
are forwared without inspection/modification, which may lead to
malfunction when a BTS is using a framing mode that is not supported by
the other end.

- Add VTY option to setup the framing mode
- Generate related fmtp parameters in SDP

Depends: osmo-mgw I622c01874b25f5049d4f59eb8157e0ea3cbe16ba
Change-Id: If6d40b2407b87aad2227ea7f15533ef01a3771b3
Related OS#3807
2019-03-19 13:57:20 +00:00
Harald Welte 69b04a29be OML: Fix encoded length value of OML GET ATTRIBUTES
Before this patch, all OML GET ATTRIBUTES messages were encoded with
an erroneous OML header length value.  The length value was always three
bytes less than the actual message length.  This patch fixes the
problem.

Change-Id: I56068de0bb14a99ec39be587e542e27cddb7d1df
Closes: OS#3799
2019-03-19 13:44:12 +00:00
Philipp Maier fc09a7c010 lchan_fsm: do not include 12.2k in active set on HR channels
When "Config-NB-Code = 1" is set via the S-bits, then the resulting
multirate configuration IE will contain 12.2K. Since the generator
function is not aware if the lchan is activated for HR or FR it sets the
flag for 12.2k always.

We have to add a check here in order to set the 12.2k flag in the IE
back to 0 so that the active set contains a set of useable rates.

Change-Id: I40e7f568f4822040a2d1e78f22dbba0e49d0167e
Related: SYS#4470
2019-03-19 13:29:10 +00:00
Philipp Maier 0e5a3c5ffd lchan_fsm: make sure multi rate configuration is valid
When gsm48_mr_cfg_from_gsm0808_sc_cfg() is used to generate the AMR
multirate configuration IE, make sure that lchan allocation fails in
cases where the multirate configuration IE can not be generated.

Change-Id: Icd3e5674b10b8ae223c0d13ae33fc9ae7e8a8a18
Depends: libosmocore I6fd7f4073b84093742c322752f2fd878d1071e15
Related: SYS#4470
2019-03-19 13:29:10 +00:00
Philipp Maier cf5d0c7f63 codec_pref: fix special handling for AMR rate configuration (S15-S0)
When match_codec_pref() is called and the codec selections from the
ASSIGNMENT COMMAND are matched against the interal capabilities, the
configurations are checked one by one. When a match is found that match
is returned.

However, the implementation currently does not check the AMR S15-S0 bits
when the actual matching happens. This is done afterwards in case AMR
gets picked. Unfortunately if the MSC implementation is not obeying the
settings the MSC has previously communicated in the L3 COMPL message we
may end up with an S15-S0 configuration that has all rate selection
(which eventually end up as active set in RSL) bits set to zero. This is
an invalid configuration and should be prevented. Also the handling of
the S15-S0 bits should happen as part of the matching so that there is a
chance to try the nect codec in the list if AMR is unuseable.

Also S15-S0 has one special setting "Config-NB-Code = 1" (S1 = 1). When
this bit is set, the four (in HR only three) most common rates are
selected into the active set. If there are also other S-bits set besides
S1 we should prefer S1 and discard the other bits.

- Perform handling of S15-S0 while matching
- If S1 is set, prefer this setting and discard all other settings

Change-Id: Ie52376b51fe07ed07056e8df2e9557293ff67a78
Related: SYS#4470
2019-03-19 13:29:10 +00:00