Commit Graph

2500 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 451eb29e37 subscr: Add a vty option to kick the queue. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 763b42a92a subscr: Dump the pending requests to help with debugging state. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 68c3bf6de8 subscr: Store the state of a subscr request for inspection. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther c02b12086c subscr: Fix subscr leaks in the KI code. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther fc857414ae subscr: Make it possible to clear pending requests for a subscriber 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther ebdd3cbd89 subscr: Show the number of pending requests on this subscriber. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther ffccb77df0 subscr: Stop all paging requests if one is failing.
If one paging request is timing out the others will timeout soon
as well. With the current code the next timeout would expire the
next request in the queue. We will now stop all paging requests
and then issue a next paging request. So for both paging success
and failure we will now stop all the other requests.

This is mostly a workaround, one should count on how many
BTSes we are paging and wait for all failures before we remove
the item from the queue.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther f72b3d51fc subscr: Kick the queue in case of a paging timeout
Kick the queue in case the paging was timing out. No one is going
to call subscr_put_channel for us so we will do it on the subscriber.

There is also another problem with multiple BTS in the LAC and paging
timeout. We will need to remember how many BTSes we have paged.
2011-01-06 14:52:52 +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 701076e9d3 sms: Add new SMS requests to the end of the list. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 96e9f08101 sms: Argh... reset the pending after we have cleared the queue. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 79eff7eeff sms: Fix crash by saving the gsm_network
The conn might be released during the loop and then conn->bts
is a null pointer and we end up crashing. Store the gsm_network
in a local variable and access this one.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 583e9aef33 sms: Show the amount of failures and the SMS we want to send.
Improve the debugging possibilities and print the failed attempts
and the sms that was attempted to be delivered. this should help
with debugging the code.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther dc53af6721 sms: Fix the log message and end with a new newline. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 725966d9b4 subscr: Make the subscr_put_channel work with the subscr
The active channel might or might not be gone when the transaction
has been released. Instead of passing an invalid subscriber conn
we will pass the subscr that is ref-counted and guranteed to be
valid at this point. subscr_put_channel could search the connections
for an active connection if that is ever needed.
2011-01-06 14:52:51 +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 ebd50a6fd2 bsc: Clear the hand-over in case the new_lchan is failing
When the new_lchan for handover is failing we should stop the
handover operation. This is fixing a crash that we get a timeout
on the lchan and have no conn set to it. Introduce a flag to
the bsc_clear_handover to not free the lchan. In case the ho_lchan
is failing we do not want to call lchan_release as it would
reset the state.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther f1ba09b2e6 misc: Remove unused variable from the function. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 1cc7184bc9 misc: Fix compiler warning about incompatible pointers 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 02d45c00f5 misc: Fix warning about the cast. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther f4152d1025 misc: Remove unused variable from the db. 2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 54146271b6 misc: Forward declare the struct gsm_bts_trx_ts to avoid warning. 2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 913bc032b9 mncc: Move the cc_tx_to_mncc code into the libbsc.a
The trau_mux likes to call cc_tx_to_mncc for each received
frame from the E1 link. Using a signal for each audio frame
is messy as well. The best thing I could think of is to put
this into the BSC to deref the pointer. The other option would
be to include the gsm_data.h in the mncc.h header and have
the method as inline.
2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 59234a3eb2 mncc: Switch the header file from u_int to uint
Include stdint.h to have the C99 data types.
2011-01-06 14:52:50 +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 04d362f79d fix spelling mistake in log message 2011-01-01 17:28:55 +01:00
Harald Welte 6349b7f15e re-order the sequence of events in bsc_api:handle_release()
This should make sure conn->lchan is valid throughout the release
cause, especially make trau_mux_unmap() happy that conn->lchan
still exists.
2011-01-01 17:28:49 +01:00
Harald Welte 624e89d3f7 [db] Fix double-quoting in libdbi backend 2011-01-01 17:28:43 +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 f0901f0067 [SGSN] Fix processing of RA Update Request regarding TLLI
In case we get a RA UPD REQ on a new cell (both served by the same
SGSN), the LLC stack should not allocate a ne LLE/LLME, as the latter
would reset the V(u)sent / V(u)recv to zero and make the MS discard
our responses.

Instead, whenever the LLC stack sees a foreign TLLI, it should always
convert it to the local TLLI before doing any lookup for a LLE/LLME.
2011-01-01 17:28:29 +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 0d6f930785 mncc_sock: Use proper logging directives and levels, don't printf. 2011-01-01 17:23:43 +01:00
Harald Welte 02d9966053 MNCC: Introduce bsc_hack argument '-m' for enabling MNCC socket 2011-01-01 17:23:42 +01:00
Harald Welte ea057d9350 mncc_sock: Add new 'mncc handler' function
This adds mncc_sock_from_cc() as a handler function for CC messages
to be passed to the MNCC interface.  If there is no MNCC socket
registered, we immediately release any CC related messages.

Together with flushing all established CC transaction at MNCC socket
close time, this ensures that all resources are released and no
new resources can be established until the MNCC applicaiton has
re-attached.
2011-01-01 17:23:42 +01:00
Harald Welte 29b64e9708 MNCC: pass the actual 'struct msgb' down the mncc_recv() callback
this is required as we no longer have a dequeue-handler that can take
care of free()ing the message after passing it to the MNCC handler.
2011-01-01 17:23:42 +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 49a2ddeec0 mncc_sock: Add an assert() in case our queue peek trick goes wrong 2011-01-01 17:23:42 +01:00
Harald Welte e8e432dd59 MNCC: remove 'upqueue'
The MNCC messages now again get directly handled by the net->mncc_recv()
callback.  If the callee wants to put them in a queue, it' his business
to do that.
2011-01-01 17:23:42 +01:00
Harald Welte fea236e27c MNCC: move cc_tx_to_mncc() from gsm_data.h into mncc.c 2011-01-01 17:23:41 +01:00
Harald Welte 31bbbf4e52 MNCC socket: Export MNCC interface via unix domain socket
Using this code we will soon be able to use LCR or other MNCC
applications via a unix domain socket.

The code is not actually used yet after this patch.
2011-01-01 17:23:41 +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 3e6376d20d MNCC: split into generic mncc.c and mncc_builtin.c
The built-in code to handle call switching inside OpenBSC is
now in mncc_builtin.c, whereas some core/utility functions remain
in mncc.c
2011-01-01 17:23:41 +01:00
Harald Welte 081e14d071 MNCC: make get_call_ref() function static 2011-01-01 17:23:41 +01:00
Harald Welte e6da14fde4 MNCC: clarify naming / rename mncc_recv() to int_mncc_recv()
the int_ perfix (internal) symbolizes that this is the internal
MNCC handler code, receiving messages from the MNCC interface point.
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 9ae7b29e3a bsc: Some S_LCHAN signals don't provide an lchan
Check the signal and only continue if it is any of the
signals we want to handle. In the case of measurement
reports we would cast some random code to a lchan.
2010-12-27 12:30:12 +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 8ce8d3a00d bsc: Avoid crashing when no lchan is present in the subscriber connection
If someone wants to send a message but we have no lchan anymore
we will now complain, delete the message and return.
2010-12-27 10:58:55 +01:00
Sylvain Munaut cfcf7e84bd gsm_04_08_utils: Fix Channel Request mode for e0/e0 and neci=1
According to the specs (GSM 04.08 Table 9.9), the only possibility
if neci=1 and this cause is used is "Originating call and TCH/F is
needed"

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-27 00:59:23 +01:00
Holger Hans Peter Freyther f64a20f2e8 db: Quote the IMEI string before passing it into the database. 2010-12-26 21:19:29 +01:00
Holger Hans Peter Freyther 9d3e2ec698 ho: Access the network after we are known to have an entry. 2010-12-26 21:19:29 +01:00
Holger Hans Peter Freyther c839667324 ho: Set the conn to NULL before calling lchan_release
In case we fail to activate the lchan set the connection to
NULL before calling the lchan release function.
2010-12-26 21:19:28 +01:00
Harald Welte 019d0167b6 [db] Properly quote name and extension for SQL access 2010-12-26 19:20:15 +01:00
Harald Welte c728eeaf9b SGSN: Avoid duplicate MM contexts in case MS and SGSN disagree on P-TMSI 2010-12-26 19:20:07 +01:00
Harald Welte a9b473a3c2 SGSN: Implement network-initiated PDP CTX DEACT when GGSN restarts
If the GGSN restarts, its restart counter will increase.  We can
detect that and accordingly release/delete all PDP contexts for
that GGSN.
2010-12-26 19:20:03 +01:00
Harald Welte 3357add225 SGSN: some more comments 2010-12-26 19:19:56 +01:00
Holger Hans Peter Freyther 5479fc80d5 sms: Make sure that this loop is broken from time to time. 2010-12-26 09:40:49 +01:00
Holger Hans Peter Freyther 203845730f sms: Rewrite the queue to find SMS harder.
With the old code it was possible that we first saw SMS that
we have already in the queue. In that case we had free slots
available but have not filled them. With his new loop we try
harder to find SMS we can send, it attempts (and should work)
to detect a loop to break the loop before finding SMS to deliver.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther f7e2389eb6 sms: Move the finding of the next SMS to handle to a new method
Prepare changing the loop to fill all the available slots. Set
the last subscriber based on the SMS query.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther a37e3bc39a sms: Change the default values for the sms_queue
Increase the number of SMS we will try to send at a time and
decrease the failures we handle before going to the next item. With
the default timeout we will attempt to page the subscriber for 60
seconds and we can increase the queue speed by going to the next
item faster.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther a3a659ba5c sms: Workaround a bug in the db layer and update the data
The sync with the database might fail. Reread the updated
subscriber after we have written it. The source of this
failure is unknown.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther 445e615d03 sms: Always go through the database and the smsqueue to send messages
This is also fixing a memory and subscriber leak. Make sure to
always release the gsm_sms structure.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther 994dcbb201 sms: Allow setting amount of failures through the vty. 2010-12-26 09:40:30 +01:00
Holger Hans Peter Freyther 7e59c83d66 sms: Make the amount of failures configurable as well. 2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 4dcc5e5f8a sms: Add vty command to clear the pending message 2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 3c6f6c25a6 sms: Make the max_pending tunable via a vty runtime setting
Make it possible to change the max pending via the vty. This
can be useful to play with the performance of the queue.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 7a0e166fb0 sms: Add vty command to trigger running the queue.
Allow to manually trigger running the queue. This can be useful
if SMS were manually added to the database or such.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 81c0e2582f sms: Provide some simple vty command for the state of the SMS queue 2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 17164061a6 sms: Begin sending SMS messages, handle failures
The sms queue will attempt to send one SMS per subscriber
to fill all the available slots. It will handle the case
where paging has not started, timed out or if there was
any kind of other failure. It is also retransmitting SMS
in case of failures.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 11b28f9c26 sms: Introduce a SMS queue that will be responsible for delivery
The SMSqueue will be responsible of sending to the user. It will
do so in a loop and will also try not to overload the BTS. This
means the throughput of SMS will be limited.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 04144c1905 sms: Create signal data for SMS with more information
This is providing access to the paging result, the sms,
the transaction. This will allow the SMS queue to do
decisions based on the source of the failure.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther 0eb7666efa sms: Dispatch a failed signal in many of the MT-sms points
This attempts to dispatch a signal whenever a MT-sms is failing. In
some cases, e.g. with freeing the transaction, this will also happen
for MO-sms.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther 41c5aaf62c sms: Use the SMS in the signals where it makes sense.
The signal_data was inconsistent. Sometimes we passed the transaction
and sometimes we passed the sms. Change it to always pass the sms. The
S_SMS_SMMA is a bit special as it does not involve any SMS.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther 69ac83dd54 sms: Add a simple SystemTap probe to see SQL queries
This will proble all queries done in the system. This can
help to identify some issues with libdbi's performance.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther 9d277d3b33 sms: Add a script to query for unsent SMS
This is generating the query statement. It can be used to
play with database indexes and such.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther e3018c7ad6 sms: Add dummy script to create subscribers and SMS
This is creating 1000 subscribers and 30 SMS each. The SMS
itself is badly formatted (not a valid 7bit encoding) but
it should be enough for a stress test.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther dd715bd2ee sms: Fix a small typo. 2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther 73b878a85a db: Introduce a limit in delivery attempts for the SMS search
We do not want to attempt submitting SMS that has failed for
too many times. The failure could be due RF failure or due
a bug in the message handling.
2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther 812dad0ff7 db: Add method to load a SMS by id. 2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther e25445b864 subscr: Sync the database before sending the attached signal
If a signal handler accesses the database he will still see
the old lac. Make sure he is seeing the new one. Update the
subscriber from the database in case the query failed or other
things have changed.
2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther 3d76e44968 subscr: Print the lac of the subscriber. 2010-12-25 21:39:04 +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
Holger Hans Peter Freyther abd0cac0c5 subscr: Add a VTY command to update the subscriber from the database. 2010-12-24 21:40:48 +01:00
Holger Hans Peter Freyther c577ca1822 subscr: Add VTY command to purge subscribers that are held in memory
Call the subscr_purge_inactive function and mention how many
subscribers were removed from the RAM.
2010-12-24 21:40:48 +01:00
Holger Hans Peter Freyther ae9006aeed subscr: Introduce VTY option to keep subscribers in ram. 2010-12-24 21:40:48 +01:00
Holger Hans Peter Freyther f694d5f47a subscr: Introduce subscr_purge_inactive to free unused subscribers
Introduce a method that will remove all subscribers that have a
zero use count. This is useful if someone wants to purge subscribers
from memory or wants to disable the everything in RAM feature.
2010-12-24 21:40:47 +01:00
Holger Hans Peter Freyther daee5ca7c1 subscr: Make it possible to keep subscribers in RAM.
This is implemented by not freeing the subscriber when the
reference count becomes smaller than zero. We hope that this
will save many database accesses during the congres.
2010-12-24 21:40:47 +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 75e2defc7f BSC VTY: Print some more of the already-generated statistics 2010-12-24 16:07:35 +01:00
Harald Welte eafe22ca72 SGSN / GMM: Only allow non-roaming IMSIs
As we do not yet use the HLR from the SGSN, we allow all MS to
attach to our GPRS network.  However, if this is running in a public
environment, it could cause service interruption to users of commercial
GPRS networks.

Thus, we now check if the first 5 digits of the IMSI match the MCC/MNC
of the cell that they want to register to.  Thus, any subscribers with
SIM cards from real operators will no longer be accepted.
2010-12-24 15:42:26 +01:00
Harald Welte 2cafc4b309 BSC API: Make 'Got data in non active state' message as LOGL_INFO
LOGL_ERROR will make this message shpw up in everey default log
config.  However, as it seems, this is commonly observed in case
a MS still sends a MS STATUS (in respons to the MM INFO) at the
end of a location area update.

It might be best to actually change the channel release procedure
to make sure we can still pass such 'late' data to the MSC until
the time the Layer2 has been completely released.
2010-12-24 15:42:22 +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 b29cea1d9c Fix some stupid typos resulting in compile errors. 2010-12-24 12:26:13 +01:00
Harald Welte 712ddbcd72 BSC VTY: Fix off-by-one / segfault in 'show bts NR' 2010-12-24 12:24:03 +01:00
Harald Welte 85bded8b50 BTS VTY: Order bts-trx-ts-lchan in 'show lchan' 2010-12-24 12:22:34 +01:00
Harald Welte cd103a9a5d BSC VTY: Print the current mode of a dynamic TCH/F / PDCH 2010-12-24 12:14:52 +01:00
Harald Welte 026b4cab36 BSC VTY: Change order of elements in 'show timeslot' command
It's not logical to first show TS, then TRX, then BTS.  It should
always be ordered from big to small (BTS, TRX, TS)
2010-12-24 12:12:10 +01:00
Harald Welte 127af34eea BSC VTY: Remove extraneous 'else' from write_ts_single()
This caused the E1 parameters not to be displayed in case the channel
was using frequency hopping.
2010-12-24 12:07:07 +01:00
Harald Welte 274d015cbb BSC VTY: Fix 'show timeslot' command if BTS and/or TRX are specified 2010-12-24 12:05:03 +01:00
Harald Welte f6bd340df6 GPRS/GMM: Correctly look up MM Context in RA Update
If a MS changes RA, the RA will arrive in the new cell using the old
TLLI (masked as foreign TLLI).  So we need to look-up the TLLI
in a special way, using the old RA as indicated in the 04.08 GMM
message.

There is still another bug remaining: As we somehow create a new LLC,
the sequence numbers of our responses start from 0 again, which is not
what the MS expects.  This needs to be fixed in a follow-up patch.
2010-12-23 23:38:02 +01:00
Harald Welte 985263e55f GPRS: enhance msgb headroom/tailroom for SGSN (GMM)
In the GPRS NS protocol stack, the amount of NS/BSSGP headers like MS RADIO
CAPA INFO can be quite long.  In order to fit the full user message and
those headers, we have to enlarge the head/tailroom of the msgb allocations.
2010-12-23 23:37:55 +01:00
Harald Welte 082b01f18e More verbose logging of authentication internals 2010-12-23 23:37:49 +01:00
Harald Welte c9f499f7d3 IMM ASS REJ: Actually add t3122 parsing to vty code 2010-12-23 23:37:45 +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
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 d0d2b0b605 Dynamic PDC: Add VTY comand 'bts N trx M timeslot O pdch [de]activate'
On a nanoBTS, this command can be used to manually switch a given 'dynamic
pdch/tch' timeslot from one mode into the other.

There are no safeguards that the timeslot is not in use at the given time.
2010-12-23 14:41:44 +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 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
Harald Welte 7ce5e259c9 mnccc.c: Add 2 line header describing what this file is all about 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
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 28dcbc5ee5 misc: Remove gsm_subscriber.h from the db.h file
Reduce the dependencies on the header files.
2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther c5faf66b82 misc: Reorder includes, move osmocore to the end 2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther 3547045c73 misc: Remove gsm_subscriber.h include to reduce dependencies. 2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther e2fee354cf misc: Include abis_rsl.h to remove some compiler warnings
This was introduced by a recent change to gsm_data.h to include
less header files. We really need to access the RSL information
here so it is fine to include the file.
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
Holger Hans Peter Freyther d49fc5ae24 ts: Reduce the delay to 0 for OML and RSL
This is possible after not sending more than one OML command that
requires an extra ACK. For the RSL line we do not need any speed
limitation.
2010-12-21 13:53:42 +01:00
Holger Hans Peter Freyther d85642a1a7 ts Make the e1inp_ts delay configurable
Currently the nanoBTS bootstrap code requires a high delay
otherwise we are not bringing the device up properly. Changing
the init code turns out harder than it seems like. So this is
a workaround for that to allow a high speed RSL/OML connection
after the bringup.

The line driver can have a default TS delay. It is set to the
current default for the nanoBTS and the BS11. For the ipaccess
case we will set the delay lower for the RSL connection and
inside the ipaccess-config we can set it low right away to
have fast firmware flashing and such.
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther 6f615551a4 abis_nm: Band aid on OML initialisation by queuing messages
Instead of sending many messages we will queue the OML
messages and wait for the ACK/NACK before sending the
next message from the queue. We tag the msgb to remember
if we need to wait for an ack or not.

We keep the order of all messages, on ACKs and similiar
occassions we will drown the queue until we reach a message
that needs to be acked and then wait for that ack again.

Possible breakage can appear when we send an OML (e.g.
BS11 specific message) msg which does not need to be acked
through the abis_nm_sendmsg call. The fix will be to use
the _direct version of this method.

Re-Enable as it might have fixed something... who knows.

Conflicts:

	openbsc/include/openbsc/abis_nm.h
	openbsc/include/openbsc/gsm_data.h
	openbsc/src/abis_nm.c
	openbsc/src/gsm_data.c
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther 39e6ba09c2 oml: In case we get a NACK, drop the OML connection and hope for the best
Assume that a NACK is a onetime failure and that on the next
attempt it will work better. If that is not the case we might
even send a reboot to the BTS.
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther c7a1a1fd2e oml: Another band aid for reliable BTS init...
Sometimes the operative change for the NSE is getting nacked,
this might be due that we send it before we get the OPSTART ACK
for this object class. Send it from the CELL availability as
a workaround. This init code needs to be changed to make these
dependencies work more reliable.
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther d9cdd056ff test: Make it compile but it is segfaulting on start now 2010-12-21 13:43:52 +01:00
Holger Hans Peter Freyther 2391b4c474 ho: On ho failure clear the subscriber connection
Forget about the ho_lchan inside the gsm_subscriber_connection
in case of a handover failure, also clear the gsm_subscriber_connection
pointer before the lchan is passed to the lchan_free routine.
2010-12-21 13:41:33 +01:00
Holger Hans Peter Freyther 90cdd28e6f ho: Make this allocation a child of the BSC talloc context
Do not use the NULL context for this allocation. It should hang
off the gsm_subscriber_connection but for now at least make it
the child of the BSC so it is showing up in the talloc report.
2010-12-21 13:41:33 +01:00
Harald Welte 63dbfc6a2b bsc_vty: Fix unknown 'use-dtx' config parser error
commit 5a3a61d88f introduces a DTX attribute
which is parsed as dtx-used, but written as use-dtx (and thus causes a parser
error).
2010-12-15 15:34:23 +01:00
Harald Welte f604bba026 osmo-bsc: Make it compile against paging_request_stop() api change
The additional msgb argument was introduced by Sylvain in
c7ff2572a7
2010-12-15 15:33:08 +01:00
Harald Welte ec073e9f5b bs11_config: more verbose output of ACK/NACK responses 2010-12-14 13:34:35 +01:00
Harald Welte 230cd6a720 bs11_config: fix help message about multi-drop (not 'port') 2010-12-14 13:28:43 +01:00
Harald Welte 5f5189e658 bs11_config: update copyright statement 2010-12-14 13:14:32 +01:00
Harald Welte f751a10018 bs11_config: show the BPORT0 / BPORT1 configuration in 'query'
This introduces abis_nm_bs11_get_bport_line_cfg() and a parser for the result.
2010-12-14 12:52:16 +01:00
Harald Welte 7e72fa0250 bs11_config: Add option to set BPORT1 in multi-drop mode 2010-12-14 12:35:59 +01:00
Dieter Spaar df30d40b98 Add mandatory routeing area IE to SUSPEND-NACK 2010-12-12 15:46:00 +01:00
Sylvain Munaut 98b53cba06 include: Add proper predeclaration for struct in mncc.h
We use them, so declare them. (avoid including all gsm_data.h)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:27 +01:00
Sylvain Munaut 81a8bf1039 include: Small fixes to gsm_data.h
We don't really need openbsc/gsm_04_08.h or abis_rsl.h
But we do need some definition from libosmocore

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:27 +01:00
Sylvain Munaut 12e373c218 include: Add proper predeclaration for struct in system_information.h
We use them, so declare them. (avoid including all gsm_data.h)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:26 +01:00
Sylvain Munaut 3f16da2032 include: Add proper predeclaration for struct in abis_rsl.h
We use them, so declare them. (avoid including all gsm_data.h)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:26 +01:00
Sylvain Munaut 8a31a3fcee paging: Dispatch the SS_PAGING signals at the MSC code level
This way the channel is fully ready for use.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:26 +01:00
Sylvain Munaut 5a86e06eb3 auth/ciph: Enable securing of channel directly after paging response
This protects MT services

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:26 +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 c7ff2572a7 paging: Give the msgb that caused paging_stop up to the paging callback
The handler might need to know some info of the paging response

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 1e24550d3d gsm_subscriber: Move the get_channel/put_channel logic in MSC part
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
Sylvain Munaut e0b06b0293 bsc: Allow to configure Optional Cell Selection params from vty
The default values are those where the parameters are encoded
as '0' and they're not output in the config file if that case

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 20:23:34 +01:00
Holger Hans Peter Freyther fbceea4f0f bsc: Add a command to set the ussd_welcome_text
Make the USSD welcome text configurable.
2010-11-26 00:12:24 +01:00
Holger Hans Peter Freyther 414bc4a1f4 mid-call: Do not lose the first word of the message 2010-11-26 00:06:58 +01:00
Holger Hans Peter Freyther cf6f71aa7f mid-call: Make the mid-call behavior the default for switching things off
When switching the RF off we will always go through the grace
period, add a direct off mode to switch it off directly. Make
the query return a 'g' if we are in the process of switching
things over.
2010-11-26 00:06:15 +01:00
Holger Hans Peter Freyther 70c232f75a mid-call: Implement a timer to go from grace to off.
Start the timer... switch it off when we do the final
tranistion by a command.
2010-11-26 00:06:01 +01:00
Holger Hans Peter Freyther bb62b3f053 mid-call: Rename ussd-grace to mid-call 2010-11-26 00:03:32 +01:00
Holger Hans Peter Freyther 625b6e4dab mid-call: Introduce a timeout to switch from grace to rf off. 2010-11-26 00:02:12 +01:00
Holger Hans Peter Freyther d283db496f vty: For ipaccess we will dump if the OML connection is present 2010-11-26 00:00:22 +01:00
Holger Hans Peter Freyther e17c030b76 test: Add shell script to drop the OML in fixed intervals 2010-11-26 00:00:21 +01:00
Holger Hans Peter Freyther dab8e27755 ipaccess: Fix dropping the OML/RSL connection.
Use the ipaccess_drop_oml and ipaccess_drop_rsl functions
instead of closing the socket and hoping this is picked up
somehow. This just leads to some weird hangs. And gdb was
not really helpful to say where it was coming from.
2010-11-15 20:30:38 +01:00
Holger Hans Peter Freyther 09a925b117 bsc: Add script to hang up the MSC connection every 58s 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther e9f7a0d3b9 bsc: Add wild scripts to do dial testing with a Motorola A1200 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther b4e72f881c bsc: Implement queuing of messages to the MSC before the con is established 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 16e958dc68 bsc: Use the BSC Filter to stop a paging_request 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 9c838ae069 bsc: Implement paging by creating a dummy subscr for the paging
In the future we should avoid using a gsm_subscriber at all
and pass the imsi/tmsi to the paging function directly. For
now we can use the old model for paging and go through the
gsm_subscriber. This has the benefit of load balancing on
the BTS and such.
2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther b79c3c97a2 bsc: The ip.access rtp-payload has no useful meaning
Sending this as the RTP_PAYLOAD2 will produce a MDCX NACK
as we send the RTP_PAYLOAD in the CRCX. It does not seem to
be necessary to send anything != 0 for the RTP_PAYLOAD2.
2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 620c2e678a bsc: Add thr audio module to send the MDCX message to the BTS 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther dbc698aef0 bsc: Implement DTAP coming from the MSC and forward to the BSC API 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 50c579b8c5 bsc: Implement the assignment command to the point of calling into the BSC API 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther fae3c65938 bsc: Parse the cipher mode command and pass it to the BSC api. 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther f1f57a84c1 bsc: Parse the CLEAR COMMAND and close the lchan and ack that 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 863a55d44d bsc: Make bsc_queue_for_msc work on the osmo_bsc_sccp_con
The gsm_subscriber_connection can die before the SCCP connection
so we should work on the osmo_bsc_sccp_con.
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 890dfc58ed bsc: Work on paging and parsing other messages
The paging is not implemented due bad/missing API in the
BSC API, the rest are simple stubs to be merged from the
on-waves/bsc-master.
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 3485feb49b bsc: Add module for handling BSSAP input
The current implementation is a stub. The code from
bssap.c of on-waves/bsc-master will be migrated into
this new structure
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther cf256d678f bsc: Implement sending a SCCP CR with the complete layer3 data 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 933daaa016 bsc: Implement SCCP connection confirmed handling. 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther af4b5fb13e bsc: Implement clearing the SCCP connection 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 57d304871e bsc: Implement writing out UDT messages to a MSC Connection 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 00f4cc22c8 bsc: Implement closing the connections when the MSC goes missing
Refactor the closing code of the CC timeout to a new function,
also make sure that the SCCP Connection is forced closed before
we destruct the connection for real.
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther ca5c022a32 bsc: Implement sending a message toward the MSC. 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther c97d9b4df1 bsc: Implement a CC timeout and the IT timeout, prepare the timers 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 7e9010892d bsc: Make open/close work on the sccp data 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther b8781d2cd5 bsc: Start to open a SCCP connection and prepare timers and such. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 9b17c769b9 bsc: Work a bit on opening the SCCP connection to the MSC.
Most of the code is still stubs but the structure is a lot
cleaner than the one in the on-waves/bsc-master branch.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 2a8675e49a bsc: Add a mobile country code setting for the backbone. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 52d42abdb7 bsc: Implement scanning and changing messages from the MSC
This will change the LAI of a LU accept message to the LAI
used for the on-air network. It will also detect when to
send a welcome ussd to the subscriber.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther a54732d19d bsc: Add a method to scan messages coming from the MSC. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther d65305f5b4 bsc: Look for location updating requests in messages
Introduce the SCCP connection data and remember that
we were seeing a location updating request from a
different LAC.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 5bb874d2f5 bsc: Add a hook where we can scan for LU and other messages. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther cc48fb8083 bsc: Call into the SCCP layer to create a new connection. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 46c5ab3624 bsc: Reduce duplication with a macro. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther e46f1d6cc4 bsc: Implement sending an assignment failure 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther c2b3270e93 bsc: Send a Clear Reques on RF Failures to the MSC. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther c8166f3a91 bsc: Implement sending a SAPI n Reject.
It is not clear that the link_id is setup correctly here.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 58f2cf6494 bsc: Implement the DTAP callback and forward the data to the MSC 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther da488ae343 bsc: Implement sending the assignment complete to the network 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 2d2c910f2c bsc: Implement sending a Cipher Mode Complete message 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 4582586e24 bsc: Add a method that will queue the message on a MSC connection. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 7225fd18e0 bsc: Add some basic checks to see if a SCCP connection is established 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 1999cf11b9 bsc: Complain about unimplemented stuff. 2010-11-15 20:06:47 +01:00