aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
AgeCommit message (Collapse)AuthorFilesLines
2017-03-09implement utran security mode with vlrNeels Hofmeyr2-22/+32
Change-Id: Ib1e285b54cd7aaa0895e9c51a47720f446a07183
2017-03-09move iucs_ranap.[hc] to include / libmsc to use in msc_vlr testsNeels Hofmeyr2-0/+121
Change-Id: I99ca36857f5e4c9ae113017955611fd92256123c
2017-03-09vlr: allow setting assign_tmsi per-subscriberNeels Hofmeyr1-1/+2
Change-Id: I7469da0ed19e1e8b292422aadfd3ae2ebc2afd57
2017-03-09ensure authentication is required on UTRANNeels Hofmeyr1-5/+8
Change-Id: I9b9ad1379324f1405bd02a05fcd7ef8c53bacbde
2017-03-09vlr on utran: transmit CommonIDNeels Hofmeyr2-1/+15
Change-Id: Ice3c71f048b097f2c2de8bd4f4508a7ca2cb1cf5
2017-03-09msc: decouple from bsc_api and btsNeels Hofmeyr2-6/+6
Change-Id: I3564291a6d20da13a8d75c71b0c425da4948d412
2017-03-09Make the code work so that the msc_vlr tests passNeels Hofmeyr11-348/+131
Change-Id: Ie8814d856bbe4c111007a696a4d26576854c134f
2017-03-09mark fixme: rate countersNeels Hofmeyr1-0/+3
Change-Id: I45651fd4cf3f4da8ad67251bbb3b627888e76d9c
2017-03-09mgcp parsing, set port from mgcp responseNeels Hofmeyr1-2/+4
Change-Id: I90e2c1aa7575d5fa6e0374f5022cbb25fc3f7699
2017-03-09mgcp parsing, mgcp testNeels Hofmeyr1-49/+95
Change-Id: Ibe2ab17b3fa3a506a2e841ba979ea4175e3a21e8
2017-03-09mgcp: handle responses from the MGCP GWNeels Hofmeyr1-4/+44
Change-Id: I5c0493feaec775461b5a017c36b93cc2ad63c896
2017-03-09IuCS and IuPS: add VTY config for RAB Assignment address kindNeels Hofmeyr2-1/+5
To accomodate the ip.access nano3G without having to recompile, make the RAB Assignment's Transport Layer Address IE's format configurable, in both osmo-msc and osmo-sgsn. The long term perspective is to somehow detect which address encoding a given 3G cell prefers, but for the time being just configure it globally and set each ue_conn_ctx to the global setting upon creation. Add VTY command to iu_vty.c, with args passed to iu_vty_init() to insert at an arbitrary VTY node, so that it can be used both for osmo-msc and osmo-sgsn. Add generic iu_vty_config_write() to write out the config. Call iu_vty_init() from msc_vty_init(); msc_vty_init() is in libmsc, hence linking of osmo-msc now needs libiu to come after libmsc, so move that further down. Change-Id: I93728314742b327336f3fb6de98e6457f687e1f9
2017-03-09IuCS, IuPS: move flag to use X.213 NSAP addr into ue_conn_ctxNeels Hofmeyr1-3/+5
The future perspective is to remember the preferred RAB Transport Layer Address encoding for each 3G cell that is connected, so store per UE conn instead of globally hardcoding. Add rab_assign_addr_enc member to ue_conn_ctx. Thus the iu_rab_act_cs() and iu_rab_act_ps() functions no longer need the explicit use_x213_nsap argument. Add include/openbsc/common.h in order to define the enum nsap_addr_enc, in a separate file to be able to easily include it in all of libmsc, libiu and gprs/* without creating include cycles. Set the rab_assign_addr_enc when an MM ctx is created for iu, and whenever the ue_conn_ctx for an Iu MM ctx is updated. This looks a bit clumsy so far, the hope is that there will be a nice way to setup the ue_conn_ctx prior to that. Change-Id: I49bb5736df7bdfdd55d3e7b74ee559595cfd2f7d
2017-03-09IuCS: rapidly release connectionsNeels Hofmeyr2-0/+7
Do the same as we do in 2G: release the connection as soon as nothing else is pending for a given subscriber. Before, osmo-msc would wait for the UE "to get bored" and send an Iu release. But the CN should stay lean on connections. Also, 25.413[1] in section 7, 6th point states: "While the Iu release is managed from the CN, the RNC has the capability to request the release of all Iu connection resources from the corresponding Iu connection." So far we did not manage Iu release from osmo-msc at all. Use the same mechanism we use in 2G: from msc_release_connection(), just before freeing the gsm_subscriber_conn, invoke a CN initiated Iu Release command to the UE. This works around OS#1816 ("USSD only works when IuCS is released", on nano3G), because the Iu conn is now released right after every signalling, so that typically no two requests will use the same conn. In iu.h/iu.c, add iu_tx_release(), absorbing almost all of the code from ranap_handle_co_iu_rel_req(). Add stub to db_test.c, necessary to build it without linking libiu. [1] 3GPP TS 25.413 v12.4.0 Release 12 / ETSI TS 125 413 V12.4.0 (2015-04) Related: OS#1816 Change-Id: Ic12bd6f3666f6fd42bd6d9fdae1c93abee3b6786
2017-03-09IuCS: don't remove Iu conn until release FIXMENeels Hofmeyr1-0/+6
Don't remove the gsm_subscriber_connection without an Iu Release. The 2G paradigm is to close a subscriber connection as soon as nothing else is pending. In 3G however, the conn is often discarded even though the IuCS stays open and valid, which confuses the situation: before the UE releases a bit later, we would try to page the subscriber unsuccessfully, because the UE expects to already be connected. To first fix the discrepancy of Iu vs. subscr release, never discard gsm_subscriber_connections when msc_release_connection() is called. This creates a "lazy" CN that keeps connections open as long as the UE will tolerate. It is really fast in sending many SMS in close succession, but is certainly a bad CN design choice: we should rather stay lean on connections. A subsequent commit will change this, but I decided to keep this commit as a reference, for when we'd like to test situations that should re-use an established connection. Change-Id: I012378cfa432d791146db387554ec1909de05297
2017-03-09IuCS: store assigned rab_id in gsm_subscriber_connectionNeels Hofmeyr1-2/+3
Change-Id: I7fda4304631fc24bbd1bebe911b8403a942fcf53
2017-03-09bridge calls via mgcpgwNeels Hofmeyr2-2/+30
Change-Id: Ie259e30bc532fe9817c96562022ac33443d5747a
2017-03-09also do call assignment for MT calls, upon Call ConfirmedNeels Hofmeyr1-0/+2
Change-Id: I863fa73948f61aaffd7f4472f3abc3e44228e31f
2017-03-09IuCS: implement msc_call_assignment() for IuCSNeels Hofmeyr1-1/+81
Send IuCS RAB Activation upon MNCC_CALL_PROC_REQ. Implement function msc_call_assignment(): decide between sending A-iface BSSMAP Assignment Request or IuCS RAB Assignment Request. Implement iu_rab_act_cs() to send the IuCS RAB Assignment Request. The IP address and port of the MGCPGW sent in the RAB Assignment are still hardcoded. The A-interface extension is not implemented yet. Declare ranap_new_msg_rab_assign_voice() to avoid including ranap_msg_factory.h, which would require adding ASN1 CFLAGS to Makefile.am. The mgcpgw_client as well as some more osmo-iuh functions are now linked from libmsc, hence add some dummy stubs to libiudummy and db_test.c. Change-Id: Iaae51d1fbbfc28fad1c0b85e161d53d80a420a19
2017-03-09msc: add mgcpgw client (with dummy read cb so far)Neels Hofmeyr1-0/+4
Store the mgcpgw client data in struct gsm_network. Initialize VTY and bind the client. Change-Id: Ifc4efb1ca44fa34c29bf23b35addb54155296d68
2017-03-09IuCS: cosmetic prep for msc_call_assignment()Neels Hofmeyr2-3/+14
Rename gsm48_cc_tx_call_proc() to gsm48_cc_tx_call_proc_and_assign() to mark the place where the A-interface will send a BSSAP Assignment Request / where the IuCS-interface will send a RAB Assignment Request. Add function msc_call_assignment() to decide between A-iface and IuCS assignment, to be implemented in subsequent commit. Change-Id: I0695e233d57d13658793b0e63bb7c3ff224909a0
2017-03-09IuCS: send RANAP CommonIDNeels Hofmeyr1-0/+19
Add libiu function to send a CommonID message down a UE connection, iu_tx_common_id(); add also a corresponding stub to libiudummy for linking with tests. Add libmsc function msc_tx_common_id() to call the above. Add this mostly to clearly indicate in msc_ifaces.h that libmsc is calling out of the MSC; also to do conn->via_iface checking. Call msc_tx_common_id() after ciphering is established, in _gsm48_rx_mm_serv_req_sec_cb()'s GSM_SECURITY_SUCCEEDED case. Change-Id: I576ddd5bbabfc989149debd2f8a9743db6d26043
2017-03-09cosmetic: make gsm0408_loc_upd_rej() staticNeels Hofmeyr1-1/+1
2017-03-09LU counters: count completion and failure, not messages sentNeels Hofmeyr2-8/+4
From a human admin viewpoint it doesn't make sense to count the messages sent: When we use TMSIs, we first send a LU Accept with a new TMSI, and then expect the MS to respond with a TMSI Realloc Complete message. When that fails to come through, the LU actually ends in failure, even though a LU Accept was sent. In 3G, if a UE sends an Iu Release during LU (e.g. user enables flight mode), we cancel the LU without sending any reply at all, so nothing would be counted. Instead, count Location Updating results, i.e. completion and failures.
2017-03-09remove handle_abisip_signal()Neels Hofmeyr1-71/+0
Change-Id: I9cf80f9c2c8a53a29e42f000029e680a9922cb41
2017-03-09gsm0408_clear_request(): actually free the released connNeels Hofmeyr1-0/+2
By having conn->in_release == 1, calling msc_release_connection() has no effect and thus never frees the conn. So, after all pending requests have been discarded, also discard and free the unused connection.
2017-03-09add iu.h to gsm_subscriber.cNeels Hofmeyr1-0/+1
Change-Id: I398aaa4a7328a58fb0d563725f3bea26482929ef
2017-03-09gsm_04_08.c: iu.hNeels Hofmeyr1-0/+1
Change-Id: I624612b5d5cd70770326347634aee2a42ba88945
2017-03-09gsm_04_08: remove apply_codec_restrictions() -- TODO really?Neels Hofmeyr1-28/+0
This function is wrongly placed on the MSC level. Unfortunately I cannot remember the very plausible details that hwelte had back in the days to argue for this change. (Refactoring an old commit that fails to explain in more detail.) Change-Id: I82623847e652a59a921d2fb142b77cf22420a746
2017-03-09include msc_ifaces.h in gsm_04_08.cNeels Hofmeyr1-0/+2
Change-Id: I11be1bdfe6993f89b34319e7d1526c729d6e0cde
2017-03-09complete IuCS paging implementationNeels Hofmeyr2-32/+82
Add paging timeout to struct gsm_subscriber. Previously, paging timeout was implemented only on BSC level, where each request has its own timeout value. The MSC will still send individual requests to BSC or RNC level, where they timeout individually. However, the MSC must also have an own timeout to be sure to discard stale pagings that the BSC or RNC never replied for. Add handle_paging_resp(), copying the few libmsc relevant parts of gsm48_handle_paging_resp().
2017-03-09paging: actually verify subscriber authorizationNeels Hofmeyr1-1/+8
Before this, any paging response would be accepted by the CN, without checking the database whether the subscriber is in fact authorized. The probability that a subscriber would be able to take unauthorized action is slim, nevertheless checking authorization status with the database should happen before we accept a connection.
2017-03-09paging: change subscr_paging_cb() into subscr_rx_paging_response()Neels Hofmeyr1-26/+5
Remove one layer of callback indirection in paging. When a paging response arrives, we always want to first secure the connection, thus a fixed subscr_rx_paging_response() function is more appropriate and avoids having to store a cbfn. The actual actions to be taken upon successful paging are of course still in callback functions stored with each subscriber. Remove paging_request_stop() call from subscr_paging_dispatch(), which stops paging on all BTSs, which is not the responsibility of libmsc. Change-Id: Ic2c785c9cc48b2c2c6557cbe1060d25afa89e38d
2017-03-09Iu auth wipNeels Hofmeyr1-0/+25
Change-Id: I44effcca80dc6850178174dc957bcd5608b0ae14
2017-03-09subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr2-3/+6
Change-Id: Ife8e10b240693a8d369139881774f1892044aa65
2017-03-09move subscr_request to gsm_subscriber.hNeels Hofmeyr1-15/+0
Change-Id: Idbbd39b0e068da17aafa97e315143509c69c50ea
2017-03-09cut off libbsc paging, pending paging in libmscNeels Hofmeyr2-0/+16
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. Change-Id: I8b6920ddc54fc3f2876a59664e6722666d8a8a4a
2017-03-09libmsc: duplicate gsm0808 / gsm48 functions (towards BSC)Neels Hofmeyr3-6/+51
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 relatd to msc_gsm0808_tx_cipher_mode() in two places. Change-Id: I5b276853d3af71f5e3f0a031fd17b4fff0580020
2017-03-09Use new msc_tx_dtap() instead of gsm0808_submit_dtap()Neels Hofmeyr3-8/+8
Aim: msc_tx_dtap() shall redirect to IuCS or A interfaces depending on subscr conn. Change-Id: I30d961f16eb7b9c0ab9cc3f43198098d3f1a909f
2017-03-09msc_compl_l3(): publish in .h, tweak return valueNeels Hofmeyr1-10/+12
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 Change-Id: If24007445899e9c75553a0dbf843ada3566b3380
2017-03-09add msc vty, remove nitb vtyNeels Hofmeyr3-10/+175
Change-Id: I8f8980d6cfbf26f1b0e0197939833e55dbe521fb
2017-03-09add iucs.[hc]Neels Hofmeyr2-0/+198
Change-Id: I88e981f4c31393a98ae8d61176c65c9251a6f28b
2017-03-09gsm0408_loc_upd_rej(): remove bts use (used only for debug log)Neels Hofmeyr1-4/+2
Change-Id: I3ac38f4b701ad8308470573260fa91a4b04c2f18
2017-03-09gsm_04_08, gsm_subscriber: decouple lac from btsNeels Hofmeyr1-2/+1
The idea is to not have a direct pointer to a bts struct (into BSC land), but a LAC to resolve the BSC or RNC depending on the appropriate A or IuCS interface. subscr_update(): remove bts arg, add lac arg. Pass conn->lac to gsm48_generate_lai() instead of bts->location_area_code. Change-Id: I9f2b298a785bf4b2a1b3fcdd91b8256106b2d9de
2017-03-09libmsc: iucs dev: disable large parts of the codeNeels Hofmeyr5-0/+91
Change-Id: I3ef6ca26150b6102a0fa22a88a60d9a442d640b4
2017-03-09Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication.Neels Hofmeyr3-0/+86
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]"). Change-Id: Idf8020a30562426e8f939706bf5c2188d5a09798
2017-03-09don't use lchan in libmscNeels Hofmeyr2-12/+12
Change-Id: Ic7ed7faa2bcc7aae799f41ed4abc2c001bfb61b7
2017-03-09gsm_04_08.c: Don't set msg->lchan nor msg->dstHarald Welte1-34/+0
the BSC-side of the API behind gsm0808_submit_dtap() is doing this resolving again anyway. So let's avoid doing it twice, and avoid having more dependency of the MSC down into the lchan details. Conflicts: openbsc/src/libmsc/gsm_04_08.c Change-Id: I14254be68ee1a48e9f1ce968233414d86c6ba9d5
2017-03-09gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr1-1/+1
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. Change-Id: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
2017-03-09vlr: get SMS working, by SMS recipient MSISDN round-robinNeels Hofmeyr3-56/+84
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. Change-Id: I1acf9debb6ba9164e6edcfd5bc5e48e8c98f2b01