Commit Graph

139 Commits

Author SHA1 Message Date
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 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
Harald Welte 3a3c277b70 RSL: Make "waiting for SAPI=%d to be released" LOGL_DEBUG 2010-12-24 15:42:17 +01:00
Harald Welte 2862dcac58 Use 04.08 IMM ASS REJECT in case we run out of channels
If the user has a non-zero 'timer t3122' in the config file, we will
send an IMM ASS REJECT in case we run out of resources.
2010-12-23 14:41:50 +01:00
Harald Welte 53cd7ac44c Dynamic PDCH: rsl_ipacc_pdch_activate() operates on a timeslot
... not on the lchan.
2010-12-23 14:41:40 +01:00
Holger Hans Peter Freyther 6003d6b928 rsl: Remove unimplemented/unused rsl_paging_cmd_subscr
RSL should not know the details of a GSM Subscriber anyway.
2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther 8cc59036e6 rsl: Allow to hardcode the RTP Payload
In case of a inflexible network it is better to hardcode
the rtp payload to a given type. E.g. when using AMR5.9 on
a TCH/F and TCH/H having the same payload is helpful. For
now this will be only used by the osmo-bsc.
2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther 78891078fe chan: Store the to be assigned channel type in the GSM Network.
Store the mapping from request to channel type in the GSM Network
struct as there is some policy involved with handling the request.

E.g. in a half rate network we don't want emergy calls to be getting
a TCH/F, or we want to have a different policy for early/late assignment
of phone calls. Update the table when creating the network and when
the neci is changed.
2010-09-06 09:36:02 +08:00
Holger Hans Peter Freyther 5a3a61d88f bsc_init: Allow DTXu and enable DTXd on RSL (experimental)
Allow the MS to use uplink discontinous transmission by
setting the right bit in the SystemInformation and set
DTXd/DTXu on the RSL channel commands.

This is configurable via dtx-used (0|1) on the network
level and still considered as experimental.
2010-09-06 09:26:27 +08:00
Holger Hans Peter Freyther 457c2a879c [alloc] Assign a TCH for LU when all SDCCHs are occupied.
When the cell becomes visible we will be bombed with location
updating requests and to reduce the load on the network we should
assign as many channels for it as possible. During load peek it
is even more important than to have a spare voice channel and in
general the LU procedure is pretty fast.
2010-09-06 08:58:42 +08:00
Holger Hans Peter Freyther 4b85a32360 chan_alloc: Change Channel Release to release SAPIs, then the channel
Currently every SAPI release indication will trigger the channel. It
was possible that we had SAPI=3 and SAPI=0 allocated and we tried to
release the channel by sending a RF Channel Release, the BTS answered
with a RF Channel Release ACK but also sent the SAPI Release Indication
which triggered a channel release here. So it was possible that we
would have released a newly allocated channel because of the SAPI
release of the old connection.

This code now works by releasing all SAPIs from highest to lowest,
then sending a SACH Deactivate and finally releasing the channel. This
approach is in use on the on-waves/bsc-master.
2010-07-31 04:09:38 +08:00
Holger Hans Peter Freyther c44db4a534 abis_rsl: Reduce level from notice to debug for measurement reports
It can happen that OpenBSC decides to close the lchan but we
still receive some measurement reports until the BTS has decided
to close the channel.
2010-07-31 04:09:38 +08:00
Holger Hans Peter Freyther 8cb4a0f35d rsl: Add method to send a SMSCB inside a SMS BROADCAST COMMAND
* Untested code for sending the SMS BROADCAST COMMAND.
2010-07-23 17:16:48 +08:00
Holger Hans Peter Freyther 0379c6d386 abis_rsl: Add full MA again until we are confident to remove it
The spec seems to say we do not need to include the full MA,
even for Phase1 phones but that is not so clear...
2010-06-30 12:06:20 +08:00
Holger Hans Peter Freyther e38bd6caa3 abis_rsl: Change code to generate Channel Identification
1.) memset the gsm48_chan_desc to avoid sending dummy data
2.) According to the GSM08.58 9.3.5 the Mobile Allocation
    shall be included but the empty (by setting the length
    to zero).
3.) use msgb_tlv_put and calculate the length via the l3h
    msgb_l3len and assign it.
2010-06-30 12:01:22 +08:00
Harald Welte 93d50e69d3 [BSC] RSL: CHAN ACT: Only include MA if TS is hopping 2010-06-29 17:53:45 +02:00
Harald Welte a1d39a2a11 [BSC] fix off-by-one error in computing l2 pseudo-length in IMM ASS
@fingerprint:
This caused Motorole EZX phones (Neptune LTE chipset) to discard
all immediate assigns and thus be unable to perform location updating.
2010-06-28 18:41:27 +02:00
Holger Hans Peter Freyther 2412a07965 bsc_api: Allocate the subscriber_connection dynamically
This is a big change to the way we use the subscriber
connection. From now on it is is dynamically allocated
and we will slowly move from a 1:1 lchan to conn to
having more than one lchan per connection.

This is the first commit, the subscr_con* methods will
move to gsm_data once the use_count is removed from the
connection, the freeing of the connection will also change.
2010-06-28 16:12:39 +08:00
Holger Hans Peter Freyther 94d625bfa0 Revert "bsc_api: Move debug context for subscriber into the bsc_api.c"
This is breaking the filtering for the Measurement Report case, revert
the patch for now.

This reverts commit 69e8f8285b.
2010-06-28 13:38:19 +08:00
Holger Hans Peter Freyther 5ba05f4d26 abis_rsl: Send the IMMEDIATE Assignment after the Channel Ack.
The Channel Activate might be sent to a different TRX than the
Immediate Assignment. So we need to make sure that the channel
is activated before we send the immediate assignment for the RACH.

Another reason for that is according to GSM 08.58 we should take
the frame number from the activate and use it for the starting
time inside the immediate assignment message. We obviously do not
do this yet.

The code assumes that the BTS will either respond with a CHAN ACK
or a CHAN NACK if not the lchan will remain in the request state.
2010-06-22 12:26:35 +08:00
laforge cfa4a01c8f [RSL] hopping: Set correct L2 pseudo-length during IMMediate ASSign
Thanks to Sylvain for the hint that lead to this fix.
2010-06-21 12:09:41 +02:00
Holger Hans Peter Freyther 69e8f8285b bsc_api: Move debug context for subscriber into the bsc_api.c 2010-06-21 16:40:09 +08:00
laforge 694a5cfe06 [BSC] RSL: Fix Channel Identification IE in RSL CHAN ACT
We now not only include the 04.08 channel description but also
the 04.08 Mobile Allocation nested IEs
2010-06-20 21:55:23 +02:00
laforge 09108bff95 [BSC] RSL: properly include MA in IMM ASS CMD
When we build an IMMediate ASSign CoManD for a hopping channel,
we need to include the length of the MA in the total length of
the 04.08 message
2010-06-20 15:18:46 +02:00
Harald Welte 29aca17ed0 [BSC] Hopping: Add MA IE to ASS CMD, IMM ASS CMD and HO CMD
Also, make sure the bit ordering in the pre-computed MA is correct,
as well as the cell channel description of the target cell being
present in the HO CMD.
2010-06-20 10:44:53 +02:00
Harald Welte a39b0f2bb7 [BSC] Implement per-timeslot ARFCN lists for frequency hopping
We now compute the Cell Channel Description for SI 1 by bit-wise
OR of the ARFCN bitmask of each timeslot on all the TRX of the BTS.

Also, support generating a GSM 04.08 Channel Description IE for
the hopping case (with HSN/MAIO instead of ARFCN).

What's still missing now: Sending the 04.08 Mobile Allocation IE
2010-06-20 10:44:53 +02:00
Holger Hans Peter Freyther 4f5848dc91 abis_rsl: Allow to specify the release mode for a given channel.
This can be used by handover, early assignment to indicate the
close of the old channel...
2010-06-08 12:16:17 +08:00
Holger Hans Peter Freyther 44752d9f84 abis_rsl: Fixup direct assignment and go through the method. 2010-06-08 12:16:17 +08:00
Holger Hans Peter Freyther 4b4dd100f8 [rsl] Introduce an error state for the lchan and set it on release
When we issue a RF Channel Release in case of a failure we receive
RLL release indications after the channel was tearn down and we
issue another RF Channel Release as a result. The channel allocator
might have already allocated this channel and we release the channel
again with another MS on it.

Make rsl_rf_chan_release take an error argument and make it set
a new state in case of an error and change the RF Channel Release
ack to not set the state back to none in case of an error but wait
for a timeout that is a bit higher than T3111.

I tested this with removing the battery during a phonecall and
waiting for the channel failure. With this test we only send the
release once.
2010-05-31 21:39:23 +08:00
Holger Hans Peter Freyther f30c0dca0d [rsl] Implement the T3111 timer to delay the RF Channel release 2010-05-31 21:33:15 +08:00
Holger Hans Peter Freyther d7fd30617f [rsl] Check the assumption that RF Channel Release is sent during release
We assume that the lchan_free will initiate the release and
that when we handle the RLL release indication or the release
request as part of the shutdown sequence.
2010-05-31 21:30:37 +08:00
Holger Hans Peter Freyther dbc5fae576 [rsl] Move rf channel release scheduling to a new method
The current channel release has a couple of issues we will
need to fix in a set of upcoming commits.

The issues include:
    1.) sending release twice
    2.) reassigning the channel inbetween the relase..
2010-05-31 21:30:16 +08:00
Harald Welte 38e9c82114 RSL: inmplement ip.access paging load indication 'below threshold'
This is an ip.access specific 08.58 oddity.  It reports 0xffff
available paging buffers if the paging load is below the 12.21
CCCH LOAD INDICATION THRESHOLD.

We use 50, since that is what it reports if the threshold == 0.
2010-04-19 10:29:16 +02:00
Holger Hans Peter Freyther 3ba36d5b57 [statistics] Keep track of rf failures and rll release failures
Add two new counters to count the RF Failures and the RLL Release
failure and make them available via the vty interface.
2010-04-17 06:48:29 +02:00
Sylvain Munaut b54dda4cef ipaccess: Send RTP Payload IE for CRCX & MDCX
For GSM V1 FR, the payload type is fixed to 3 in the RFC.
But for the other codecs, the payload type is dynamically assigned
between 96 and 127. Here, we use a static mapping internal to OpenBSC.

This patch is needed to make a rather old 139 unit (with sw version
120a002_v149b42d0) work with something else than FR codec. I also tested
this patch on a newer 139 (with sw version 120a352_v267b22d0) to make
sure it didn't add a regression. More testing with newer EDGE units
should be done by whoever has some of theses.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-12 19:58:57 +02:00
Holger Hans Peter Freyther 63d18b51a7 [rsl] Set the release state from within the lchan class
Currently our GSM04.11 code is closing the link for SAPI=3
and this would mean that the whole channel would be scheduled
for close... where we only want to close everything when freeing
the lchan or handling an error.
2010-04-10 00:14:55 +02:00
Holger Hans Peter Freyther 74419497fc [rsl] Introduce a method to set the state of the lchan
Setting the state through a dedicated method allows us to
track the state transitions and check if they are done in
a proper way.
2010-04-10 00:13:53 +02:00
Holger Hans Peter Freyther 19bab73d79 [rsl] Speculative crash fix in the RSL rcv message
The theory is that the BTS is almost dead and sends out
a incomplete message and we crash with that. I have not
been able to completely verify that.
2010-04-07 23:09:21 +02:00
Holger Hans Peter Freyther acf8a0c59f [misc] Remove whitespace from the end of the line. 2010-03-29 08:47:44 +02:00
Harald Welte 4563eab30e RSL: keep track of ip.access dynamic TCH/PDCH activation
We use the (currently unusued) flags member of the bts_trx_ts structure
to track if a dynamic TCH/PDCH is currently on PDCH mode or not.
2010-03-28 14:42:09 +08:00
Harald Welte dc5062b185 move log/debug codebase to libosmocore
The logging/debugging code is generic enough to move it into libosmocore
while keeping OpenBSC specific definitions in openbsc itself.

This commit uses the logging support present in libosmocore-0.1.2,
you will have to update your library to this version.
2010-03-26 21:31:43 +08:00
Holger Hans Peter Freyther 68884aa156 lchan: Create a structure for MSC data of the lchan
Prepare to split the BSC and the MSC part by putting the
MSC data for a connection into a "gsm_subscriber_connection"
struct and renaming the macros.
2010-03-25 09:07:28 +01:00
Harald Welte e95daf1925 convert openbsc to use libosmocore-0.1.1 API
the 0.1.1 API is cleaned up and removes all exported global static
arrays (like rlm_cause_strs).  There are now proper accessor functions.
2010-03-25 12:13:02 +08:00
Harald Welte 3c9c5f941d rsl: use the rsl_rll_push_l3() and rsl_rll_simple() functions of libosmocore 2010-03-04 10:33:10 +01:00
Harald Welte 2e411c7b0d value_string functions and some RSL related stuff has moved to libosmocore 2010-03-01 21:59:06 +01:00
Harald Welte dfe6c7d910 split 'libosmocore' from openbsc codebase
This library is intended to collect all generic/common funcitionality
of all Osmocom.org projects, including OpenBSC but also OsmocomBB

The library currently includes the following modules:

bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer,
tlv_parse, linuxlist

msgb allocation error debugging had to be temporarily disabled as it depends on
'debug.c' functionality which at the moment remains in OpenBSC
2010-02-20 16:27:23 +01:00
Holger Hans Peter Freyther 93b6c6555c [rsl] Send the MultiRateConfig in the RSL Channel Activate msg
If the lchan has AMR as speech codec we also need to send the
multirate config IE in the channel activation. This is already
done for the RSL Channel Modify message.
2010-01-28 10:23:34 +01:00
Harald Welte (local) d48f4ebb24 rsl: add new 'gsm_trx_name()' function and use it 2009-12-29 11:00:41 +01:00
Harald Welte 1887f9d153 Introduce gsm_lchans_name() for human readable lchan state name
Also, use this new function to dump lchan state on VTY and to
improve readability of RSL log messages.
2009-12-29 10:53:25 +01:00