path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-04-23use libosmocore osmo_tdefNeels Hofmeyr19-398/+87
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-19Revert "fix inter-BSC-HO-incoming for AoIP (1/2)"Daniel Willmann1-102/+81
This reverts commit 94c9324fe07cd0ba1277278270c8979d949e49ec. 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-17gsm_data.h: Remove unused variable from OpenBSC timesDaniel Willmann1-4/+0
This variable does not seem to be used anywere in OsmoBSC, seems to be a remnant from OpenBSC times. Change-Id: I5e4aa352fa5f16f6ff64738f25afd1a844fa4fcb
2019-04-17Change comments/strings from OpenBSC to OsmoBSCDaniel Willmann2-3/+3
Change-Id: I785278df411b13a701c8441fde798d4bfe79ffd1
2019-04-08fix inter-BSC-HO-incoming for AoIP (1/2)Neels Hofmeyr1-81/+102
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-08Handover Request: also parse Chosen Algorithm IE, pass to lchan activationNeels Hofmeyr1-0/+29
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-08lchan activation: add explicit encryption info to activationNeels Hofmeyr3-10/+9
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-08ipaccess-config: use POSIX regex for Unit ID format checkVadim Yanitskiy1-21/+9
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-08osmo_bsc_lcls.c: cosmetic: make Coverity happyVadim Yanitskiy1-3/+3
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-07gsm_data.c: use REG_NOSUB flag of regcomp()Vadim Yanitskiy1-1/+1
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-04abis_nm.c: fix broken logging in abis_nm_rx_ipacc()Vadim Yanitskiy1-3/+4
Change-Id: I65ff2968523a90607bafd44e6f4f3d3e29ff73ef
2019-04-04abis_nm.c: use msgb_lv_put() to put abis_nm_ipa_magicVadim Yanitskiy1-3/+2
Change-Id: I1ce97fc28a608894c8dfa3bbc55032e66bc44e5b
2019-04-04abis_nm.c: use abis_nm_ipa_magic from libosmocoreVadim Yanitskiy1-8/+4
Change-Id: I051ae0550b5375a141e1bd4b3383a54302da83e1
2019-04-04abis_nm.c: also print TRX number in abis_nm_get_attr()Vadim Yanitskiy1-1/+1
Change-Id: Ice776b1cee37acf737afb952c79eff2803e84862
2019-04-04abis_nm.c: use proper format specifiers for BTS / TRX numberVadim Yanitskiy1-6/+6
Change-Id: I429d00d1393c221070e4c9e0997cbd14ae96103e
2019-03-27nanobts: use libosmocore's osmo_store*() for OML attr. patchingMax1-12/+3
This slightly simplifies things by making endianness more obvious and removing abstraction. Change-Id: I28cfb09f224072db9889a89923a3da15a6070e2a
2019-03-27osmo_bsc_bssap: check bssmap length fieldPhilipp Maier1-1/+31
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-24avoid use-after-free: on MGW endpoint dealloc, also forget it in conn->ho.*Neels Hofmeyr1-3/+6
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-19lchan_fsm: add missing header file.Philipp Maier1-0/+1
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-19AMR: Signal usage of octet-aligned or bandwith-efficient mode to MSCPhilipp Maier2-0/+42
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-19OML: Fix encoded length value of OML GET ATTRIBUTESHarald Welte1-1/+1
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-19lchan_fsm: do not include 12.2k in active set on HR channelsPhilipp Maier1-0/+9
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-19lchan_fsm: make sure multi rate configuration is validPhilipp Maier1-1/+6
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-19codec_pref: fix special handling for AMR rate configuration (S15-S0)Philipp Maier1-29/+56
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-19osmo_bsc_msc: Use meaningful amr rate configuration on BTS levelPhilipp Maier1-18/+17
The current configuration for permitted AMR rates on BTS level has been choosen arbitrarily. Lets choose the possible rates so that they match the "Config-NB-Code = 1" as defined in 3GPP TS 28.062 Table (The current default behavior is not changed since the MSC level configuration only permits 5.90k by default.) Change-Id: I916953e3fdb54168671dd13b359e78662fa31059 Related: SYS#4470
2019-03-15fix another log line end in assignment_fsm.cPau Espin Pedrol1-1/+1
Change-Id: I3be062ad7ecb5ba801cd7412e90c4bc5bf7e367c
2019-03-14fix log line end in assignment_fsm.cNeels Hofmeyr1-1/+1
Change-Id: I4070ee9164eb161584df70ae174b538c394ab9cd
2019-03-14Revert "assignment_fsm: Properly support assigning signalling mode TCH/x"Neels Hofmeyr5-156/+124
This commit breaks voice channel assignment. It results in the Assignment Complete sent to the MSC for a voice lchan lacking AoIP Transport Layer Address, Speech Version and Speech Codec. Hence the MSC cannot complete the Assignment for a voice call. Let's revisit this patch, test thoroughly and re-merge later. This reverts commit 4d3a21269b25e7164a94fa8ce3ad67ff80904aee. Reason for revert: <INSERT REASONING HERE> Change-Id: I72aaa03539919e7e85b5b75b133326cec5e68bc9
2019-03-14src/utils/Makefile.am: Drop unneeded sigtran and mgcp-client depsPau Espin Pedrol1-3/+0
Change-Id: I1a91d673e08c161dd6110bd16e8f52cb17be398c
2019-03-14configure.ac: Add flag to enable/disable build of ipaccess related utilsPau Espin Pedrol1-1/+4
Change-Id: Iff70dc46c77b2ac58351ad9a91caf3f524c6fd89
2019-03-14net_init.c: remove unneeded headerPau Espin Pedrol1-1/+0
Change-Id: I9c2d07914bb19429bfc1f2c5a38a513749068304
2019-03-14ipaccess/Makefile.am: Remove unneeded libosmo-sigtran depPau Espin Pedrol1-2/+0
Change-Id: Idc26f178fa8942fe407ca01e23b0a21955727dca
2019-03-14Move msc related code from gsm_data to bsc_mscPau Espin Pedrol2-17/+15
This way ipaccess utils can be built without requiring libosmo-sigtran. Change-Id: I508188896be58ddc3bd4e9c3c661c258c06866f4
2019-03-14Move LCLS references from gsm_data to osmo_bsc_lclsPau Espin Pedrol2-7/+7
This commit aims at better ordering of content in order to get rid of sigtran stuff in gsm_data. This way we can avoid requiring libosmo-sigtran when building ipaccess utils. Change-Id: I8941f059d6e4eb21a971d48d2b66c29ec3355a6d
2019-03-14assignment_fsm: Properly support assigning signalling mode TCH/xSylvain Munaut5-124/+156
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 Change-Id: I4c7499c8c866ea3ff7b1327edb3615d003d927d3 Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2019-03-14log N-CONNECT from MSCNeels Hofmeyr1-0/+4
Change-Id: I83f15c7231b2b766aba4d25339d08acbbca3a47e
2019-03-14incoming connect: don't crash if calling addr is missingNeels Hofmeyr1-1/+0
The idea was to guard the logging, though actually that can handle a NULL ss7 quite well. Change-Id: Ib028432b37a5c48b677bb21b869cc722575dce92
2019-03-12ipaccess/Makefile.am: Remove unneeded libmgcp-client depPau Espin Pedrol2-3/+0
Change-Id: I3c926b088fe1b25b0f65d673465c3fa0c1d0b86f
2019-03-11handover_fsm: copy old S15_S0 to new lchanPhilipp Maier1-0/+1
When a new lchan is selected during handover, some of the properties of the old lchan are inherited by the new lchan. At the moment S15-S0 is not not inherited so that the value for those bits will always be 0x0000 for the new lchan. Since those bits also define the active set AMR codec the channel activation will fail because 0x0000 is invalid (active set with zero rates) Change-Id: Ifd470397e99985394634da1bb13ccfc5041984d2 Related: OS#3503
2019-03-08assignment_fsm: use activate.info.s15_s0 for ASS. COMPL.Philipp Maier1-1/+1
When the ASSIGNMENT COMPLETE message is composed, lchan->ch_mode_rate.s15_s0 is used to fill in the S15-S0 which are returned to the MSC. This is not correct since the assignment process may involve multiple lchans, so that at the point where the ASSIGNMENT COMPLETE is generate, the stored S15-S0 may be lost already because the lchan has changed. To prevent this, we must use lchan->activate.info.s15_s0, which is retained throught lchan changes. Change-Id: I9a7b3ce8646d641569eac24e202f44cdb5f67b3d Related: OS#3503
2019-02-21assignment_fsm: fix channel allocator preferencesPhilipp Maier5-103/+292
When the MSC allocates a channel through the ASSIGNMENT REQUEST, it may ask for a TCH/H and a TCH/F at the same time and tell which of the two types it prefers. The process of channel allocation currently selects, based on the BTS, MSC and MS capabilites exactly one apropriate codec/rate (e.g. TCH/H) and then tries to allocate it. If that allocation fails, there is no way to try the second choice and the assignment fails. For example: The MSC asks for TCH/F and TCH/H, prefering TCH/F, then the channel allocator will try TCH/F and if it fails (all TCH/F are currently in use), then TCH/H is never tried. Since the BSC currently only trys the first best codec/rate that is supported it also ignores the preference. Lets fix those problems by including the preference information and both possible codec/rate settings into the channel allocation decision. Change-Id: I5239e05c1cfbcb8af28f43373a58fa6c2d216c51 Related: OS#3503
2019-02-07bsc_vty: add features to disable specific lchans via vtyPhilipp Maier2-0/+48
In some test and debug situations it is useful to have the ability to lock certain lchans in a way that the BSC can not allocate them. One application might be to simulate an exhaustion of all TCH/H channels in order to force the BSC to take one of the available TCH/F. Lets add a command to the vty which alloes us sen lchans from LCHAN_ST_UNUSED to LCHAN_ST_BORKEN and vice versa. Change-Id: I397e68e26d6a1727890353fa34f4897b54795866 Related: OS#3503
2019-02-06handover_fsm: do not access conn->assignment.req, it may be outdatedNeels Hofmeyr2-1/+2
handover_fsm.c accesses conn->assignment.req.s15_s0 to find out the current lchan's AMR configuration. However, conn->assignment.* values are only valid during an ongoing assignment. Those values may be overwritten by any failed Assignment attempt, at any time, and hence do not reflect the currently assigned conn->lchan. Those realms must be kept separate. The assignment.req.s15_s0 get passed to lchan_activate(), so it makes most sense to store these values in struct gsm_lchan once the lchan activation succeeded. Add gsm_lchan.s15_s0, store the s15_s0 received in lchan_activate_info during lchan_activate(). In handover_fsm.c, use conn->lchan->s15_s0 instead of conn->assignment.*. Change-Id: Id8018fd9d56421f2ab7be91703018f6d6f21c929
2019-02-05Implement CSFB "Fast Return" Handling at RR RELEASEHarald Welte3-1/+86
When the MSC sends a BSSMAP CLEAR CMD containing a CSFB Indication IE, it lets us know that the to-be-released connection related to a CSFB call. We as the BSC then subsequently should include the "Cell Selection Indicator after release of all TCH and SDCCH" IE in the RR RELEASE message sent to the MS/UE. This IE contains the LTE neighbor cells that we're configured to broadcast in si2quater. That in turn will make sure the MS/UE can return very quickly to the LTE cell. Closes: OS#3777 Change-Id: Ibfbb87e2e16b05032ad1cb91c11fad1b2f76d755 Requires: libosmocore Id4bd7f7543f5b0f4f6f876e283bd065039c37646 Requires: libosmocore I0e101af316438b56d63d43fc2cb16d7caf563d07 Requires: libosmocore I8980a6b6d1973b67a2d9ad411c878d956fb428d1
2019-02-05gsm_data: Add gsm_bts_name() just like we have gsm_{trx,ts,lchan}_name()Harald Welte1-0/+10
Change-Id: Icd7fd6273396026c5fe2da600f35631b1bac1614
2019-01-31bsc_vty: add vty command to display all lchansPhilipp Maier1-14/+29
Currently the VTY only displays the lchans that are currently in use (show lchan summary). In some situations (debugging) it can be useful to list all lchans, regardless of their state. So lets add a command for that. Change-Id: Ie4d763476905fa8f84b4d7cdad4cc7dd879f84a5 Related: OS#3503
2019-01-28LCLS: use libosmocore function to add statusMax2-39/+4
* use gsm0808_create_ass_compl2() to add BSS Status IE to Assignment Complete message * drop local helpers Depends-on: (libosmocore) I547c6b8707123aa8c1ef636db88908df112d90a4 Change-Id: I6916928391667cd9c345becf00e7c8561846c295 Related: OS#2487
2019-01-22abis_rsl: Fix TCH-as-SDCCH allocation on Channel RequestNeels Hofmeyr1-14/+4
On rsl_rx_chan_rqd(), so far osmo-bsc tried to preferably assign the lchan type that was asked for in the RACH. Firstly, this contained a bug, and secondly, it does not make sense to heed that preference, since we do late assignment. Ignore the preference for the MS' TCH kind. We do late assignment to avoid codec mismatches. In the "old days", we would heed the MS' TCH channel kind, even if the MSC or BSC didn't actually allow or prefer that channel kind. Hence, in the presence of both TCH/F and TCH/H, the MS could ask for TCH/F (which we would grant on the MO side) and the BSC or MSC could prefer TCH/H (which we would apply on the MT side), and hence fabricate a codec mismatch. Instead, since quite some time now, we *always* assign an SDCCH first, and only later on do another Assignment to hand out a proper voice lchan that heeds the MS capability bits as well as MSC's and BSC's preferences. By completely ignoring the channel kind the MS asked for in the RACH, we also eliminate this bug in rsl_rx_chan_rqd(): - If the first "lchan_select_by_type(GSM_LCHAN_SDDCH)" fails (all SDDCH in use), we should try to fall back to any TCH instead, to serve as SDCCH. - the first "if (!lchan && lctype != GSM_LCHAN_SDCCH)" was an attempt to prefer a fallback to the lchan type the MS requested. - the remaining two "if (!lchan && lctype == GSM_LCHAN_SDCCH)" were obviously only applied if the MS asked for an SDCCH, and skipped if the type was TCH/*. - hence, missing was: if the MS asked for a TCH, to also try the *other* TCH kind that the MS did not ask for. (Example: all SDCCH in use, MS asks for TCH/F, but BSC has only TCH/H lchans; we should assign TCH/H as SDCCH, instead we said "no resources") Change-Id: Ie3684cf071751f9528183d761c588102936e498c Related: OS#3503
2019-01-22lchan_select: Do not unsolicitedly select a TCH/FPhilipp Maier1-17/+0
The function lchan_select_by_type() will unsolicitedly select a TCH/F when it is asked for a TCH/H but a TCH/H is not available. This behavior is presumably a leftover from before the split. Now every fallback to another rate must be agreed with the MSC in advance, it is a spec violation to silently fallback to TCH/F when asked for a TCH/H. Change-Id: I057e70bc81b3dac470f6d1d2a37533ec3a7a79d0 Related: OS#3503
2019-01-21lchan_select: dont allow half rate EFR to be selectedPhilipp Maier1-1/+5
The function lchan_select_by_chan_mode() is prone to select an half rate lchan when EFR is used, even though EFR is not defined for half-rate. Lets protect against that. Change-Id: I961d9aaba81424053ab1dc04ce7799e716af4cd8 Related: OS#3503