AgeCommit message (Collapse)AuthorFilesLines
2017-12-27MGCP: Force-send a DLCX to all connections of before any new CRCXlaforge/dlcxHarald Welte1-0/+18
There are some situations in which osmo-bsc releases a call without sending a DLCX to the media gateway. The 'laforge/fsm' has a more proper solution to the problem, this is an interim hack which just sends an unsolicited DLCX before the CRCX. Change-Id: I1a78721d3d0a2f4a99cfddade2d06732f0388c30
2017-12-23bsc_test.c: Use proper network/bts/lchan structuresHarald Welte1-4/+4
don't mock them, simply call the respective functions to get a gsm_network and a gsm_bts with all its subordinate members. Change-Id: I8bdf009d3c7e2473dd42da02762039a19430d6ce
2017-12-22BSC: Fix bsc_subsc leak on pagingHarald Welte1-0/+4
The OsmoBSC code contained a refcount leak on bsc_subscr in the paging code. For every PAGING command received from the MSC we consistently leaked one refcount, resulting in a resulting memory leak. Change-Id: I3d0fb406ca2a1042c6c3424e0dd263c1933b0d50 Closes: OS#2780
2017-12-22BSC: Add "show subscriber all" commandHarald Welte1-0/+23
This command lists the currently-active bsc_subscr and their contents, the format looks like this: OsmoBSC> show subscriber all IMSI TMSI LAC Use 001010123456789 ffffffff 65534 3 001010100000001 a1b2c301 65534 1 Change-Id: Ib9c0c31a0a5a91b42fd832fa0df3460b1a440733
2017-12-21Enable sanitize for CI testsMax1-1/+1
Change-Id: I86f8f29dbe13869fa4a0ac1f55ff697a8975525b
2017-12-20mgcp: validate rtp connection data in MGW response (ip/port)Philipp Maier1-2/+18
Currently the pasing results from the RTP ip/port are fed into inet_addr without checking the results. Check the return code of inet_addr to be sure that the IP-Address got properly decoded. Change-Id: I1d0aa7e9b8480e1bef57269e3904399cb99815bb
2017-12-20mgcp: cancel transactions on timeoutPhilipp Maier2-0/+11
when a transaction to the MGW times out, then the context information is freed. Unfortunately the client is not informed about this and will try to execute the callback anyway. explicitly cancel the transaction in order to prevent access to already freed data structures. Change-Id: I40794dff7d10e2b6a96863a2da7e9fbd5662a1bf
2017-12-19remove unused 'lac' member of 'struct gsm_subscriber_connection'Harald Welte2-3/+0
This field was used in write-pnly mode, i.e. set but never read. Change-Id: I319945538fd3e3bc5cf3b9d82533641cb8ba5256
2017-12-19gsm_data.h: Document all fields of gsm_subscriber_connectionHarald Welte1-8/+14
Change-Id: I429fe7817f075d0794645d37f5ea11b104102ba0
2017-12-19osmo-bsc: Move user plane/voice related bits into sub-structureHarald Welte7-46/+45
This clarifies which members of the struct are for what. Change-Id: I618822e6f2d48adce25f9df5c25acbce7c858412
2017-12-19osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'Harald Welte1-0/+5
Change-Id: I674ed61a22fad5cc09c45128dbc73474893aefb6
2017-12-19Remove unused struct osmo_bsc_sccp_con member sccp_queue_sizeHarald Welte1-3/+0
Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
2017-12-19osmo_bsc_bssap.c: Spelling fixes in commentHarald Welte1-3/+3
Change-Id: I32b2d08bf25cd2d343755ac8491e4f5f758ccee6
2017-12-19remove libosmo-sccp dependency for osmo-bscHarald Welte9-25/+6
libosmo-sccp is the old sccp-lite-focused SCCP implementation that we used before libosmo-sigtran was created. The new osmo-bsc in this repository is using libosmo-sigtran and shouldn't be using parts of libosmo-sccp anymore. We only keep it around in configure.ac and Makefile.am for osmo-bsc_nat, which is not even built in this repository anymore (or 'again yet'?) Change-Id: I8f274be7d196cd7a5b1ec9ada949130fb06e984d
2017-12-19Remove some more dead codeHarald Welte4-163/+0
Change-Id: I919bffe88babd90227c89abd4434322965c32ebb
2017-12-19Remove bogus MM INFO configurationHarald Welte8-100/+0
The network name and other MM INFO is controlled by the MSC, not the BSC. Change-Id: I1cbf72fc50cff29e7c1633ba752cbf15b4b84c58
2017-12-19Remove bogus vty config for LU reject causeHarald Welte6-25/+0
The LU reject cause (like anything MM related) is under control of OsmoMSC, not BSC. Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
2017-12-19Remove unused RRLP options/codecHarald Welte9-65/+0
RRLP is handled in OsmoMSC after the split from NITB, so let's remove any bogus VTY commands left over in the BSC. Change-Id: Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38
2017-12-19Remove dead code left over from NITB splitHarald Welte68-2484/+25
There still is a lot of dead code that we inherited from the NITB days, let's remove more of it. libtrau will be re-introduced as part of osmo-mgw later. Change-Id: I8e0af56a158f25a4f1384d667c03eb20e72df5b8
2017-12-19Remove unneeded .py scriptsMax9-983/+2
The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py are not BSC-specific: leftovers from repository split which are now available in osmo-python-tests as well. Change-Id: Ia4285b18b152b070c148228604d1e61a8adedba1
2017-12-18Fix tests after rate_ctr changeMax2-48/+62
Recent change lin libosmocore disallow registering rate_ctr with the same name and indexing multiple times. To accommodate to this: * allocate network struct once and use it for all tests * deregister rate_ctr group after each test * free bts struct after each test Related: OS#2757 Change-Id: Ie1537a1ee9ee812eaaf9f58dc4bc86d4add8c31f
2017-12-14fix bssmap_handle_cipher_mode()'s encryption decisionNeels Hofmeyr1-6/+29
Properly match up any A5/N with the MSC's list of permitted algos. Properly set the reject cause in case of mismatching algorithm choices. Actually allow choosing A5/1 thru 3 as configured on the VTY, by passing a5_encryption through to gsm0808_cipher_mode() (instead of a hardcoded 1). Properly handle failure rc of gsm0808_cipher_mode() by sending a reject message. Cosmetically clarify which GSM0808_IE_ENCRYPTION_INFORMATION bits mean what by means of local variables; add some comments on expected encryption formats; add comment that the BSC should be able to have more than one a5_encryption. Related: OS#2745 OS#2755 Change-Id: Ide8a615905555e35be4584b458d4d40345686175
2017-12-14debug log: log Cipher Mode info upon sending down RSL/A-bisNeels Hofmeyr1-0/+4
Change-Id: I7f7ec44887f6b40fdce8d348e9e9bd200fe0b689
2017-12-14log typo fix in gsm0808_cipher_mode()Neels Hofmeyr1-1/+1
Change-Id: I3f6d138df9ddc9c6560d04e2e8baa1f3a50a164f
2017-12-14Add new "chan:mode_modify_nack" counter to count RSL MODE MODIFY NACKHarald Welte2-0/+3
Those NACKs shouldn't happen in production, and if they do, you probably want to have a more persistent figure than a line in the log file about it. Having counters allows the user to monitor this efficiently. Change-Id: Ic82c6baaf4cb88d07bc5cdc200f8279cf130f396
2017-12-14Add a new counter "rsl:ipa_nack" to count number of IPA related NACKsHarald Welte2-0/+6
Those NACKs (CRCX/MDCX/PDCH_ACT) shouldn't happen in production, and if they do, you probably want to have a more persistent figure than a line in the log file about it. Having counters allows the user to monitor this efficiently. Change-Id: I5edf979c9a2b4c9a5a60eef9f66c26da54f2bddf
2017-12-14Add new per-BTS "rsl:unknown" counter to count unknown RSL messagesHarald Welte2-0/+11
Change-Id: I268f222140fa5783e1d19f81fbd45614aaa4b8c4
2017-12-14Add per-BTS rate_ctr for total + failed number of RSL CHAN_ACTHarald Welte2-0/+8
Change-Id: I471b598af194dee78ebaa3414b6290c72d9bbcff
2017-12-14Reduce T3113 default from 60s to 10sHarald Welte1-1/+1
Our T3113 timer default of 60s was set early in the development of OpenBSC, where we didn't really know what values to use and used excessively large/safe values. Paging the same MS for 60 seconds (even if there's no paging response) will however create a lot of PCH load for no good reason. It seems there's no clear guidance as to what the value should be. Other implementations use something in the order of 10 seconds (OpenBTS, yateBTS), which seems more realistic. THe Siemens BS-11 has a default of 5 seconds. Let's be conservative and go to 10s as a default, which is already 6 times less potential PCH usage than our default so far... Closes: OS#2756 Change-Id: If9c8441939c6fdcf6e2b9ede8cc576eb86296209
2017-12-14libbsc: paging: more reasonable (and detailed) paging statisticsHarald Welte3-10/+23
Counting the number of T3113 expirations (one per subscriber per BTS) vs the number of paging attempts (Bsc global) is a ueseless figure, as you cannot relate each other. We count on the BSC level: * how many PAGING we received from the MSC (total) * how many of those were for cells/LACs we don't serve * how many of those resulted in PAGING RESPONSE We count on the BTS leve: * how many PAGING CMD we sent to the BTS (total) * how many of those we ignored as we were already paging * how many of those resulted in PAGING RESPONSE * how many were expired due to T3113 expiring Change-Id: I410bbcbb2621f95f11238f7a5da01ab438f5fee1
2017-12-14Fix per-BTS counter group indexHarald Welte1-1/+1
I discovered that the per-BTS counter group could only be requested for BTS 0 but didn't work for any further BTSs. This is a bug introduced in Change-Id I5bd9e6e333b1c396beae46630986b17e7f8b82ef where we introudce the per-BTS counters,t but allocate all of them with index '0'. Change-Id: I1b56f8d7b47597ed263e6808074483edca0895de
2017-12-13cosmetic: osmo_bsc_mgcp: improve commentsPhilipp Maier1-2/+7
Make the comments for struct mgcp_ctx more expressive Change-Id: Ie80b4915055e3f944ff1870c38e3609197ab72b2
2017-12-13paging: paging_flush_bts: be sure pending_requests is initalizedPhilipp Maier1-0/+2
The BSSMAP reset causes the paging requests to be flushed. When this happens right after startup then calling paging_flush_bts() may be called when the list bts->paging.pending_requests is not yet initalized, which causes a segfault. Call paging_init_if_needed() to be sure that the list is inizalized (like the other functions also do) Change-Id: I42ddbfdec6f9d74d858ad13cc38b5b64061d08dc
2017-12-13fix segfault upon release paging on BSSMAP Reset: init llistNeels Hofmeyr2-1/+8
Initialize the llist head gsm_bts->paging.pending_requests at the time gsm_bts is allocated, not only at paging_init_if_needed(). The gsm_bts->paging sub-struct is invalid as long as gsm_bts->paging.bts doesn't point back to bts. Hence the recently added iteration of gsm_bts->paging.pending_requests should have checked whether bts is NULL. The llist_head pending_requests is not initialized unless paging_init_if_needed() has been called (and paging.bts is hence set). However, this fix is a safer way to prevent errors like this in general. The segfault was introduced by d382bf63e2b7e28fe41c5310c26fe584f0356897 / If3f53d3bb66ad2dc02db823cb813590c6b59c700 Related: OS#2747 Change-Id: Idfafac4e2c0e0a241a62aecbbdc22be71febf840
2017-12-12Generate SI2bis Rest OctetsMax4-2/+20
According to the spec it's an empty 1-byte element reserved for future extension but we still have to generate padding properly. Add stub function similar to the used for SI2ter and adjust test output accordingly. Related: OS#2711 Change-Id: I3c278c57880a173df3c4648c9724339d23ce94fd
2017-12-11paging: Stop all paging if MSC sends us BSSMAP RESETHarald Welte3-0/+29
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 Welte4-54/+28
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-11paging.c: add more documentation on what the functions actually doHarald Welte1-4/+45
This was created during code review towards some upcoming fix for OS#2736. However, it's not really related to that. Change-Id: I68d4fc8baaedd1d64cd628b2441c57ebc64ecebc
2017-12-11Change T3101 default from 10s to 3s.Harald Welte1-1/+1
This timer is started when a channel is allocated with an IMMEDIATE ASSIGNMENT message. It is stopped when the MS has correctly seized the channel. Ever since the early days of development we were using a very long timeout to be on the safe side. However, in production networks this is a terrible waste of resources, as we will occupy 10s worth of air-time on one of our channels for each RACH request we receive. The only scenarios where you might need something absurdly high as 10s would be if you have 8s of RTT between your BTS and the BSC. See also https://osmocom.org/projects/osmobsc/wiki/Timers Change-Id: If3c52a7cf0c06d074c44a2fc414679279189aab9 Closes: OS#2733
2017-12-11Generate SI2ter Rest OctetsMax4-2/+22
Previously we simply omitted SI2ter Rest Octets which is spec violation which lead to 'Malformed Packet' error in Wireshark RSL dissector. Fix this by generating empty 'no rest octets' with proper padding. Adjust test output accordingly. Change-Id: Ie4419aaaf93a462f501f8d8f7bf2677d37c58f94 Fixes: OS#2711
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-10OML: expand status reporting checksMax5-1/+22
* check GPRS state: if GPRS is enabled for the BTS but NSE, CELL or both NSVC are locked than report it as degraded * check TRX usability: use already available function to check that TRX is actually usable when reporting OML status via CTRL * fix tests linking: libbsc is using gsm48_create_mm_serv_rej() which is defined in libcommon-cs but neither libbsc itself nor tests using it are actually linked against libcommon-cs Related: OS#2486 Change-Id: I9dce1d3b0cabe149a90cfca58a3fe55f8d6a72bc
2017-12-09Remove 'msc' counter group from BSCHarald Welte2-59/+0
This is left over from the OsmoNITB days. We're defining and allocating these MSC counters, but never actually using them. This also means that the automatic counter export will list them, raising the expectation at users that such counters could be used in OsmoBSC. Let's remove them. They are in OsmoMSC, but not OsmoBSC. Change-Id: I5bd9e6e333b1c396beae46630986b17e7f8b82ef
2017-12-09rate_ctr: Use ':' as separator, not '.'Harald Welte1-18/+18
In more recent versions of libosmocore, we are converting any '.' in [rate] counter names to ':' to avoid clashes with the special meaning of '.' in the CTRL interface. Let's avoid any conversion and use the proper name already here. This also changes the codec_foo counters to codec:foo to follow the notation of other counters. Change-Id: I18916abbfc706b86bd211e7cca1a0ca3099826e9
2017-12-09Move many counters from BSC-global to per-BTS granularityHarald Welte7-46/+69
We used to have a lot of counters only globlly per BSC, but they're much more useful on a per-BTS level. Change-Id: I954b9dda72b83b91d46a934c221a8b3375743599
2017-12-06use _NUM_CHREQ_T to define the size of ctype_by_chreqAlexander Couzens1-1/+1
Make it future compatible for changes. Otherwise it will break when additional enums are adding to chreq in libosmocore. Depends on libosmocore Id67ba8de89dd6288e449197438e9e1c5d7f5a134 Change-Id: I2acab2af8d67bccb2bc495512c1f259ae649a832
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