aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc
AgeCommit message (Collapse)AuthorFilesLines
2017-07-25a_iface: remove unused variablePhilipp Maier1-1/+1
Change-Id: If964ac5344fa0275c07755b5a43d37ce186d3ca2
2017-07-25osmo-msc/a_iface/reset: add missing constPhilipp Maier2-27/+32
Change-Id: Id75918dfd891d9407a62a0b7cd9590932c858093
2017-07-25osmo-msc/a_iface: add missing assertionsPhilipp Maier2-0/+22
Change-Id: If9eac28f70522edc42a9f169a7d12fed5936fb62
2017-07-25osmo-msc: remove orphanned struct membersPhilipp Maier1-8/+2
Change-Id: I229946cfe4ffa6de982586b1c2fa1117c3260e3a
2017-07-25osmo-msc: rename called/calling address in struct a_conn_infoPhilipp Maier2-13/+13
Change-Id: I1b28652662d83f52db21cb78b512c501c7adf4bb
2017-07-25osmo-msc: finish msc-sided resetPhilipp Maier2-80/+223
finish the implementation for msc sided reset, automatically register connecting BSCs. Ensure that all sccp connections are cleared when the reset procedure executes. Change-Id: Iba3f5523795c6972600bbfda2a02b06ba84ea12d
2017-07-25mgcp: Fix missing call id in DLCXPhilipp Maier1-4/+7
The call id field in the DLCX message is missing. Use the endpoint id as call id in all CRCX and DLCX messages. Change-Id: I8b78b76126c63c4882e982c64c3953dbe1dab179
2017-07-25aoip: don't use iu struct: move rtp ports from .iu to new subscr_conn.rtpNeels Hofmeyr3-7/+7
Change-Id: Ib1a84b0733655b2e87c1598ae9df0640cdca833b
2017-07-25aoip: don't use iu struct: do not allocate unnecessary ue_conn_ctxNeels Hofmeyr1-8/+4
Change-Id: I06c4c3eac3cf95cef78d49f1462096d6350f226a
2017-07-25AoIP+3G: use one common SCCP client for A and IuCSNeels Hofmeyr1-12/+2
Move osmo_sccp_simple_client() setup out of iu_init() and a_init(). In msc_main.c and sgsn_main.c, initialize the STP connection first and then pass to iu_init() and a_init(). This allows serving 3G (IuCS) and 2G (A) from one and the same MSC instance. Since both OsmoHNBGW and OsmoBSC are using PC 23 by default now, move BSC to PC 42 (because OsmoBSC typically has vty port 4242, bla). Also: a_iface.c: remove now unused defines a_init(): remove osmo_ss7_init() call that duplicated msc_main.c Change-Id: I963a94e1a0bfc455992d22940dcc9c67c44570b9
2017-07-25a_init: use name arg for sccp client and user bindNeels Hofmeyr1-2/+2
Change-Id: Ie281e8a486471e1d48a1444a07795e97c17627f2
2017-07-25a_iface: fix typo in function namePhilipp Maier1-2/+2
Change-Id: Ia545a0daec6336732f1bcaa01e27c843eb732dd8
2017-07-25a_iface: Check if channel type and speech codec list are successfulPhilipp Maier1-4/+17
Currently we do not check for errors during the generation of channel type and speech codec list. This might blow an assertion in gsm0808_create_ass if the generated data is invalid. So we need to check beforehand. Change-Id: Ifa7ba00e0d731a3c43a8dbfac893c71d63559eb5
2017-07-25apply function renames in merged libosmocore patchesNeels Hofmeyr1-1/+1
Change-Id: Ic659d6d79a6284732e1837f8b0947e8a128ddd87
2017-07-25cosmetic: make function names in a_iface_bssap more expressive.Philipp Maier2-31/+31
The function names in a_iface_bssap.c are not very expressive. The problem not only exists on the API side, but also for static functions. This patch replaces the function names with more expressive names. Change-Id: I1cdf37e4034ed8a9536c253c13910fc436c66f04
2017-07-25cosmetic: 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. Change-Id: I6af4b7deed9d11ac5fe188eb5625fba50caad7c1
2017-07-25fixup: return with value in void functionPhilipp Maier1-1/+2
Change-Id: Iab2569205eac9cb96a7d6f756f087413af5fc68c
2017-07-25mgcp: make bts base port configurablePhilipp Maier1-3/+9
Currently the rtp base port of the BTS is hardcoded (4000) and not configurable. This patch adds VTY configuration options to make it adjustable. Change-Id: I76e008eb0bd95b2941b67ea2fbdc1a82eef3cc5f
2017-07-25Revert "mgcp: make sure all endpoints are closed on startup"Philipp Maier1-18/+0
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. Change-Id: Ia3bd8bfe9a09e300cf11629f7d7e3012ca8f394d
2017-07-25mgcp: 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. Change-Id: I7990e9e7c4c8101b8772ab5505a7cc11f8f7cd23
2017-07-25a_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. Change-Id: Ic2b43b937d08a6dea4fe70dbc3eb722323338dc1
2017-07-25mgcp: make sure all endpoints are closed on startupPhilipp Maier1-0/+18
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 Change-Id: I9de2f67ffe08b2d76574ef4470c7a9767ca74702
2017-07-25mgcp: 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. Change-Id: I346affea940efb3a55e9b34c28a6cbe676d57d56
2017-07-25mgcp: 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. Change-Id: Ifc5a7a62fc07b4b7fee612d52e949fcd6a8e04ed
2017-07-25cosmetic: fixing coding stylePhilipp Maier1-3/+3
Change-Id: I9dc3b1d2990ad6c89932d77632c3b22748e8361e
2017-07-25osmo-bsc: Handle RESET/RESET-ACK properlyPhilipp Maier2-1/+30
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 Change-Id: I876319b15103cc395e74597a52ce4d1a934915f4
2017-07-25sccp: Use osmo-stp instead of direct server/client connectionPhilipp Maier1-12/+14
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. Change-Id: I2b02bf159051beed6ff3afc66fcfb7a30e8d2541
2017-07-25fixup for: aoip: signal channel type to BSCPhilipp Maier1-5/+30
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 Change-Id: I5c422a1e831f572e493db9756cf45e7a0b7ec7d0
2017-07-25aoip: 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. Change-Id: I642480fa408dee7a4f40f7aab95f40383b3e91af
2017-07-25osmo-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. Change-Id: Ib61cf2987823958314c9016d5a3f494c1aaaabbc
2017-07-25fixup: Hexdump for incoming unit data was missingPhilipp Maier1-0/+1
Change-Id: Ie867455f12eba5b5091424796a9dbf5140890e41
2017-07-25WIP: Integrate AoIP into MSCPhilipp Maier5-35/+857
Change-Id: Iaf7deff397ec95b744fe287e713bbdd6a1ee73cf
2017-07-25libmsc: 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. Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5
2017-07-25WIP: Port to new libosmo-sigtran API (with proper M3UA for Iuh)Harald Welte1-13/+11
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. Change-Id: I450e22d46e47eec350a152f7832428f226bf17fc Tweaked-by: nhofmeyr (test expectation)
2017-07-25log protocol discriminators and message types by nameNeels Hofmeyr1-6/+8
Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
2017-07-25Implement IuCS (large refactoring and addition)Neels Hofmeyr15-294/+928
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: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-07-25mscsplit: various preparations to separate MSC from BSCNeels Hofmeyr12-856/+234
Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. 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. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. 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. Employ fake paging shims in order for msc_vlr_tests to still work. 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 gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c
2017-07-23Use libvlr in libmsc (large refactoring)Harald Welte19-2998/+1523
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 trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. 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. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050
2017-07-21Add libvlr implementationHarald Welte2-1/+269
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 trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
2017-07-13logging: auth request: use hexdump without spaces for RAND, AUTNNeels Hofmeyr1-2/+2
Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81
2017-07-12move openbsc/* to repos rootNeels Hofmeyr26-0/+14136
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