aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
AgeCommit message (Collapse)AuthorFilesLines
2017-12-11paging: Stop all paging if MSC sends us BSSMAP RESETHarald Welte1-0/+3
When the MSC has lost its state and issues a RESET, we should not only clear all ongoing radio connections, but we should also stop any paging. There's no point in paging a subscriber if the MSC doesn't know about this paging anymore. Change-Id: If3f53d3bb66ad2dc02db823cb813590c6b59c700 Closes: OS#2736
2017-12-11paging: Remove obsolete paging call-back supportHarald Welte2-4/+4
The call-back was needed inside the NITB to determine which part (CC, SMS, ...) had triggered a given paging. A pure BSC doesn't need that feature, so let's get rid of it. The 'void *cbfn_data' is replaced with a 'struct bsc_msc_data *', as all callers use it with that type. Change-Id: I8839e8338d3ad1a91b41e687e8412fcdca3fd9ab
2017-12-10mgcp: cosmetic fixupsPhilipp Maier1-105/+39
- use unique enum/struct fsm struct names - use macro to shift bits in FSM description - use OSMO_STRINGIFY to generate the state names - remove duplicate logging of states and events - remove unnecessary space in log strings - prefix hexadecimal enpoint ids with - remove unnecessary log messages - rename bsc_mgcp_cause_codes_str to bsc_mgcp_cause_codes_names Change-Id: I663e03046cde3c786af72d15681bf7497330d7f9
2017-12-01cosmetic: use fsm pointer from parameter listPhilipp Maier1-39/+31
the parameter list of osmo-fsm callbacks contains a pointer to the fsm instance. Use this pointer instead of reaching out for mgcp_ctx->fsm. Change-Id: I05ff62e7e2de64c2dbf5ea2736f5e58faf16df0b
2017-12-01cosmetic: correct sourcecode formattingPhilipp Maier1-1/+2
add missing line break Change-Id: Ia117e4099046fefcf35ccb94400554062e667869
2017-12-01cosmetic: add missing log prefixPhilipp Maier1-6/+6
the log messages have prefixes that mark important phases (CRCX/BTS, etc...). Some lines lack the prefix. Add missing prefixes. Change-Id: Iea5ea9e54f4b5c998b1d5fe18a98a94abd7b728b
2017-12-01cosmetic: do not cast void pointerPhilipp Maier1-5/+5
remove the casting of void *data, just assign directly Change-Id: I2e37630e315b3602da2f14e2364bb76be9dd2894
2017-12-01mgcp: do not fail silently on snprintf()Philipp Maier1-2/+1
The snprintf() that is used to compose the fsm name on an assignment request may cause a silent failure. The buffer is large enough to take the string under all circumstances. If snprintf() fails, this would mean we have some other serious problem. use OSMO_ASSERT in case the snprintf() fails, so the failure gets noticed. Change-Id: I3c36df8cfd0880c524244048a993cd136be41f56
2017-12-01mgcp: add missing switch casePhilipp Maier1-0/+8
In the beginning of the CRCX phase for the network does not distinguish between EV_MDCX_BTS_RES and EV_TEARDOWN, so a Teardown due to an error could be misinterpreted as a successful MGW response. Add missing case statement to distinguish CV_MDCX_BTS_RES from EV_TEARDOWN. Change-Id: I9bf49df167d94b33ad65d8b9382a01f160b5aec0
2017-12-01mgcp: use mgw assigned connection identifiersPhilipp Maier1-11/+14
osmo-mgw assigns connection identifiers which are returned with the response to the CRCX. store the assigned connection identifiers and use them to identify the connections. Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c Closes: OS#2648 Change-Id: Ib379a6f40875bb8f2cf29038a5b5b7a40a21adab
2017-12-01mgcp: use hexadecimal digits in endpoint namesPhilipp Maier1-1/+1
The current implementation of osmo-mgw parses the numerical digit inside the endpoint name as hexadecimal number. also use hexadecimal numbers in endpoint names. Change-Id: I64a970d300b7290d50ec84b0640d5a321d903f5e
2017-11-30sccp-lite: remove obsolete VTY commandsPhilipp Maier1-43/+0
remove obsolete vty commands: - token - auth-key - no auth-key Change-Id: I9101d750a424b8af46d603bc7c877229bbae8727
2017-11-30bssap: remove libosmo-legacy-mgcp dependancyPhilipp Maier1-4/+15
the functions mgcp_timeslot_to_endpoint() and rtp_calculate_port() which are used to calculate the port in the sccp-lite / non AoIP case are part of libosmo-legacy-mgcp. Unfortunately libosmo-mgcp and libosmo-legacy-mgcp cause problems when used at the same time. Replace the functions mgcp_timeslot_to_endpoint() and rtp_calculate_port() with a local helper function. Change-Id: Id10311332aeabd8fd3ba1922198e34708e04cef9
2017-11-12osmo-bsc: Print NOTICE message on unimplemented BSSMAP UDTHarald Welte1-0/+4
When we receive unimplemented/unhandled message types, we shouldn't simply silently discard them, but print a log message for the benefit of the user. Change-Id: I65489578b1c214f193b1ce0e9ba59432dcd42a3e
2017-11-12mgcp: remove unused variablePhilipp Maier1-4/+0
The function handle_error asserts mgcp_ctx->conn to be non null, but it does not access it otherwise. remove unused variable conn Change-Id: I09851c957395d1ddb2f9471b99ffc091bc250404
2017-11-12mgcp: add missing out statePhilipp Maier1-1/+1
Even in the very early ST_CRCX_BTS phase, the error handler may decide to go to ST_CALL in order to initate the termination of a possibly half open connection. Add ST_CALL to the out state list in ST_CRCX_BTS Change-Id: Ic67aa7c67a4e98a38bff156be3ebf612012eb842
2017-11-12cosmetic: replace term MGCP-GW with MGWPhilipp Maier1-7/+7
The term MGCP-GW is deprecated, use now MGW Change-Id: Ibccda7e95c42267ce5f44e9fc4256a0083b6f68f
2017-11-12cosmetic: reorder case listPhilipp Maier1-2/+2
the switch statement in fsm_send_assignment_complete() has the default case at the beginning. Move the default case to the end to match common coding style rules Change-Id: I360842fe899b95972c44da3cb74a3dc51b379fdc
2017-11-10use osmo_sccp_inst_addr_name() instead of looking up ss7Neels Hofmeyr1-8/+4
Depends: libosmo-sccp I70ec5c8b42682a23f11a5820431c7e34e225709b Change-Id: Idb451597c724ac87a391121cebd0b0a927dd49d1
2017-11-09osmo-bsc vty: be fatal for addressbook entry errorsNeels Hofmeyr1-10/+8
So far, the config would log an error upon config parsing, and then continue to use defaults, which is super easy to miss. On errors, return CMD_ERR_INCOMPLETE to abort the program in a config parsing error. Be fatal for non-existing addressbook entries and for using address book entries from mismatching cs7 instances. Though it is mixing in cosmetic changes, add "Error:" to the output and arrange the erratic name to the end of the message, as is customary for error messages. Related: libosmo-sccp I2f71b9c4dd30f919d2054da81283dd7035f44f60 Change-Id: Ia4e58902a2d3757b266cf35ac89f256cfb8f0eec
2017-11-09osmo-bsc: SCCP addrs: default only if unset, reject invalidNeels Hofmeyr1-32/+25
So far, if the user entered an invalid SCCP address in the config, the osmo_bsc_sigtran_init() code simply replaced that with the default, i.e. running with a completely different address than the user may intend. Use the default SCCP addresses only when they are unset by the user. Default MSC addr: set directly, do not detour via cs7 instance PC. The default MSC SCCP addr is just a point code + SSN, deriving it from the cs7 instance first is a confusing step. Just set the PC and SSN, and done. Using default addresses does not constitute an "auto configuration": if we set up a cs7 instance automatically, we do not want to have to create a second one automatically, to prevent "auto-confusion", and want to bail instead. But for each MSC on its own, using default SCCP addresses makes sense and is orthogonal to automatic cs7 instance creation. Hence drop the auto config semantics from the default SCCP address parts. Always validate the SCCP addresses we will end up using, and bail immediately if they are erratic. i.e. don't overwrite a non-empty invalid SCCP address with defaults, but straight bail. Beneficial side effects: - Fix some grammar ultra confusion in log messages. - Add context: log the MSC number the logging refers to. - Drop code dup: since we're always logging the used SCCP addresses, might as well log those once, unconditionally, in the end. Change-Id: Iadbc2e9740457e1b389b7e7ad9c94274e7d8cb11
2017-11-09osmo-bsc RESET FSM: use distinct struct namesNeels Hofmeyr1-10/+10
Use distinctive struct names: s/fsm_/fsm_bsc_reset/. They only exist in the static context and it works fine, but the mad fsm-to-dot.py script breaks with identical struct names. Can't hurt to have unique names. Change-Id: I986377a74ccd83ca3b52e7f058bbc9115f05f741
2017-11-07mgcp: use osmo-mgw to switch RTP streamsPhilipp Maier7-64/+1252
osmo-bsc currently negotiates the RTP stream directly with the BTS and reports back the RTP IP/Port on the BTS. This works fine for a single BTS, but for Handover the port/ip pointing to the MSC side must not change, so an entity in between the BTSs and the MSC is required. Integrate the mgcp-client and use osmo-mgw to switch the RTP streams. Depends: osmo-mgw Ib5fcc72775bf72b489ff79ade36fb345d8d20736 Depends: osmo-mgw I44b338b09de45e1675cedf9737fa72dde72e979a Depends: osmo-mgw I29c5e2fb972896faeb771ba040f015592487fcbe Change-Id: Ia2882b7ca31a3219c676986e85045fa08a425d7a
2017-11-07bssap: paging: page entire BSS for unimplemented cell id listNeels Hofmeyr1-9/+39
3GPP TS ยง 08.08 defines various types of Cell Identifier List IEs, but we only implement "entire BSS" and "one LAC". If the MSC sends a Cell Identifier List that we don't implement, it is best for interoperability to page the entire BSS and post a log message instead of rejecting the paging altogether. Apart from resource management, it is not harmful to page more than the MSC requested; if use of resources becomes an issue, the log message will guide towards the solution of providing an actually implemented Cell Identifier List IE. Upon IE length that is other than we expect, log the error, but also fall back to paging the entire BSS. Overall message length correctness has been checked earlier. The particular case observed is that a Huwaei MSC sends a LAI for Cell Identifier List (MCC+MNC in bcd, followed by a LAC), parsing of which we may want to add later. Improve logging: identify the subscriber that is being paged. Coding style: use a switch() statement to clarify flow and provide a place to add more implementations later. Add regression test bssap_test.c: fabricates BSSAP Paging messages with the two implemented Cell Identifier List IEs as well as the unimplemented LAI identifier, verify the resulting paging LAC in wrapped function and stderr. Change-Id: Ie934c5d229140a89763bf2efff86d6a3766cd351
2017-11-01vty: skip installing cmds now always installed by defaultNeels Hofmeyr1-2/+0
vty_install_default() and install_default() will soon be deprecated. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: If2edf59a687a78d6db6bc73117a27509374b0fc6
2017-10-26log: output hexdump of transmitted sccp messagesPhilipp Maier1-2/+2
We output a hexdump for each sccp message we receive, but not when sending. Also log the hexdump of sccp messages when sending. Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345
2017-10-26log: log the sccp message type of messages sentPhilipp Maier1-0/+16
We already log the message type of sccp messages we receive, but for transmitting the log output is missing. Also log the message type for tramsitted sccp messages. Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7
2017-10-24Rename osmo_fsm to avoid illegal space in name + more meaningful nameHarald Welte1-2/+2
A FSM doesn't need "FSM" in its name, as it is obvious that it is a FSM. Also, having two that are called RESET is confusing, so let's try to come up with better names. Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in libosmocore, we now enforce that no FSM identifiers contain spaces or other illegal characters. Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003
2017-10-24osmo-bsc: Initialize logging before initializing rate_ctrHarald Welte1-3/+3
The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f
2017-10-23bsc_vty: Improve description of mid-call-text cmdPau Espin Pedrol1-1/+2
Change-Id: I367b7734390daf39160de6462e9b2210368666f4
2017-09-25CTRL: cleanup write-only command functionsMax1-31/+3
Remove trivial functions by using more specific defines for CTRL commands. Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr11-78/+78
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-08-30split off osmo-bsc: remove files, apply buildNeels Hofmeyr5-5/+19
Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca
2017-08-30move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcpNeels Hofmeyr1-1/+1
Rewire build and includes to libosmo-legacy-mgcp. Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git. libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
2017-08-30Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier10-435/+1232
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-27Treat SIGTERM just like SIGINT in our programsHarald Welte1-0/+2
When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b
2017-08-27Implement IuCS (large refactoring and addition)Neels Hofmeyr1-1/+1
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-08-27move openbsc/* to repos rootNeels Hofmeyr11-0/+4616
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7