Commit Graph

82 Commits

Author SHA1 Message Date
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
Steffen Neubauer ac0c13c02c [sms] bugfix: additional functionality indicator only appears in TP_VPF_ENHANCED - not in TP_VPF_ABSOLUTE 2009-12-21 23:27:54 +01:00
Sylvain Munaut feaca92fc0 Use 'new' rather than 'unknown' when starting transaction
'unknown' has a negative connotation for a case that's totally
normal so refer to it as 'new' so it doesn't sound like a problem.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:16 +01:00
Sylvain Munaut c56a14181c Fix transaction_id displayed in debug message
In SMS debug messages, we always display the transaction ID
as if we were 'sending' the message.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:04 +01:00
Sylvain Munaut 1d9efd6c9c Fix typos in debug message / comments
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:21:51 +01:00
Steffen Neubauer ad69d7f8b2 [sms] trivial: Removed unneeded double check in unbcdify 2009-12-05 12:07:12 +05:30
Steffen Neubauer f326267fb7 [SMS] Implement TP-VPF-ENHANCED
While doing so, we also restructure/reorganize the vailidity period
parsing in general.
2009-11-26 12:28:41 +01:00
Harald Welte ccda96517c move 'struct value_string' and 'get_value_string()' to gsm_data 2009-11-12 22:28:18 +09:00
Steffen Neubauer 5727cf4ea7 [SMS] implement GSM340_TP_VPF_ABSOLUTE
- Added function "gsm340_scts" to decode the service center time stamp
  into a UTC/GMT timestamp
- in function gsm340_validity_period: can now decode validity period
  format absolute.
2009-11-11 23:02:07 +09:00
Holger Hans Peter Freyther dc1e1058f3 Fix warnings by removing unused variables 2009-10-22 15:40:33 +02:00
Sylvain Munaut 6b0b103bdc [gsm_04_11] Free transaction on RX_RP_ACK for SMS
When only one SMS is sent, the freeing of the lchan will
automatically free all transactions on the lchan.

However, if there are several SMS sent at once, the call
to gsm411_send_sms_lchan will create a new transaction
with the same caracteristics as the previous one. If
the old one is not free'd, the next call to trans_find_by_id
(triggered by the next incoming RP-ACK) will not return the good
transaction and things go haywire.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-09-27 11:16:22 +02:00
Harald Welte (local) ee4410a4f3 actual code running at end of har2009 2009-08-17 09:39:55 +02:00
Harald Welte (local) 0abaf33297 paging_request() now returns the number of started paging requests
this helps the caller to determine if he will ever get called back
or not (and if he should free his data structures now or not)
2009-08-15 11:25:45 +02:00
Harald Welte b2dc37f512 Merge commit 'har/master' 2009-08-15 03:21:45 +02:00
Daniel Willmann d5d5e1d460 Fix decoding of SMS Data Coding Scheme 2009-08-15 03:19:40 +02:00
Harald Welte e903edf580 provide return code from paging_request() function
this enables the caller to detect if the paging request was rejected
by the paging layer, especially in case it is already paging this very
subscriber.

In the case of SMS / 04.11, we used to have a memory leak of struct gsm_sms's,
since we would only free them from the paging succeeded/expired callbacks.
2009-08-15 03:16:17 +02:00
Daniel Willmann 6b024cb83a Handle SMS with UCS2 and binary userdata 2009-08-15 03:15:08 +02:00
Harald Welte (local) d19e58b13c move talloc context creation out of on_dso / constructors
the various constructors get called in a non-obvious, linker determined
order, which makes certain objects disappear from the talloc report.

This change moves the talloc context creation into a new talloc_ctx.c file
2009-08-15 02:30:58 +02:00