aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
AgeCommit message (Collapse)AuthorFilesLines
2017-06-18cosmetic: more expressive function names in a_ifacePhilipp Maier4-12/+15
The function names if the API function in a_iface.c are not very expressive. Besides of that, the prototypes are in the wrong header file. This commit gives the function more expressive names and moves the prototypes in the right header file.
2017-06-18fixup: return with value in void functionPhilipp Maier1-1/+2
2017-06-18mgcp: make bts base port configurablePhilipp Maier3-3/+32
Currently the rtp base port of the BTS is hardcoded (4000) and not configurable. This patch adds VTY configuration options to make it adjustable.
2017-06-18Revert "mgcp: make sure all endpoints are closed on startup"Philipp Maier3-24/+1
Clearing all endpoints by sending a DLCX on startup has ben found to be a bit too offensive. It also will not help against inconsitancies that may occour during runtime (e.g. an overheard DLCX during regular call teardown). This reverts commit b669ea94cb78fd9b56ee8dd9392538151349f8ba.
2017-06-18mgcp: Make sure endpoint is free on CRCXPhilipp Maier1-0/+11
The MSC is aware of the assigned endpoints at all times, so it will not assign an occupied endpoint to someone else. However, if it has just restarted, there maybe lingering open endpoints. This patch introduces a fairly simple soultion. Before a new endpoint is seized (CRCX), a DLCX is send in advance. If the endpoint was still occupied with a dead connection, it will be freed. If it was free anyway, the DLCX will just have no effect.
2017-06-18a_iface_bssap: clear lingering subscriber connections on resetPhilipp Maier1-2/+26
When the BSC is vanishing, the subscriber connections will stay active until the MSC is instructed via tha A interface to clear the connections. Unfortunately, this will most likely not be the case because the BSC will most likeley have lost all its state and does not know about the old connections anymore. This patch fixes the problem by looping through the list with the active gsm subscriber connections and clearing them manually when the reset from the BSC is received. Only connections by the bsc who actually executes the reset are affected. Connections from other BSCs will not be touched.
2017-06-18mgcp: make sure all endpoints are closed on startupPhilipp Maier3-1/+24
If the MSC is crashing and restarting, it may leave some endpoints open. The endpoints can not be re-used until they are deleted (DLCX). This patch sends a DLCX to all possible endpoints (usually this is in a countable range) in order to clear possible open endpoints from a previous run
2017-06-18mgcp: make structs accessible from outsidePhilipp Maier1-14/+0
struct mgcpgw_client and struct mgcp_inuse_endpoint are not accessible from outside, making it difficult to look in the mgcp client properties and status. The commit moves the structs into the header file.
2017-06-18mgcp: release no longer used endpoint identifiersPhilipp Maier1-1/+4
When an MGCP endpoint is deleted, we need to mark its endpoint id as unused, so other calls can used it. This is currently not happening. This patch fixes that.
2017-06-18mgcp: improve endpoint managementPhilipp Maier2-5/+97
Currently the assignment of endpoint identifiers works by just incrementing a counter. The mgcpgw only has a limited amount of endpoint identifiers avaliable, this means we will run out of endpoints after only a few calls. This commit adds a mechanism to keep track of used endpoint identifiers so unused endpoint identifiers can be re-used
2017-06-18mgcp: use mgcp DLCX command to terminate endpoint after call is donePhilipp Maier2-0/+17
Currently no DLCX command is sent to the mgcpgw when a call is over, this leaves the endpoint open. This means that the endpoint can not never be reused by other calls. This patch adds a DLCX that terminates the the endpoint when the call is done.
2017-06-18mgcp: add DLCX command to mgcpgw clientPhilipp Maier1-0/+10
The mgcpgw client currently lacks support for DLCX. This patch adds a generator function to generate a DLCX command as well.
2017-06-18cosmetic: fixing coding stylePhilipp Maier1-3/+3
2017-06-18osmo-bsc: Handle RESET/RESET-ACK properlyPhilipp Maier6-53/+302
Improve the way the BSC executes its RESET/RESET-ACK sequence. Currently only a simple bool variable serves as a state holder. We set this variable to true when we receive the RESET-ACK message. Unfortunately no further checking is done. This patch replaces the old mechanism with a more elaborated implementation which also detects a loss of the connection and makes sure to reconnect properly afterwards. Also the all open connections are closed on connection loss
2017-06-18sccp: Use osmo-stp instead of direct server/client connectionPhilipp Maier2-14/+15
This patch adjusts the code to use osmo-stp. This is only an intermediate solution, since we still have hardcoded parameter. Next step is to use the VTY options from libosmo-sigtran to issue the configurations.
2017-06-18fixup for: aoip: signal channel type to BSCPhilipp Maier3-66/+204
The channel type and the speech codec element is now signalled to the BSC. The BSC checks both fields and select a codec by its preference. The choosen speech codec and the choosen channel (type) is returned to the MSC. Currently the MSC ignores the return values
2017-06-18aoip: signal channel type to BSCPhilipp Maier2-6/+136
obtain the permitted speech and the prefered channel parameters and signal it to the MSC with the channel type field.
2017-06-18osmo-msc: Integrate A interface into existing call controlPhilipp Maier3-13/+72
The MSC already has some basic call control handling mechanism, that was primarily used with 3G before. However, the already existing code that handles the 3G calls is also perfectly fine for handling 2G calls. This commit integrates the A interface without breaking it for 3G.
2017-06-18osmo-bsc: Negotiate rtp ip address/port with BTSPhilipp Maier3-17/+125
This patch adds the support for the RTP IP-Address/Port assignment. The post communicated via the assignment request is now transmitted via RSL/IPACC to the BTS. The Response containing the RX-Port at the BTS side is communicated back to the MSC. Since we plan to add a private MGCPGW to each BSC, this has to be extended. Currently it only creates a direct connection to the BTS. This will be introduced with a future patch.
2017-06-18fixup: Hexdump for incoming unit data was missingPhilipp Maier1-0/+1
2017-06-18comment: fixme to cleanup MGCP portsNeels Hofmeyr1-0/+1
Related: OS#2279 Change-Id: Iaf4877ad1c6446609715094d785e9be93c9e0429
2017-06-18msc: enable basic CTRL commandsNeels Hofmeyr1-9/+2
So far CTRL was not used by anyone, and was still disabled from the initial implementation of the OsmoMSC. Now we need it in osmo-gsm-tester. Only add the MSC specific CTRL commands, the bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: Id8f72000e0f4dea081bfce94fde8cd54290dfa7d
2017-06-18sgsn: add missing osmo_ss7_init()Neels Hofmeyr1-0/+1
Change-Id: I7abe7a96fc4f46757605a75334a3bd240f54faf3
2017-06-18WIP: Integrate AoIP into MSCPhilipp Maier6-36/+863
2017-06-18libmsc: make pitfall in gsm0408_dispatch() more obviousPhilipp Maier1-2/+6
The function gsm0408_dispatch() accepts a message buffer pointer and accesses the l3h pointer. Even in a properly allocated message buffer, this may lead into a segfault if the user forgets to set the l3h pointer. This commit adds assertions to popup a more expressive error message.
2017-06-18WIP: Integrate AoIP into OsmoBSCPhilipp Maier8-39/+456
2017-06-18WIP: Port to new libosmo-sigtran API (with proper M3UA for Iuh)Harald Welte5-94/+98
This changes 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. Only the ASP (client) is used, assuming that both the HNB-GWs and RNCs as well as the MSCs and SGSNs are all connecting as ASP to some STP/SGW which offers M3UA server functionality as well as point-code and/or global title based routing. Tweaked-by: nhofmeyr (test expectation) Change-Id: If0ff956fbf1484899d59ae1a5885543bca31645b
2017-06-18temporary dev: set debug log level almost everywhereNeels Hofmeyr1-17/+17
Change-Id: I0d5a36560e7edde27497de57e579f5b1d00eb525
2017-06-18log protocol discriminators and message types by nameNeels Hofmeyr1-6/+8
Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df Change-Id: If1c49faf6e1757cb16b383dd2db87b48bc94eee6
2017-06-18mgcp: hack RAB success from nano3G: patch first RTP payloadNeels Hofmeyr1-0/+7
The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I31a4475f42d59fd5704d52ee6e473e270db6d779
2017-06-18Implement IuCS (large refactoring and addition)Neels Hofmeyr42-459/+2272
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 mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: Ie13ff348117e892d41b8355ab6c24915301eaeaf
2017-06-18mscsplit: various preparations to separate MSC from BSCNeels Hofmeyr18-251/+346
Disable large parts of the code that depend on BSC presence. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places. Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. In osmo-nitb, paging is done on BSC level and MSC level "at the same time". When the new MSC is fully operational, paging will be controlled separately on the MSC level, and the BSC (RNC) level will be instructed over an IuCS or A-interface to negotiate paging with the MS (UE). This MSC level paging does not yet exist and will be added in subsequent commits. msc_compl_l3(): publish in .h, tweak return value. Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc Change-Id: I9cf80f9c2c8a53a29e42f000029e680a9922cb41
2017-06-18IuPS adjustmentsHarald Welte4-21/+44
SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN sgsn_ranap_iu_event: handle some events without valid MM context sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config IuPS: cosmetic: explicitly check RAN type; move comment Change-Id: I8375ba42dd47d7ccd9ce9290767d6f8653a23b94
2017-06-18osmo-nitb: change default config file name to osmo-nitb.cfgNeels Hofmeyr1-1/+1
Since the VLR development marks a move away from the 'openbsc' name, now is a good opportunity to also change the default config file name to the more accurate and obvious 'osmo-nitb.cfg'. Change-Id: I47658dad59ec38c39be59415db5f648c9e4c79f2
2017-06-18osmo-nitb: change default db name to sms.dbNeels Hofmeyr1-1/+1
libvlr now delegates subscriber management to osmo-hlr, so the database no longer represents a HLR. It basically only stores SMS, so reflect that fact in the default database name. Change-Id: Ibf766d9f7f67aae17f76988d6279da20ad18e4bc
2017-06-18SI3: indicate R99+ MSC to GSM MS to enable UMTS AKANeels Hofmeyr1-0/+3
Change-Id: Iaf11218327f139e8cabfbc5f9916505c66eadbd8
2017-06-18Use libvlr in libmsc (large refactoring)Harald Welte33-2997/+1593
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. TODO: This commit may be split in several smaller changes before merging to master. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Related: OS#1592 Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
2017-06-18Add libvlr implementationHarald Welte12-0/+4311
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. Related: OS#1592 Change-Id: I3f75de5f0cc2ff77f276fd39832dd3621309c4b9
2017-06-18logging: auth request: use hexdump without spaces for RAND, AUTNNeels Hofmeyr1-2/+2
Change-Id: I656d8619a1adc93e2f627f4e1ba21512a7374279
2017-06-18gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr3-5/+16
Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Unrelated cosmetic change while editing the arguments: gsup_client_create()'s definition's oap client config arg name mismatched the one used in the declaration. Use oapc_config in both. Change-Id: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
2017-06-18GPRS/IuPS: remove all 3G authentication dev hacksNeels Hofmeyr2-44/+2
UMTS auth works now with the external OsmoHLR. Change-Id: I1204f388cf1311ec98b3eaf7505d7e18e73f03d0
2017-06-18Add vty command "radio-link-timeout infinite" for uplink rx testingHarald Welte3-9/+74
When we are performing Rx sensitivity testing on a BTS, we want to deactivate the connection failure criterion / radio link timeout, i.e. no matter how many SACCH frames in uplink are failed to decode, the BTS should never close the channel. OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way how this behavior can be requested from the BTS via an OML attribute. This patch adds support to the BSC to actually set that attribute. Do not use this in production networks, as the BTS will keep open radio channels indefinitely even if the phone is gone and no longer transmitting anything. This is a pure testing feature. Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2
2017-06-15bsc_init: Forget which SIs are valid for the trxMax2-4/+11
Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max <msuraev@sysmocom.de>
2017-06-15Update SI data structures and generationMax4-130/+186
To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660
2017-06-15Move SI-related definesMax2-3/+3
* move SI2quater related defines to shared header * add define from OsmoBTS which checks for presence of a given SI message in gsm_bts struct. Rename it to avoid conflicts with OsmoBTS code and to match naming conventions of similar macros. Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Related: OS#1660
2017-06-12OML: fix potential OOB memory accessMax1-2/+2
Use sizeof target BTS feature storage to make sure we always fit into pre-allocated memory. Also use it for log check. Change-Id: Ib107daa6e8b9bc397a10756071849f8ff82455d5 Fixes: CID 170581
2017-06-09Request and parse BTS feature list via OMLMax1-0/+40
Request features supported by BTS when getting attributes over OML. Change-Id: Ic35b2865998bca3c2c0cb4b77e4e73d12e08bd7e Related: OS#1614
2017-06-09Get TRX attributesMax3-37/+76
Request per-TRX attributes in addition to BTS attributes. Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Related: OS#1614
2017-06-09don't re-implement osmo_talloc_replace_string()Harald Welte9-49/+41
osmo_talloc_replace_string() was introducd into libosmocore in 2014, see commit f3c7e85d05f7b2b7bf093162b776f71b2bc6420d There's no reason for us to re-implement this as bsc_replace_string here. Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602
2017-05-31Add remote BTS feature storage and helpersMax2-0/+17
In addition to compile-time defined BTS model features we also need run-time BTS features reported by BTS via OML. This should be shared by BSC and BTS. To accommodate for this, add following: * features bitvec to gsm_bts struct * features descriptions * comments to avoid confusion between 2 feature sets * helper functions to set/query particular feature * upper boundary on number of supported features and assertion for it Change-Id: I02bd317097ba66585c50ebd4e8fc348f6dc3dad9 Related: OS#1614