Commit Graph

99 Commits

Author SHA1 Message Date
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 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 dd715bd2ee sms: Fix a small typo. 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 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 85531cc60d misc: Once again go from "On Waves" to "On-Waves"..
Try to get the company name of our sponsor right...
2010-10-06 20:38:36 +08:00
Nico Golde 1e5ed4e893 gsm 04.11: increase the delivery attempt counter for an SMS right away in gsm411_send_sms
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2010-09-17 00:34:36 +08:00
Nico Golde f11af07431 gsm_04_11: count SMS delivery attempts for each CP-DATA
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2010-09-16 20:54:14 +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
Nico Golde 4df2ad9ac6 [SMS] avoid mktime on NULL
gmtime(NULL) returns NULL at least in glibc and *can not* be used as
time(NULL). Since we compare two time_t values when checking the validity
period this can be replaced by time(NULL)
2010-06-21 13:51:28 +02:00
Andreas.Eversberg 2db4d46680 AW: Problem compiling OpenBSC on Kubuntu Hardy 2010-06-17 17:40:07 +02: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 0fbb3eca14 bsc_api: Remove the _lchan and make the method static.. 2010-06-16 15:42:59 +08:00
Holger Hans Peter Freyther 4f8340939e bsc_api: Remove some more occurences of the lchan. 2010-06-16 15:42:40 +08:00
Holger Hans Peter Freyther bddd152049 bsc_api: Operate on the subscriber connection for subscriber management 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 280c768f91 gsm_04_11: Fix a crash... in case there is a already a connection
If there is a connection, return before paging... otherwise
we will delete the SMS twice.
2010-06-16 15:42:18 +08:00
Holger Hans Peter Freyther ecd9933826 gsm_04_11: Place subscr_put_channel whenever being done with SMS. 2010-06-15 12:53:08 +08:00
Holger Hans Peter Freyther cea722bc51 gsm_04_11: Speculative leak fix for the SMS... 2010-06-15 12:29:37 +08:00
Holger Hans Peter Freyther 6a3d765bf9 bsc_api: Do not use RLL inside the SMS code, handle SAPI n REJECT
Directly send a SMS using the send method, in case of an error
we will need to find the transaction and free the SMS and the
transaction.
2010-06-15 12:04:34 +08:00
Holger Hans Peter Freyther 8e78fa7862 gsm_04_11: Attempt to fix some possible memory leaks in the SMS code
Sometimes we need to free the SMS, sometimes also the transaction.
2010-06-14 16:13:16 +08:00
Holger Hans Peter Freyther 4cd5158874 gsm_04_11: Remove some old code. 2010-06-14 16:06:39 +08:00
Holger Hans Peter Freyther 7afac583cd gsm_04_11: Start using the GSM Subscriber class to ask for a channel
The paging message should not be called directly and the GSM Subscriber
can handle multiple requests at the same time... Now a subscr_put_channel
should be called after the message sending. But it is not very clear when
this can be called. The current code works by luck that the SAPI=0 will
be released...
The MT-SMS was tested via the VTY interface and a N900.
2010-06-10 18:23:28 +08:00
Holger Hans Peter Freyther ca5702a5c6 gsm_04_11: Handle OOM same as expired and clean the message. 2010-06-10 18:20:54 +08:00
Holger Hans Peter Freyther 0afa044c09 gsm_04_11: Fix a typo.. 2010-06-10 18:08:12 +08:00
Harald Welte e98c635391 [SMS] Properly reject processing of compressed SMS
As we don't support compressed SMS, we have to properly reject it.

In the existing code, we segfaulted at some later point since the error
handling was incomplete.

This was triggered by some obscure STK SIM card that insisted on sending a
compressed SMS after registering to the OpenBSC network.
2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther bddfab1f97 gsm_04_11: Remove direct RSL calls from the SMS code...
Do not use RSL to release the SAPI/Channel from within the code,
the normal channel release procedure will take care of releasing
the SAPIs and there should be no issue in keeping the SAPI=3
established until the end of the session.
2010-06-08 12:16:17 +08:00
Holger Hans Peter Freyther cbac76ee0e gsm_04_11: Include bsc_api.h for the dtap signature. 2010-05-23 21:05:18 +08:00
Harald Welte e9dd9b0475 gsm_04_11.c: Use msgb->l4h instead of sms->smsh, as the latter is gone 2010-04-30 14:27:05 +02:00
Holger Hans Peter Freyther acf8a0c59f [misc] Remove whitespace from the end of the line. 2010-03-29 08:47:44 +02:00
Holger Hans Peter Freyther d4c16b1080 sms: Remove some more occurences of the GSM lchan 2010-03-25 09:07:28 +01:00
Holger Hans Peter Freyther 18b63f4b41 Store the GSM BTS in the gsm subscriber connection
Remove further usage of lchan from the gsm 04.11 bits
2010-03-25 09:07:28 +01:00
Holger Hans Peter Freyther ec32b5860e bsc: Start creating 08.08 like API
The 08.08 API will interface with the internal BSC code and it is
the boundary between MSC and BSC. So nothing that calls the BSC
functionality should know about lchan or such.
2010-03-25 09:07:28 +01:00
Holger Hans Peter Freyther 5179c8ef0b sms: First run of removing lchan usage from MSC code paths. 2010-03-25 09:07:28 +01:00
Holger Hans Peter Freyther e95d4825f5 lchan: Change transaction to work on the GSM Subscriber Connection
Change the MSC transaction code to operate on a GSM Subscriber Connection
instead of the lchan. This will help us to separate the two commands properly.
2010-03-25 09:07:28 +01: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 55c8f35e53 move large parts of mncc.h and gsm48 encode/decode into libosmocore 2010-03-07 23:40:35 +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
Sylvain Munaut 258e2f9a9c gsm_04_11: Support for implicit CP-ACK in case of multi-SMS
See GSM 04.11 Chapter 5.4 for details. The idea is that when
multi-SMS are mobile originated, it's possible the CP-ACK of
the previous transaction to be lost and the reception of a
new CP-DATA for a new transaction should close previous transaction
"as-if" we had received the CP-ACK ...

Note that testing is hard since it's an exceptional condition that's
hard to create. I tested by temporarly disabling CP-ACK processing
and checked it worked as expected.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-27 01:09:41 +01:00
Sylvain Munaut d6c35f6e8a gsm_04_11: Release SMS transaction only after starting next one.
This ensures that we don't re-use the same transaction ID.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-24 15:10:06 +01:00
Sylvain Munaut c4052cf9a8 gsm_04_11: In gsm411_send_sms_lchan fix transaction id error handling
We need transaction_id to be a int (as returned by trans_assign_trans_id)
to detect the error condition -1.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-24 15:10:01 +01:00
Harald Welte d0cf7ba687 introduce multiple log levels (DEBUG/INFO/NOTICE/ERROR) to SMS code 2009-12-24 15:08:18 +01:00
Harald Welte ffa55a4e87 statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code
very easily, while having only one routine that stores all of the
current counter values to the database.  The counters are synced
every 60 seconds, providing relatively fine grained statistics
about the network usage as time passes by.
2009-12-22 20:42:40 +01:00
Harald Welte 4983921af1 [gsm_04_11] Replace hardcoded transaction_id by real allocation
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-22 13:45:58 +01:00
Harald Welte 24ff6ee0a3 keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and
performance.
2009-12-22 00:41:05 +01:00