Commit Graph

203 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 182c81f04e subscr: Remember if we need to call subscr_put_channel at the end.
Remember if this channel got opened due a paging response and in
that case when we close it down we will call subscr_put_channel
that will try to page the subscriber again. This highlights the
lack of a good subscriber management in the MSC code.
2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther c29043ea24 msc: Attempt to fix a bug with 'stuck' SMS due RF failure on auth
If we have a RF failure between the paging response and the auth
success we will not inform the subscriber layer of the failed paging
and instead just 'drop' the SMS. In case we have not completed the
auth and close the channel we will now send an auth failure.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 8e3eb584a8 mncc: Do not print the BTS at all as it might not be present
In contrast to the previous believe we may not have a conn here
as we are still paging for the sub. Instead of printing the BTS
print the lac where we think the subscriber is located.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther b56a6bbc55 mncc: bts can be NULL, attempt to find the bts from the transaction
Follow trans->conn->lchan to the BTS instead of using the BTS that
is guranteed to be NULL in the codepath we have entered here. The
trans->conn should still be there, and the lchan should be valid as
well as we have reordered the clear statements.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 50c5ff7b94 mncc: Do not use bts->nr as it might be NULL. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 6c4d2443b4 rtp: Move the RTP Proxy code out of RSL into the BSC/MSC domain
Instead of creating the sockets in the RSL code we will do this
in the CRCX_ACK, MDCX_ACK, DLCX_IND signal handler of gsm_04_08.
Introduce a handover signal so we can repatch the RTP sockets in
the gsm_04_08 as well.
2011-01-06 14:31:16 +01:00
Harald Welte b854b29e32 MNCC: avoid segfault in DEBUGP due to non-existing conn->lchan 2011-01-01 17:28:38 +01:00
Harald Welte 91c59c8cb5 MNCC: fix copy+paste mistake in log message and change it to DEBUG 2011-01-01 17:23:43 +01:00
Harald Welte eb76c7a93f mncc_sock: Fix potential segfault in case MNCC app dies
We create a loop by not setting trans->callref = 0 before calling
trans_free(), as the latter would again send a MNCC_REL_IND up
the stack.

Also: Fix memory leak in case we try to read from mncc_sock
but socket is just gone.
2011-01-01 17:23:43 +01:00
Harald Welte 04dc88fb9d GSM 04.08 / MNCC interface: verbuse logging of incoming MNCC primitives 2011-01-01 17:23:42 +01:00
Harald Welte 371efe5955 mncc_sock: Clear all calls if MNCC application (LCR) disconnects 2011-01-01 17:23:42 +01:00
Harald Welte 76556376c3 MNCC: rename mncc_send() to mncc_tx_to_cc()
This name clearly indicates: MNCC api transmits to Call Control,
i.e. down from the L4/application into the L3 04.08 code.
2011-01-01 17:23:41 +01:00
Harald Welte 54209c2dce MNCC: rename mncc_upq_enqueue() to cc_tx_to_mncc()
The new function name clearly indicates: The Call Control
(TS 04.08, msc-side in OpenBSC) wants to transmit something to the
MNCC interface.
2011-01-01 17:23:41 +01:00
Harald Welte 9af6ddfcec License change: We are now AGPLv3+ instead of GPLv2+
The reason for this is quite simple: We want to make sure anyone
running a customized version of OpenBSC to operate a network will
have to release all custom modifiations to the source code.
2011-01-01 15:39:34 +01:00
Holger Hans Peter Freyther 08eebd59b7 lchan: Every SS_LCHAN signal now sends a struct lchan_sig_data
The SS_LCHAN signals now always include the lchan_sig_data. For
the measurement report it will optionally include the measurement
report as well. Attempt to update all handlers of this signal as well
2010-12-27 13:32:20 +01:00
Holger Hans Peter Freyther 59f787a4c1 auth: Release the security operation after we sent out a message
The release might release the lchan we want to send the response
on. Reorder the code to first send the message and then give up
the security operation which might release the lchan.
2010-12-27 10:58:55 +01:00
Holger Hans Peter Freyther d3baf415b1 paging: Introduce a GSM_PAGING_BUSY event for a special timeout
Start counting the attempts of each paging request and call
the callback with the PAGING_BUSY type when the paging request
timed out but the subscriber was not paged at all. This can
only happen with a huge paging backlog.
In case the system has so many pending paging
2010-12-25 21:39:04 +01:00
Harald Welte a29e43a26f BSC Call Control: Actually implement call statistics
The existing call realated statistics counters apparently were
never used.  This introduces a new set of counters, two for the
MO and MT case.
2010-12-24 16:07:40 +01:00
Harald Welte 86dda08762 Authentication: use ENUM instead of magic numbers
This improves readability of the code...
2010-12-23 18:09:51 +01:00
Holger Hans Peter Freyther d4e6872d6c gsm48: Release the LU procedure only after the TMSI REALL_COMPL
We send a LU Accept with the TMSI as the MI. According to the
spec the phone should store this new TMSI and send a TMSI
REALLOCATION COMPLETE to us. We will release the LU then and this
should trigger the release procedure.
2010-12-22 20:25:38 +01:00
Harald Welte 434bb3f39f MNCC: introduce mncc_upq_enqueue() wrapper around msgb_enqueue()
This wrapper will allow us to add queue related code at one single
location in the code as opposed to three locations.
2010-12-22 19:03:40 +01:00
Holger Hans Peter Freyther f93e8fabd8 gsm48: Use NULL instead of 0 for pointers in C. 2010-12-22 18:26:36 +01:00
Harald Welte c7782dec4a gsm48_tx_release_compl(): Don't use transaction after trans_free()
In commit 39e2eadc99 a bug was introduced
that used the 'trans' after trans_free() had already been called.

This became visible now when the openbsc+lcr combination was calling
an unknown/invalid telephone number in a MO call, resulting in
a segfault.
2010-12-21 19:33:19 +01:00
Sylvain Munaut 0fbfd1bb52 gsm_04_08: Make gsm48_secure_channel available globally
Can't declare it in gsm_04_08.h tough ... gsm_cbfn is defined in
gsm_data.h and trying to include that in gsm_04_08 just creates a
huge mess.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 567c8dc7c9 gsm_04_08: Use subscr_get_channel instead of directly paging_request
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 67706df7c2 gsm_04_08: Don't set ciphering manually but call gsm0808_cipher_mode
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 20:36:34 +01:00
Holger Hans Peter Freyther 8d380dcadd bsc_api: Change submit dtap to allow to automatically use the SACH
For SAPI=3 on a TCH it might be nice to use the SACH to submit
the message. The api allows to automatically use the SACH if
a message like this is submitted.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 6c199e7d99 bsc_api: Look into the msg and call the right API functions
For certain messages we will need to call other GSM0808 functions. To
keep the bsc_hack working we will try to send this through the normal
messages first and then fallback to dtap if no handler is registered.

The gsm_04_08.c code is not forced to handle the IPA activation
and channel modify ack anymore. This is done transparently by the
BSC API now.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 05c68841a8 bsc_api: Fix a use after free error in the Clear Request path
The implementation of bsc_hack would call subscr_con_free before
the BSC API has had the chance to call gsm0808_clear to try to
release other channels. Fix that by adding a return value.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 12eb9b7bd9 gsm_04_80: Require libosmocore for creating USSD messages
Use the libosmocore to create USSD messages, increase the
minimum version of libosmocore, add header files, remove
the code.
2010-09-30 18:56:07 +08:00
Holger Hans Peter Freyther 841c2000d3 gsm0408: Reorder the includes, openbsc first, osmocore second 2010-09-30 18:56:06 +08:00
Holger Hans Peter Freyther adb6e1cce1 janitor: Move the * to the variable name 2010-09-18 06:44:24 +08:00
Holger Hans Peter Freyther aaa40b8688 bsc_api: Do not free the subscriber conn on clear and clear request
Do not free the GSM Subscriber Connection when a channel is failing
or if a clear is requested, instead just give up _all_ the channels,
reset them to NULL and free the remaining channels.
2010-09-16 20:53:04 +08:00
Holger Hans Peter Freyther e0009f10ca gsm48: Add method to send a separate facility message...
Send a facility messages with notifySS/CNAP as payload
to the phone... the function is not called from anywhere
in the tree yet but I use it locally.
2010-08-12 01:44:57 +08:00
Holger Hans Peter Freyther 02d39b2c4d msc: Create a dummy operation to keep the channel open for five seconds
* We should create the transaction for SMS, CC on the CM Service Request
  but for now we will use a band aid and create a dummy operarion to wait
  five seconds for the transaction to be opened.
2010-07-05 15:36:08 +08:00
Holger Hans Peter Freyther 88519eaaef msc: Add includes to silence a compiler warning. 2010-06-30 12:59:20 +08:00
Holger Hans Peter Freyther 4049455d74 bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
    * Errors via the clear_request callback...
    * no more transactions and operations are going on.

This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
2010-06-28 18:01:47 +08:00
Holger Hans Peter Freyther db4ef0d369 bsc_api: Remove the lchan usage from the Paging Response handling. 2010-06-21 16:40:09 +08:00
Holger Hans Peter Freyther 758f4dfa17 silent_call: Use the gsm_subscriber_connection instead of lchan->conn 2010-06-21 16:40:09 +08:00
Holger Hans Peter Freyther f6d0e06940 bsc_api: Set the l3h header from within the dtap method
This is fixing USSD which broke when the code was
switched to use the BSC API.
2010-06-17 17:48:13 +08:00
Holger Hans Peter Freyther d42c3f25a6 bsc_api: Remove the lchan from the USSD code... 2010-06-17 17:35:57 +08:00
Holger Hans Peter Freyther 3f122bed1e bsc_api: Kill &lchan->conn usage, stop msg->lchan too.. 2010-06-17 17:14:35 +08:00
Holger Hans Peter Freyther 9764331062 bsc_api: Move gsm48_rcvmsg into the BSC API and dispatch.
The next step in the way to the BSC API. We have a clear a
new connection was opened signal now... and the MSC could
use it...
2010-06-17 16:41:25 +08:00
Holger Hans Peter Freyther 86481c29d4 bsc_api: Make paging/silent call work with the subscriber_connection
Do not use the lchan for the paging but operate on the
subscriber_connection, change the signals too to not carry
the lchan but the subscriber connection... the silent call
and vty code still assume there is a lchan inside the
subscriber connection.
2010-06-17 15:05:57 +08:00
Holger Hans Peter Freyther 57c4decd1d bsc_api: Pass the subscriber connection to the SMS... 2010-06-16 15:43:01 +08:00
Holger Hans Peter Freyther 9ce1b27fbf bsc_api: Use gsm_subscriber_connection in rrlp.c 2010-06-16 15:42:40 +08:00
Holger Hans Peter Freyther b2be195b50 bsc_api: Rename lchan_for_subscr to connection_for_subscr and update code
With handover and late/early assignment there might be two channels
for one subscriber and only the BSC knows which one to use, so use
the gsm_subscriber_connection everywhere...
2010-06-16 15:42:38 +08:00
Holger Hans Peter Freyther 0128843591 gsm48: Release the "operation" after sending out data...
* With an immediate release we would release the lchan
  before sending the data... change it.
2010-06-16 15:42:21 +08:00
Holger Hans Peter Freyther 228c1059fd bsc_api: Remove the lchan from the secure channel code...
The code still needs to stop touching the lchan directly
and put stuff into it.
2010-06-16 15:42:21 +08:00
Holger Hans Peter Freyther e9ed340425 bsc_api: Cut back on direct lchan usage. 2010-06-16 15:42:21 +08:00