aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_08.c
AgeCommit message (Collapse)AuthorFilesLines
2014-12-28log: Set the context for paging requests as well.shared/31c3Holger Hans Peter Freyther1-0/+1
2014-12-09msc: Add net parameter to trans_allocJacob Erlbeck1-2/+3
The trans_alloc function still uses the subscr object to access the network object. This patch adds an explicit net parameter to this function and removes the access to subscr to obtain it. Sponsored-by: On-Waves ehf
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-15/+22
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-12-05msc: Don't use the subscriber to access the net objectJacob Erlbeck1-2/+3
Sponsored-by: On-Waves ehf
2014-12-05msc: Add net back pointer to gsm_transJacob Erlbeck1-31/+31
Currently the net pointer is obtained from trans->subscr->net. On the other hand, the list gsm_trans object is managed by the net object. This patch adds the back pointer to the structure and replaces all trans->subscr->net by trans->net expressions. In trans_alloc() the trans->net pointer is obtained from the subscr object. Sponsored-by: On-Waves ehf
2014-08-04MNCC: Add IMSI to CALL CONFIRM messageAndreas Eversberg1-0/+4
LCR requires IMSI to correlate calls for MPTY (multi party conference) and ECT (call transfer).
2014-05-18Add support for AMR frames to MNCC/RTP interfaceAndreas Eversberg1-0/+1
AMR rate is currently fixed to 5.9k.
2014-05-18bsc_api/NITB: If TCH/H channel is used, indicate it to bsc_apiAndreas Eversberg1-1/+2
If we don't do this, OsmoNITB will send an assignment command from a TCH/H to another TCH/H without any need.
2014-05-18Add check to tch_map(), if RTP sockets existAndreas Eversberg1-0/+11
2014-03-20mncc: Add support for half rate V1 frames to MNCC/RTP interfaceAndreas Eversberg1-2/+4
2014-01-31sms/dtap: Add log messages to analyse SMS message lossJacob Erlbeck1-0/+1
Incoming DTAP messages from MS are discarded during silent calls, which leads to the repeated delivery of SMS since the ACKs are not being processed. This patch adds some log messages that have been helpful to track this down. Sponsored-by: On-Waves ehf
2014-01-27Add function to update TRAU muxer after assignment or handoverAndreas Eversberg1-3/+16
E1 based BTS use TRAU muxer to decode TRAU frames. After changing channel from one timeslot to another (due to handover or assignment), the TRAU muxer must be updated. The call reference of the call is disconnected from the old channel and connected to the new channel.
2014-01-16Remove obsolete check of conn and lchan pointers not beeing NULLAndreas Eversberg1-4/+2
The check is removed from gsm48_cc_rx_setup() and gsm48_cc_rx_call_conf(). Receiving a layer 3 message implies that the transaction has a subscriber connection and a logical channel. This patch fixes the Coverity issues with CID 115311 and CID 1155312.
2014-01-14Each BTS can be configured for speech support (other than GSM full rate)Andreas Eversberg1-0/+28
Speech codings which are not supported by BTS will be removed from the bearer capability information element after parsing. This way it is not required for the MNCC application to consider support of each BTS. Only GSM full rate is supported by default.
2014-01-08nitb: Set the DST field in generated MM info messagesJacob Erlbeck1-0/+15
Currently the NET_DST information element (see GSM 24.008) is not included in generated MM info messages even when the DST field in the timezone info has been set via the VTY or the control interface. This patch modifies gsm48_tx_mm_info() to append this information element if (and only if) a non-zero DST has been configured. The DST IE is not part of GSM 4.8. Therefore it will only be sent, if the DST offset is configured to a value != 0. The DST functionality has been verified with wireshark by Jacob. Sponsored-by: On-Waves ehf
2013-12-29mncc: Add the context we get from the MNCC interfaceHolger Hans Peter Freyther1-0/+13
Currently we only set the SUBSCR on RSL messages. Extend it to messages that go through MNCC. For call control/bridging it is difficult to pick the right subscriber. We should support a list or at least two legs in the imsi filter context.
2013-12-27lu crash: Fix a crash that likely occurred during the LU procedureHolger Hans Peter Freyther1-0/+3
conn->loc_operation is already NULL (e.g. due a five second timeout but we are still processing a RSL message after we initiated the release procedure). Do not attempt to authorize a subcriber without knowing the key_sequence. This can cause more problems but we will need to test this in the field. (gdb) bt #0 gsm0408_authorize (conn=0x19fc2f0, msg=<optimized out>) at gsm_04_08.c:323 #1 gsm0408_authorize (conn=0x19fc2f0, msg=<optimized out>) at gsm_04_08.c:319 #2 0x000000000043a99a in mm_rx_id_resp (conn=0x19fc2f0, msg=<optimized out>) at gsm_04_08.c:495 #3 gsm0408_rcv_mm (msg=<optimized out>, conn=0x19fc2f0) at gsm_04_08.c:1041 #4 gsm0408_dispatch (conn=0x19fc2f0, msg=<optimized out>) at gsm_04_08.c:3232 (gdb) p *conn $5 = {entry = {next = 0x1746930, prev = 0x1a14270}, subscr = 0x1745eb0, expire_timer_stopped = 1 '\001', loc_operation = 0x0, sec_operation = 0x0, anch_operation = 0x0, silent_call = 0, put_channel = 0, sccp_con = 0x0, in_release = 0, lchan = 0x7f8c79007218, ho_lchan = 0x0, bts = 0x1719f90, T10 = {node = { rb_parent_color = 0, rb_right = 0x0, rb_left = 0x0}, list = {next = 0x0, prev = 0x0}, timeout = {tv_sec = 0, tv_usec = 0}, active = 0, cb = 0, data = 0x0}, secondary_lchan = 0x0}
2013-12-27periodic/lu: Attempt to implicitly attach a subscriber instead of rejectingHolger Hans Peter Freyther1-4/+17
When modern Smartphones receive "Not in VLR". The baseband firmware apparently does not try to do an IMSI ATTACH but just remains un-happy and will not connect to the network anymore.
2013-12-19Add EFR support to TRAU muxer + test caseAndreas Eversberg1-0/+1
Decoding and encoding of FR and EFR TRAU frames are put into seperate functions. CRC check is done to detect bad EFR TRAU frames. The test case includes FR and EFR transcoding. EFR support was tested with Nokia InSite BTS and Siemens BS11.
2013-11-01bsc: Move gsm48_tx_mm_serv_ack/rej to gsm_04_08_utils.cJacob Erlbeck1-23/+0
These functions are currently located in libmsc/gsm_04_08.c together with other symbols that (transitively) depend on many external symbols (and thus libraries) that aren't otherwise needed by e.g. osmo-bsc. Since gsm48_tx_mm_serv_ack() will be needed by osmo-bsc, these functions are moved to avoid the dependency on gsm_04_08.o. Sponsored-by: On-Waves ehf
2013-10-31Revert "bsc/ussd: Send faked CM Service Accept before sending USSD"Holger Hans Peter Freyther1-2/+2
This reverts commit 61bd965b04e4f00eaf4196eebb4ec6269926d551. No, we should not link to dbi.. and these libraries..
2013-10-31bsc/ussd: Send faked CM Service Accept before sending USSDJacob Erlbeck1-2/+2
The MS do not show the USSD messages yet. This patch modifies the implementation to insert a CM Service Accept before the ussdNotify to finish the establishment of the MM connection according to 3GPP TS 04.10/3.2.1. This fix has been tested with a Blackberry phone that has shown an ussd_grace_txt after rf_locked has been set to '1'. Without this patch, that message wasn't shown. The phone has sent a CC Setup and other messages before processing the channel release message sent by the BSC, but these messages have not been forwarded to the MSC (as expected). Ticket: OW#957 Sponsored-by: On-Waves ehf
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther1-2/+2
The database code should not know about the network. Move the setting of the network pointer into the subscriber layer.
2013-10-04Fix typo in console output: "PEROIDOC" -> "PERIODIC".Alexander Chemeris1-1/+1
2013-08-18Fix: Handle CM service request on already secured channel correctlyAndreas Eversberg1-0/+5
Second part of the previous patch. Log an error message in case we receive a location updating request on an already authenticated channel.
2013-07-27expiration: Speculative fixes for the periodic expiring handlingHolger Hans Peter Freyther1-0/+9
We were expiring subscribers during active calls. This is because the T3212 is stopped under certain conditions but we didn't stop that timer at all. Remember if T3212 timer was stopped due something done by NITB and update the expiration time at the end of the radio connection, as the phone should restart it when returning to MM Idle. It is a bit difficult to decide when we should set the flag. E.g. in a CM Service Request we don't know if we accept the service and during a LU we already send MM messages before we accept or reject the subscriber. The easiest is to set the flag when receiving a paging response on known subscribers and at the end of the authentication process. Do not expire a subscriber that has an active connection that is marked with the flag, e.g. we would still expire a subscriber that is being paged. Manual tests executed/passed: * gst LUTest.st verified that a expiration date was set * gst SMSTest.st (doing another LU but forcing a timeout on the SMS sending). Verified that the expire_lu was updated.
2013-07-11Fix: Handle CM service request on already secured channel correctlyAndreas Eversberg1-1/+2
A CM service request must be acknowledged also, when encryption is already enabled. Without encryption enabled, the security status is GSM_SECURITY_NOTAVAIL, which causes a CM service acknowledge. On initial CM service request, the security status is GSM_SECURITY_SUCCEED, if encryption is enabled. This will not lead to an acknowledge, because the cyphering command implies an acknowlege. An additional CM service request requires an acknowledge, so I added a new security status: GSM_SECURITY_ALREADY
2013-07-06mncc: Remove what we believe to be a tautology from the MNCC codeHolger Hans Peter Freyther1-14/+16
Coverity pointed out that we use trans->subscr after a NULL check, it is our believe that every transaction will have a subscriber. Remove the check and add an assert before we are dispatching things. Fixes: Coverity CID 1040740, CID 1040739
2013-01-25CC: gsm48_cc_tx_release() must not remove callrefAndreas Eversberg1-2/+0
If after release has been sent, the call control layer waits for: - reception of release complete - or timeout - or release of transaction (due to radio link failure) In this case, an MNCC_REL_CNF is sent to upper layer. The callref must still exist, so the upper layer can handle this confirm.
2013-01-25CC: mncc_release_ind() must send MNCC_REL_CNF in state N19Andreas Eversberg1-0/+2
If transaction is destroyed, but callref still exists, the mncc_release_ind function is called. If the upper layer already sent an MNCC_REL_REQ, the state N19 was entered. In this case it expects an MNCC_REL_CNF.
2013-01-01misc: Do not use else when using return in the previous branchHolger Hans Peter Freyther1-1/+1
2013-01-01libmsc: Refuse service to anyone not attachedSylvain Munaut1-0/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-29gsm_04_08: Display debug message correctly on DETACH INDICATIONdaniel/channel-ho-wipDaniel Willmann1-3/+5
Log messages would get mangled before if we receive detach by TMSI or IMSI.
2012-12-26handover: Fix the handover signalling for IP based BTSesHolger Hans Peter Freyther1-13/+20
This was reported by Kevin when he was testing handover. The problem is the order of the signal handlers for S_ABISIP_CRCX_ACK. Right now the handover signal handler is called before the one inside the libmsc gsm_04_08.c. This means S_HANDOVER_ACK is signalled _before_ there is a rtp socket created for the channel. The result is that the MDCX will never be sent and the called will not be properly switched _after_ the handover detection. I do not want to play with the order of signal handlers, remove the CRCX ack handling from the handover_logic.c and force the NITB (and later the BSC) to check if the lchan is involved with a handover and do the switching in there. This means right now we do what two signal handlers did in one. Reproduced and tested with the FakeBTS Handover test. Log message: <0004> abis_rsl.c:1954 (bts=1,trx=0,ts=3,ss=0) IPAC_CRCX_ACK ... <000c> gsm_04_08.c:1400 no RTP socket for new_lchan <001a> rtp_proxy.c:533 rtp_socket_create(): success <001a> rtp_proxy.c:615 rtp_socket_bind(rs=0x48703c8, IP=0.0.0.0): ...
2012-12-22libmsc: Avoid a crash on lchan release during call controlHolger Hans Peter Freyther1-5/+16
If subscriber A is calling B and has sent a CC Setup message we will allocate the MO and MT transaction and link them together. When the BTS or the lchan is failing the BSC API will send a clear request, as part of the clear request all pending transactions will be released. As part of taking down the transaction, the remote leg will be informed and will send a MNCC_REL_REQ. This results in a call to trans_free. The llist_for_each_entry_safe does not handle removing other elements from the list and we would segfault. One way to fix this is to move the transaction list into the subscriber connection. This might require to create the subscriber connection for MT handling earlier. Otherwise one could have one transaction list inside the subscriber connection and a global list for MT- transactions.
2012-12-16nitb: Do not crash on IMSI Detach messages from a phoneHolger Hans Peter Freyther1-1/+0
This has been reported and analyzed by Tobias Engel. The IMSI Detach is dispatched as part of the complete layer3 message. I had patched the code to release the anchor and call msc_release_connection to release the connection as fast as possible (otherwise the anchor would trigger in a couple of seconds). With commit 70ae5d3000edd12aee38497a6f541595a8c7dee8 I made this more generic to release the connection immediately if there are no operations, no transaction and no silent call. This leads to the subscriber connection being released twice and eventually causing a segfault. Remove the msc_release_connection invocation from the IMSI Detach code as the connection will be taken down by the BSC API. This has been tested using the FakeBTS and an IMSI Detach message. The channel is released immediately and the nitb does not crash.
2012-09-11misc: Address compiler warning on unused variablesHolger Hans Peter Freyther1-4/+3
abis_nm.c: In function ‘abis_nm_get_attr’: abis_nm.c:1380:11: warning: unused variable ‘cur’ [-Wunused-variable] abis_nm.c: In function ‘ipac_parse_bcch_info’: abis_nm.c:2588:11: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] bts_nokia_site.c:1310:6: warning: variable ‘constructed’ set but not used [-Wunused-but-set-variable] bts_nokia_site.c: At top level: bts_nokia_site.c:1364:12: warning: ‘dump_elements’ defined but not used [-Wunused-function] gsm_04_08.c: In function ‘mm_rx_loc_upd_req’: gsm_04_08.c:521:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] osmo_msc.c: In function ‘msc_ciph_m_compl’: osmo_msc.c:122:7: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] bts_hsl_femtocell.c: In function ‘hslfemto_bootstrap_om’: bts_hsl_femtocell.c:101:11: warning: variable ‘cur’ set but not used [-Wunused-but-set-variable] bts_hsl_femtocell.c: In function ‘hsl_drop_oml’: bts_hsl_femtocell.c:232:21: warning: variable ‘line’ set but not used [-Wunused-but-set-variable] handover_logic.c: In function ‘ho_chan_activ_ack’: handover_logic.c:197:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
2012-07-16MSC 04.08: RRLP messages are DRR, not DNM !Harald Welte1-1/+1
2012-07-12move BTS-specific timezone override into sub-structureHarald Welte1-7/+7
Group all three structure members involved in bts-specific timezone handling into a sub-structure.
2012-07-10msc: Attempt to release the lchan immediately on IMSI DetachHolger Hans Peter Freyther1-6/+6
The Nokia E71 sends a "IMSI Detach" this msc code does not immediately send the "RR Channel Release", the E71 is impatient and sends a DISC, the "RELEASE INDICATION" is handled by starting the channel release procedure. OpenBSC sends a "RR Channel Release" which will never be answered, during the early release there is no timer and the lchan will be in "RELEASE REQUESTED" forever. This commit removes the anchor operation and checks if the channel can be released immediately. Regarding the channel release handling there is already a branch that needs to be tested.
2012-07-02BSC: introduce new "sysmobts" BTS modelHarald Welte1-0/+3
so far, osmo-bts/sysmobts used to be entered as "sysmobts" type in the configuration file. However, there are some differences in the protocol/behaviour and we should reflect that by a new BTS plugin (with lots of code reuse from the nanobts driver).
2012-04-08introduce HAVE_TM_GMTOFF_IN_TMHarald Welte1-0/+7
Not all architectures have the tm.tm_gmtoff member. This fixes cygwin builds.
2012-01-23Move the bulk of RR processing from MSC into BSCHarald Welte1-107/+3
RR Messages like STATUS, GPRS SUSPEND, HANDOVER COMPLETE/FAIL, ... should be processed on the BSC side of things, not on the MSC side. This is among other things required in preparation of intra-BSC hand-over support in osmo-bsc.
2012-01-23Move processing of CLASSMARK CHANGE behind bsc_apiHarald Welte1-50/+0
This prevents osmo-bsc from sending RR messages to the MSC and rather process them inside the BSC and turn them into BSSAP CM UPDATE.
2011-12-02Add NITZ (timezone) support as part of MM INFOGus Bourg1-22/+52
The UTC offset from the operating system will be used by default to calculate the NITZ in MM INFO. However, a "timezone" vty command is added at the BTS level, allowing BTS-specific overrides, e.g. in case BTSs are distributed accross multiple timezones.
2011-11-07gsm0408: Print a message when the LU is timing out.Holger Hans Peter Freyther1-0/+1
2011-09-03Add VTY command to specify default speech codecHarald Welte1-0/+4
In order to have the MNCC application reliably decide on the codec type, it needs to know if we are running on a TCH/F or TCH/H. Thus, we pass lchan_mode as a new parameter to the 'struct gsm_mncc'
2011-08-19src: port openBSC over libosmo-abis0.9.15Pablo Neira Ayuso1-2/+2
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
2011-08-19src: use new msg->dst pointer instead of deprecated msg->trxPablo Neira Ayuso1-6/+13
This patch modifies openBSC code to use msg->dst which stores the pointer to the signalling link structure instead of the pointer to the transceiver structure. This patch prepares the introduction of libosmo-abis.
2011-08-10Fix MNCC for the NOKIA BTS typeHarald Welte1-0/+2
(thanks to Gus Bourg)