aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-09-27vty: write local neighbors by bts nr, not lac-ciNeels Hofmeyr2-17/+15
Change-Id: I35783f9624eacbdffccdb59a0179ffda54a26990
2018-09-27neighbor vty: allow setting local neighbors by CGINeels Hofmeyr2-2/+18
Add missing item in the landscape of VTY commands: allow identifying a local cell by CGI (besides BTS nr, LAC or LAC+CI, which already exist). Change-Id: I2d03de6b695904c4a86025bf250358d04f6e47de
2018-09-27neighbor vty: rather 'no neighbor', not 'neighbor del'Neels Hofmeyr2-21/+23
Now the scheme nicely matches: bts 0 neighbor bts 1 no neighbor bts 1 Change-Id: Ib6015b8b48c1f6b98a02cb5a68e568083466e0d5
2018-09-27neighbor vty: drop keyword 'add'Neels Hofmeyr2-113/+111
When writing the neighbor configuration documentation, I noticed that 'neighbor add' and 'neighbor del' make sense from an interactive VTY POV, but when looking at a static config file, it makes more sense to simply name the neighbors without the 'add' keyword, and to use the 'no' prefix instead of the 'del' keyword. It still makes sense to tweak cosmetics like this before inter-bsc handover is used anywhere. First, remove 'add' from all 'neighbor add ...' commands. Instead, prepend "Add" to the doc string for the cell identification argument in commands that add a neighbor: -OsmoBSC(config-net-bts)# neighbor add ? - bts Neighbor cell by local BTS number +OsmoBSC(config-net-bts)# neighbor ? + bts Add Neighbor cell by local BTS number (A subsequent patch will rename 'neighbor del' to 'no neighbor'.) Change-Id: I143f21f6069d1a86096cc8240cf69eb7ea9c8ac8
2018-09-27test neighbor ident vty docsNeels Hofmeyr1-0/+89
Change-Id: I83a2b03c6a081c4ed3225d79d342913a261d9c1c
2018-09-27make: allow vty-tests without configureNeels Hofmeyr1-4/+4
Change-Id: I8cb165890ed77bea8ae82f5228828fa19ff7e0b9
2018-09-27vty: add SCCP related vty commandsNeels Hofmeyr1-0/+1
Depends: I214ea51fc6bfa2a9a4dd7c34b43add0c77ffe22e (libosmo-sccp) Change-Id: I2eb7f5cf9ffceeeb14882190d8545601795d3288
2018-09-26cosmetic: drop param from send_assignment_complete()Neels Hofmeyr1-4/+4
After previous patch I8dd561d744d8081b5ac5ffa7635f17ac19bcda45, all callers pass conn->lchan to send_assignment_complete(), so there is no need to pass it separately from conn. Change-Id: I3c038d91a53c81d9fcf4ec62f853b59bb1ecd244
2018-09-26fix LCLS during Assignment: actually use new TCH lchanNeels Hofmeyr1-6/+10
In assignment_success(), don't trigger lcls_apply_config() before the conn->lchan points at the actual new voice lchan. The entire LCLS code relies on conn->lchan. The assignment FSM wants to point conn->lchan to the new lchan only after it is sure that sending the Assignment Complete to the MSC was successful. However, a failure is a) very unlikely and b) if sending to the MSC fails we might as well tear the whole conn down anyway. Now, if sending to the MSC fails, release the lchan and the conn should clean itself up. Related: OS#1602 Change-Id: I8dd561d744d8081b5ac5ffa7635f17ac19bcda45
2018-09-26lcls: log channel type and lchan names on LCLS codec mismatchPhilipp Maier1-2/+13
When a codec mismatch (lchan type or tch_mode does not match) occurs, we do not know which of the two lchan had which type or tch_mode. Lets print that information as well to make debugging easier. Change-Id: I3fd22fef50d8944ca8c003c6114fdda37417b2ea Related: OS#1602
2018-09-26check for overlong unix socket pathsStefan Sperling1-1/+5
In rf_create_socket(), check the result of osmo_strlcpy(). This catches overlong and non-NUL-terminated socket paths. Change-Id: I4b9ff9146068bf7f53d67c577454f32c02361b86 Related: OS#2673
2018-09-24codec_pref: Add Codec List to COMPLETE LAYER 3 INFORMATIONPhilipp Maier5-1/+1240
The COMPLETE LAYER 3 INFORMATION message lacks the Codec List (BSS Supported) information element. This information element is mandatory for networks that use an IP based user plane (AoIP). - Add function to generate the speech codec list from the current codec settings (Available codecs) - Generate and embed information element in L3 Compl. message Depends: libosmocore I4e656731b16621736c7a2f4e64d9ce63b1064e98 Change-Id: Id6f2af3fdab45bf05f06aec03e222734d7a4cf70 Related: OS#3548
2018-09-24gsm_data.c: Set reasonable AMR codec defaults in gsm_bts_alloc()Philipp Maier1-0/+28
At the moment we do not initalize the struct members mr_full and mr_half in struct gsm_bts. The user still has the option to configure reasonable values via vty, but when not VTY configuration is made, the flags for the AMR rates will be all zero. Lets initalize the struct members with reasonable defaults. - Make sure gsm_bts_alloc() populates fr_half and fr_full with reasonable defaults. Change-Id: I68747ae6dd2582e2a7d60337d9f2c43bd06ac525 Related: OS#3548
2018-09-24assignment_fsm: only include speech codec (choosen) on AoIP networksPhilipp Maier1-4/+8
The field speech codec (choosen) in the ASSIGNMENT COMPLETE message has been specified with AoIP. Since sccp-lite has been specified before AoIP, we should not include the speech codec (choosen) field in the ASSIGNMENT COMPLETE, when osmo-bsc is connected to an sccp-lite based network. - make sure speech codec (choosen) is only included on AoIP based networks Change-Id: Ic7f28aacc953d96ebf3aa04f3e1810475458c1a8
2018-09-18Implement RR Classmark EnquiryNeels Hofmeyr3-0/+19
If the MSC sends a BSSMAP Classmark Request, send an RR Classmark Enquiry to the MS. (The reverse direction, i.e. sending a BSSMAP Classmark Update back to the MSC, is already implemented.) Related: OS#3043 (A5/3 encryption) Related: osmo-ttcn3-hacks Idaab4d568cf986b4897ba008f6262c839d1592fb Change-Id: If5db638fd6e8d9c2ef9e139e99f0fabe1ef16ddf
2018-09-17gsm_data: remove unused struct member chan_modePhilipp Maier2-6/+1
Remove unused gsm_subscriber_connection.user_plane.chan_mode. There is only one VTY command that displays it along other parameters, but it is used no where else. Lets remove it. It was forgotten to be removed in: commit 31f525e7560ad13e32cfc5e0b5f1862c0efcb991 Date Mon May 14 18:14:15 2018 +0200 "large refactoring: use FSMs for lchans; add inter-BSC HO" change-id I82e3f918295daa83274a4cf803f046979f284366 Change-Id: I10049c14ea206a4daafbdad01634d57c72a79d7c
2018-09-17gsm_data: remove unused struct member full_rate.Philipp Maier1-3/+0
Remove unused member gsm_subscriber_connection.user_plane.full_rate. It was forgotten to be removed in: commit 31f525e7560ad13e32cfc5e0b5f1862c0efcb991 Date Mon May 14 18:14:15 2018 +0200 "large refactoring: use FSMs for lchans; add inter-BSC HO" change-id I82e3f918295daa83274a4cf803f046979f284366 Change-Id: I3a14efe0039ff4690e27e3b083eb23c1b2a616c3
2018-09-17LCLS: fix codec mismatch detectionPhilipp Maier1-4/+4
gsm_subscriber_connection.user_plane.chan_mode and .full_rate were unused since and forgotten to be removed in: commit 31f525e7560ad13e32cfc5e0b5f1862c0efcb991 Date Mon May 14 18:14:15 2018 +0200 "large refactoring: use FSMs for lchans; add inter-BSC HO" Instead of above unused struct members, use lchan->{full_rate,tch_mode}. When not explicitly allowed via VTY settings, the LCLS mechanisms will avoid to locally switch connections with different codecs/rates. For example GSM HR and GSM FR would not be locally switched. Change-Id: Idd7117092b1f170d5029303ae5ba0a49e02a8bfb Related: OS#1602
2018-09-14codec_pref: fix missing breaks in switch-case statementPhilipp Maier1-0/+4
In function test_codec_support_bts() the switch case statement lacks break; statements for some cases. This may lead into messed up codec decisions. - Add missing break statements Change-Id: Ib5400a0a0a8a39fa714bd087df345160bed5cc61
2018-09-14codec_pref: add AMR configuration bits to make_scl_config() in unit-testPhilipp Maier1-0/+6
The the function make_scl_config() is used to generate realistically looking speech codec lists to perform the unit tests for codec_pref.c. This function does not yet populate the S0-S15 bits for AMR codecs. Lets make sure that at least the default configuration is populated here. Change-Id: I534239416c038ea856c128659f314aa521f85c15
2018-09-14codec_pref: fix typo in commentPhilipp Maier1-1/+1
Change-Id: Ie4ea8179395cd331dad4b62227debb026b5b008c
2018-09-13Install sample cfg file to /etc/osmocomPau Espin Pedrol2-0/+9
Change-Id: I87bc40fafa6269d99ccbfe49a61fc7ae4da62e80
2018-09-13Install systemd services with autotoolsPau Espin Pedrol7-2/+32
Change-Id: I015ac3fbe5adc551b76bac5c15ad93d30d0d2b6e
2018-09-11ts,lchan_fsm: do not attempt to allocate CBCH subslotsNeels Hofmeyr3-0/+17
In case a given channel combination contains a CBCH, it replaces sub-slot 2 with a CBCH, i.e. we must not attempt to allocate the same for SDCCH. On timeslot initialization, immediately place such an lchan FSM into new state LCHAN_ST_CBCH, so that it never appears unused and never is picked during lchan_select(). Also set lchan->type = GSM_LCHAN_CBCH. Verified by configuring CBCH timeslots and watching 'show lchan summary'. Immediately after RSL and OML are up, these pchan types show lchan 2 in state CBCH: BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm With a 'phys_chan_config ccch+sdcch4+cbch' and three phones simultaneously requesting USSD, I see: BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 0, Type SDCCH, State ESTABLISHED - L1 MS Power: 14 dBm RXL-FULL-dl: -53 dBm RXL-FULL-ul: -47 dBm BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 1, Type SDCCH, State ESTABLISHED - L1 MS Power: 30 dBm RXL-FULL-dl: -47 dBm RXL-FULL-ul: -47 dBm BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm BTS 0, TRX 0, Timeslot 0 CCCH+SDCCH4+CBCH, Lchan 3, Type SDCCH, State ESTABLISHED - L1 MS Power: 16 dBm RXL-FULL-dl: -47 dBm RXL-FULL-ul: -47 dBm With 'phys_chan_config SDCCH8+CBCH' and three phones simultaneously attaching, I see: BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 0, Type SDCCH, State WAIT_RLL_RTP_ESTABLISH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 1, Type SDCCH, State WAIT_RLL_RTP_ESTABLISH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 2, Type CBCH, State CBCH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm BTS 0, TRX 0, Timeslot 1 SDCCH8+CBCH, Lchan 3, Type SDCCH, State WAIT_RLL_RTP_ESTABLISH - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm i.e. in all cases the CBCH lchan remains occupied and is not allocated as SDCCH. Detaching and re-attaching the BTS reliably brings back the CBCH state. Also verified that changing the osmo-bsc config from telnet vty and dropping oml followed by the BTS re-attaching brings back the CBCH state. Change-Id: I2bafc5f696e818e38f8907ad0c8f38494df0623d
2018-09-10lchan_fsm: allow late RTP release events without erroringNeels Hofmeyr1-0/+9
Change-Id: Ia463f97402b957bd13a95d18d291d1c1f006f089
2018-09-10ho fsm: handle RR HO Failure for inter-BSC outgoingNeels Hofmeyr1-0/+16
Before, this would ignore the failure and hit a timeout instead. Rather handle the event directly. Change-Id: I21c43d2907d0413ef18ec43cf27f680ebecf9e82
2018-09-09CBCH: Fix gsm_bts_get_cbch()Harald Welte1-2/+2
When the timeslot FSMs were introduced, the function gsm_bts_get_cbch() was ported to use 'pchan_is'. However, the function is called very early, before pchan_is is actually initialized. Let's make sure we're using the _configured_ channel combination when resolving where the CBCH is (if any) in the BTS. Ever since merging the timeslot FSMs and before this patch, SI4 would never indicate the presence of a CBCH. Change-Id: I6251b5f3e1180ad466e9349a1845e1b91f661c0b Related: OS#3532
2018-09-09CBCH: Fix SI4 CBCH IE generationHarald Welte1-1/+1
When a CBCH is present in the cell, SI4 contains the channel description of the CBCH. As SI4 may be generated at a time when the underlying timeslot is not configured yet, we need to generate the channel description for the _configured_ channel combination, not the currently used one. Change-Id: Idbf9b8e4b1ef0e0348580b83f91355b3236d8609 Closes: OS#3532
2018-09-09Introduce gsm48_lchan2chan_desc_as_configured()Harald Welte2-5/+20
gsm48_lchan2chan_desc_as_configured() is similar to gsm48_lchan2chan_desc(), but uses the *configured* channel combination, rather than the currently active one. Change-Id: Id4043218fb770e8420f19a4ef9428680ecdfd286 Related: OS#3532
2018-09-09gsm48_lchan2chan_desc() belongs to gsm_data.hHarald Welte2-2/+3
The function is defined in gsm_data.c, so it should be declared in gsm_data.h and not in gsm_04_08_rr.h Change-Id: I5200063fb43c857a984ea8e41a8485d796e49cde
2018-09-09cbch: Don't send cell-broadcast command on BTS without CBCH channelHarald Welte1-0/+4
Change-Id: I83d6b0b3eafd83e2c0fbdec81d9677ff0118db92
2018-09-07inter-BSC HO outgoing: fix L3 forwardingNeels Hofmeyr1-3/+2
Set msgb->l3h when composing the L3 message. Before this, the unset l3h resulted in erratic size in the RSL L3 Info IE. This likely fixes inter-BSC Handover on the outgoing side, to properly forward the RR Handover Command. Change-Id: Ice37242c90c19adbf0795618fd16fe75f0809317
2018-09-07inter-BSC HO incoming: send BSSMAP HO Complete directlyNeels Hofmeyr1-1/+1
Before Handover is fully completed, the gscon remains in an INIT state. To send back the BSSMAP Handover Complete message, use osmo_bsc_sigtran_send() directly to not thwart the message due to the gscon state. (The gscon state will change to ACTIVE right after that, once the handover FSM is done.) Change-Id: Ic48ae2bb23565015d5e2ccb56308fad09347b51a
2018-09-07SCCPlite Assignment Complete: include Speech Codec (Chosen)Neels Hofmeyr1-4/+4
Compose the Speech Codec (Chosen) IE not only for AoIP, but also for SCCPlite: place the code that assigns the codec to sc_ptr outside of the gscon_is_aoip() if scope. This way the MSC is told the chosen speech codec, which is mandatory for IP based user plane, and was missing until now. Related: OS#3528 Change-Id: Ibedade8d71a7994d25a63bc2faa2a24a10bfffa1
2018-09-07codec_pref.c: Add comment in expected switch case without breakPau Espin Pedrol1-0/+1
Change-Id: I568353f070f049003326306106dce89b35deb92f
2018-09-06assignment: remove unnecessary call to gsm0808_speech_codec_from_chan_type()Philipp Maier1-2/+0
There is a function call to gsm0808_speech_codec_from_chan_type() after an if construct that checks if we need voice and if we need it if it is related to an AoIP connection. However, at the moment we call gsm0808_speech_codec_from_chan_type() all the time, even when just figured out that we don't need to. Presumably this is a refactory leftover. Lets remove the excess function call. Change-Id: I34d9281944b36cd89ad8e1c5774f0ea80fdfadc8
2018-09-04codec_pref: Log HR2 specifically as never specifiedPau Espin Pedrol1-1/+2
Change-Id: Ia7d6545710b4bf609c2872e13dcb3b44abfc604e
2018-09-04codec_pref: Log unsupported codec name usedPau Espin Pedrol1-1/+4
Change-Id: If3ed8ba3bad7c927ed0efc908c005cd308e304e6
2018-08-29lchan: pick proper power and ta valuesNeels Hofmeyr1-6/+15
When activating an lchan, the power levels should be maximum and TA zero. Only if a new lchan is assigned within the same cell does it make sense to take over the previous power and TA levels. In LCHAN_EV_ACTIVATE: - Separate the code that copies previous encryption data. This should happen regardless of whether we're staying in the same cell or not. - For the power,TA levels, take over an old lchan's values only when it is assigning a new lchan in the same cell. Change-Id: I360b003398487fa6f934296ff03643c33ec61a35
2018-08-29cosmetic: lchan activ: drop todo commentsNeels Hofmeyr1-2/+0
Drop the todo comments about "for_conn->encr". I have intended that as an idea to store encryption info in the conn instead of the lchan, which might make sense, but there's no use in these comments. Change-Id: I47e90062c784dd7919fff3115e2bee3314b30cd5
2018-08-29cosmetic: lchan activ: no need to clear mr againNeels Hofmeyr1-2/+0
In lchan state UNUSED, on activating an lchan, we zero out the lchan->mr_ms_lv and mr_bts_lv. However, in UNUSED's onenter function, we already called lchan_reset(), clearing out the lchan completely. Drop two lines of unnecessary code. Change-Id: I8b38f222f1c8c822e8e5e776850dbc60e30e8b8d
2018-08-29fix dependency bug: include mgcp_client/, not mgcp/Neels Hofmeyr1-1/+1
In osmo_bsc_sigtran.c, instead of osmocom/mgcp/mgcp_common.h, include the same file from mgcp_client/. (mgcp_common.h is identically installed both by libosmo-mgcp and libosmo-mgcp-client, in their respective include dir.) Trying to include from mgcp/ breaks the debian package builds, since only libosmo-mgcp-client is installed as per osmo-bsc dependencies. The error was introduced by: commit d8f46c0074e6c2b3b693f48ca496d11a301d4923 "MGCP: add 'X-Osmo-IGN: C' for SCCPlite by default" change id I257ad574d8060fef19afce9798bd8a5a7f8c99fe Change-Id: I917b0c08ed91172ecb68c946aecb02c5109fcced
2018-08-29log: tweaks and more context in osmo_bsc_sigtran_send()Neels Hofmeyr1-4/+6
Change-Id: I3d51f17b0f6ceb0e5237b4d6d5252c701fc2fe6b
2018-08-29inter-BSC HO: send failure msg directlyNeels Hofmeyr1-1/+1
If inter-BSC HO failed, the conn is by definition not in an active state, and hence it makes no sense to verify the gscon FSM state before sending. Directly call osmo_bsc_sigtran_send(). Change-Id: Ic49c94462041800674fa961c4d19c0c045bfe0c0
2018-08-29log: 'sending BSSMAP HO Request ACK'Neels Hofmeyr1-0/+1
Change-Id: Ie472c32861d9c9ca9ebec0221837030ffd83c73a
2018-08-29log: lchan_rtp_fsm: add missing '\n'Neels Hofmeyr1-4/+4
Change-Id: Ifa46295ef23cf3728bc946fe27b34f0607a24c9e
2018-08-29lchan_fsm: safer 'concluded' flagNeels Hofmeyr2-8/+13
The flag lchan->activate.concluded prevents entering the lchan_on_fully_established()/lchan_on_activation_failure() more than once. So far it was checked by callers, instead place in the functions themselves. There is a potential functional change here, since during lchan_fail(), the concluded flag was set only after entering lchan_on_activation_failure(). Now it is already set at the start and prevents multiple re-entry beyond doubt. This patch is not a result of an actual observed faulty behavior, just from reading the code and seeing the slight loophole. Change-Id: I0c906438b05442d66255203eb816453b7193a6d8
2018-08-29cosmetic: lchan_fsm failure: log about state transitionsNeels Hofmeyr1-2/+9
Early on during failure, log which state transition is intended after failure handling. If such state is already reached after failure handling, do not log "state transition not permitted", but rather skip the state change and log "Already in state X". Change-Id: I81f53b38637823e62860cb773b7573bb5c21fdb0
2018-08-29lchan_fsm: lchan_fail_to(): store target state earlyNeels Hofmeyr1-1/+3
lchan_fail_to() is a macro to preserve useful source file:line information in logging. But a side effect is that its target state argument might evaluate differently at the end of the macro, if, say, the fi->state has changed. I hit such an instance on timeout of WAIT_RLL_RTP_ESTABLISH: lchan_fsm_timer_cb() calls macro lchan_fail(), which calls lchan_fail_to(lchan_fsm_on_error[fi->state]). Unlike for normal function invocation, this argument changes as fi->state changes. Since releasing the lchan_rtp_fsm already transitions the lchan fi into WAIT_RF_RELEASE_ACK, the final state change of lchan_fail_to() suddenly evaluates to the broken state instead of the intended WAIT_RF_RELEASE_ACK. Early in lchan_fail_to(), store the argument's value as of macro invocation. Change-Id: Id9bf4580a112ee5629f553a8bcb6b5b03b1c5f53
2018-08-29inter-BSC HO incoming: drop old/wrong RTP port codeNeels Hofmeyr1-17/+0
Drop nonsensical legacy code. The Circuit Identifier Code in A/SCCPlite does *not* indicate the RTP port to use. Rather, it indicates the MGW endpoint name to use when configuring the BSC's side of the MGW endpoint, and only the MGW will ever know the RTP port. Change-Id: I471bd5e5cc2a083dd37290aeaae5c334ca5f7eed