Commit Graph

622 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 231163d365 [ipa] Change names of RTP methods to follow MGCP naming
IPA is naming these functions CRCX, MDCX, DLCX to follow
the naming of the MediaGatewayControlProtocol. Change the
code to go from BIND to CRCX (create connection) and from
CONNECT to MDCX (modify connection).

Connect indicates that it is only possible to call it once
while it is possible to call it more than once to modify
the audio parmaters and such. So the IPA terminology is
making a bit more sense here (now that we know it).
2009-11-19 09:40:03 +01:00
Holger Hans Peter Freyther 25f30ba00a misc: Add routine to generate backtrace from within the application
E.g. to analyze the subscr_get/subscr_put behavior one can place
the generate_backtrace into the functions, recompile and then filter
the output with contrib/bt.py to get the function name, file and line.
2009-11-19 09:40:03 +01:00
Harald Welte a8dffc512b Merge remote branch 'origin/master' 2009-11-18 09:23:11 +01:00
Harald Welte 61a83b2aec max_power_limit: the limit is 24 dB ! 2009-11-18 09:20:22 +01:00
Holger Hans Peter Freyther a6bcc74716 [gsm48] When picking AMR we need to supply the multirate config
On channel mode modify and assignment command when using
the a multirate code the multirate configuration must be
present in the packet.
Add a parameter and add a warning when using it in a
broken way.
2009-11-17 18:20:17 +01:00
Holger Hans Peter Freyther 135a7c65cd [neci] Separate handling of chan requested for paging any
Allow to handle the channel requested differently based
on the NECI value for the "paging any" case. This will allow
to open a TCH/H, TCH/F depending on the neci mode.
2009-11-17 18:19:25 +01:00
Holger Hans Peter Freyther 843b44d261 [neci] Use the correct length when going over the array
Use the correct length when going over the array instead
of using the neci0 values. Remove the fixme from the method
as well as the issue has been addressed by adding a parameter
to the method.
2009-11-17 18:19:19 +01:00
Holger Hans Peter Freyther fe9da827fd [paging] In expiration handling remove the request before doing the callback
Not doing this could lead to a double deletion due the paging
request being removed during the callback and afterwards as
well. Change the code to save the callback data, remove the
request, do the callback.

A patch was proposed by Andreas Eversberg and this one is
based on it.
2009-11-17 10:16:46 +01:00
Andreas.Eversberg 1059deb782 Fix configuration file generation
Assign the encryption status to the right variable.

Signed-off-by: Holger Freyther <zecke@selfish.org>
2009-11-17 09:55:26 +01:00
Holger Hans Peter Freyther f7d752f7ac [si] Make it possible to set the NECI value...
Allow to configure the NECI value... and change code
that is relying on the NECI value.
2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther 0fef39a8ac [rsl] Improve error message when the lchan allocation is failing 2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther 057fec5336 ipaccess-config.c: Spelling fix in the config mode 2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther c7df7c6e42 [ipaccess] Fix spelling in the comment 2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther e723eac5a3 [telnet] Remove unused variables from the telnet interface
These became unused when the interface was switched to
use the vty module. It is about time to remove these.
2009-11-17 09:46:33 +01:00
Harald Welte 986c3d76db fix some more compiler warnings 2009-11-17 06:12:16 +01:00
Harald Welte d8cfc90e22 [abis_nm] avoid integer-to-pointer casting and associated gcc warnings 2009-11-17 06:09:56 +01:00
Harald Welte b54d950ac1 silent call: add header file for function prototypes 2009-11-17 06:00:23 +01:00
Harald Welte 20f9831168 VTY (silent sms / sms): better error reporting 2009-11-14 10:11:45 +01:00
Harald Welte af8c7b497e silent sms: make it silent again (type 64), fix subscriber refcount leak 2009-11-14 10:10:54 +01:00
Harald Welte a148233b5e Add "silent call" feature to OpenBSC
This allows the administrator to use the vty interface to issue a silent
call to a given subscriber by using
	"subscriber extension XXXX silent call start"
and stopping that silent call with
	"subscriber extension XXXX silent call stop"
2009-11-14 10:08:40 +01:00
Harald Welte 98f9c75094 [VTY] restructure sms and silent sms commands 2009-11-14 08:00:53 +01:00
Harald Welte 793a1355d6 [VTY] Add feature to send silent SMS from console
"Silent SMS" is a SMS that is delivered (and confirmed) but
not shown on the display of the phone.  You can now send
such SMS by using
	sms send silent extension 12345 text
or
	sms send silent imsi 123451234512345 text
2009-11-14 06:11:14 +09:00
Harald Welte cf01b8ff56 ipaccess-config: Print BCCH info test reports
This will print test rep[orts that look like:
<0020> ipaccess-config.c:91 TEST REPORT: test_no=0x43 test_res=PARTIAL
<0020> ipaccess-config.c:140 ==> ARFCN 37, RxLev 24, RxQual  0: 262-1, LAC 13830 CI 10759
2009-11-13 14:43:15 +01:00
Harald Welte 654c9df3c8 [OML] don't hexdump bcch info 2009-11-13 14:42:52 +01:00
Harald Welte aff237d739 [OML] fix bugs in BCCH info parser for ip.access 2009-11-13 14:41:52 +01:00
Harald Welte 999549d9ae [OML] more verbose error reporting in case object instance unknown 2009-11-13 12:10:18 +01:00
Harald Welte b40a38ff46 [ip.access] Parse cell global ID as part of BCCH info 2009-11-13 11:56:05 +01:00
Harald Welte 5bde51b91e make ipaccess-config compile again (remove duplicate testres_name definition) 2009-11-13 11:23:16 +01:00
Harald Welte 0f255857d4 ip.access: Introduce parser function for BCCH Info test result 2009-11-12 14:48:42 +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
Harald Welte d409be7fae change some identifiers from u_int64_t to unsigned long long
makes printf much easier on 64bit platforms...
2009-11-07 00:06:19 +09:00
Holger Hans Peter Freyther ccf53c60c5 [mncc] Fix possible transaction/subscriber and real life subscriber leak
In the case a transaction has been already scheduled return 0 was
called but the subscriber and transaction would leak. Fix it by
calling subscr_put and trans_free.

After claiming the channel also remove the reference on the subscr.
2009-11-06 23:38:34 +09:00
Holger Hans Peter Freyther e33966cec2 vty: Do not leak the gsm_subscriber 2009-11-06 23:33:59 +09:00
Harald Welte 9aa6fd90ca Merge remote branch 'origin/master' 2009-10-30 09:18:31 +01:00
Sylvain Munaut d7d1c99a53 ip.access: Header has a 16bit length in network byte order
This is confirmed by looking at the source of their dissector.
The length can go up to 273 bytes apparently (again, according
to the source of their dissector).
2009-10-29 16:33:59 +01:00
Holger Hans Peter Freyther 5ba6f48092 [lchan] Keep track which SAPIs has been established with the BTS
Keep track of which SAPIs have been established either by the
BTS (from the MS) or by us. This can be used by the on-waves
BSC code to figure out if a new request should be made.
2009-10-29 04:20:21 +01:00
Holger Hans Peter Freyther 5ea731338d [misc] Use talloc_zero instead of talloc and later memset 2009-10-29 02:29:45 +01:00
Holger Hans Peter Freyther ba92587cd5 misc: Use NULL instead of integer value for a NULL pointer 2009-10-27 10:42:53 +01:00
Holger Hans Peter Freyther 67b596199d input/ipaccess.c: clang says ret might be uninitialized
and it appears to be right that for the "default" case ret
will not be assigned and we return ret.
2009-10-27 10:08:38 +01:00
Holger Hans Peter Freyther 423bfe915c abis_nm.c: Remove duplicate entry from the table 2009-10-27 10:08:20 +01:00
Holger Hans Peter Freyther f520e6439a [gsm48] Handle the RR CHAN MODIFY ACK in the gsm04_08_utils
Move the handling code to the gsm_04_08_utils.c and add a
note that the method value needs to be checked.
2009-10-27 04:52:30 +01:00
Holger Hans Peter Freyther ff3f260e4f [gsm48] Move RR CHANNEL MODIFY to gsm_04_08_utils.c
Be able to send RR CHANNEL MODIFY from the BSC/MSC code
as well. Move the method that knows about the IPAccess RTP
and issues the "bind" to the utils tool
2009-10-27 04:52:29 +01:00
Holger Hans Peter Freyther e81a6109f9 [gsm48] Add generation of ASSIGNMENT COMMAND to the 0408 utils
Add code to generate an assignment command for a given lchan. It
is expected that the lchan is modified already and the mode will
be picked up from their. Currently only the mandantory items
are supported.
2009-10-27 04:52:29 +01:00
Holger Hans Peter Freyther 55aac6e868 ipaccess-config: Introduce stream-id/oml_tei to make it work again
ipaccess-config stopped working after the introduction of
multi-TRX/RSL stream id support in commit 8175e95222.

Set the oml_tei to 0xff by default and add an option to set
a different stream id.
2009-10-27 03:41:09 +01:00
Harald Welte 8c8f791dbe [USSD] more whitespace fixes 2009-10-26 20:42:55 +01:00
Harald Welte 17e5f97958 [USSD] whitespace fixes
This is a purely cosmetic patch
2009-10-26 20:42:07 +01:00
Mike Haben 2449b37dfe [USSD] various USSD improvements
- Improved handling of extension-number string (as per review)
- Guard against a buffer-overflow if mobile sends a too-long USSD
- declare some function-parameters const
- fix gsm_ts_name function to display the right BTS number (bts->nr rather than bts->bts_nr)
2009-10-26 20:39:26 +01:00
Mike Haben dc329a6cdb [USSD] eliminate static global variables
This patch removes the need of static global variables and introduces a new,
caller-allocated 'struct ussd_request' that needs to be passed to the various
functions.
2009-10-26 20:39:26 +01:00
Harald Welte 6307b85700 whitespace fixes for the USSD code
This patch is not changing any actual code, just coding style fixes.
2009-10-26 20:39:26 +01:00
Harald Welte 6eafe9137c Add USDD code from Mike Haben
This is the initial checkin of the USSD code from Mike Haben.  I didn't
put it in the main branch as I think it still needs some cleanup.
2009-10-26 20:39:25 +01:00
Sylvain Munaut eb429b7b44 [TLV] Split the parser into 'parse loop' and 'parse single value'
This is needed when you need to manually parse TLV blocks
that don't follow the logic supported by tlv_parse but you
still want to rely on working code and not fiddle with details.
2009-10-26 20:19:59 +01:00
Sylvain Munaut 288a0cf912 [ip.access] Add an example configuration file 2009-10-26 20:16:27 +01:00
Harald Welte 65bdc914f6 Fix segfault, use trx->bts rather than bts in patch_nm_tables() 2009-10-26 20:14:33 +01:00
Harald Welte 85c00cc3d9 Merge remote branch 'origin/master' 2009-10-26 20:12:07 +01:00
Harald Welte 0f890b02f6 ip.access: Use Channel Combination from config file
bsc_init.c still contained a hard-coded channel configuration,
i.e. CCCH_combined on TS0 of C0, and TCH/F on all other channels.

Now it correctly uses the value as specified in the config file.
2009-10-24 10:31:28 +02:00
Harald Welte 9c880c9a9b [GPRS] Add RSL function for ip.access PDCH activation
If we have a dynamic TCH/F / PDCH channel configuration, then
we can either ACTIVATE CHANNEL it for a TCH/F, or we need to send
this vendor-specific PDCH ACTIVATE command to use it as a PDCH.

As opposed to a fixed configuration, this allows an intelligent
BSC channel allocator to use otherwise idle channels as PDCH
as long as no more TCH's are needed.
2009-10-24 10:29:22 +02:00
Harald Welte a1499d00a5 [GPRS] introudce PDCH and PDCH/TCH physical channels
GPRS needs PDCH (Packet Data Channels), and we need support in
our data model as well as OML and RSL for it
2009-10-24 10:25:50 +02:00
Harald Welte daef521ea5 [OML] Add support for ip.access SET ATTRIBUTE message
Since TS 12.21 implements only SET ATTRIBUTE for some object classes,
ip.access had to extend it to be able to set attributes on arbitrary
objects.  We now introduce a function implementing that message.
2009-10-24 10:20:41 +02:00
Harald Welte 55dd443ac2 [GPRS] add data structures for OML of NSE,CELL,NSVCE
Supporting GPRS means we have a number of additional OML objects to
deal with.  We need to extend our gsm_bts structure to at least
include the nm_state for each of those objects.
2009-10-24 10:19:14 +02:00
Harald Welte 73310c3c83 [TLV] extend TLV parser with support for TvLV
Tag-variableLength-Value is an encoding scheme used in the GPRS NS
and BSSGP protocols, where the length value can be 8 or 16 bits,
depending on actual demand.
2009-10-24 10:04:02 +02:00
Holger Hans Peter Freyther ca0fcbe157 [gsm48] Make method name consistent...
We use rx_rr to indicate that we have received a radio resource
message but one method was using rr_rx. Fix that.
2009-10-23 13:48:54 +02:00
Holger Hans Peter Freyther 555eba140d Fix spelling of default 2009-10-22 15:46:16 +02:00
Holger Hans Peter Freyther 2c481b27fc Fix compiler warning. 0 does not work on strings 2009-10-22 15:44:30 +02:00
Holger Hans Peter Freyther ddd918f7ec Fix compiler warning and cast const away.
TLVP_VAL returns a const u_int8_t* and we assign it
to a non const, cast const away.
2009-10-22 15:43:55 +02:00
Holger Hans Peter Freyther 8b77a34131 [rrlp] Fix compiler warnings
The apdu is static const u_int8_t. Change the signature to
have a const in there to make the compiler happy, include
chan_alloc.h for lchan methods.
2009-10-22 15:42:19 +02:00
Holger Hans Peter Freyther dc1e1058f3 Fix warnings by removing unused variables 2009-10-22 15:40:33 +02:00
Holger Hans Peter Freyther 65fb0fda9d Forward declare methods to fix compiler warnings
Put the used method in the header files or use extern
in the case of a vty method used by token_auth
2009-10-22 15:39:37 +02:00
Holger Hans Peter Freyther 2657abfe35 [db] Fix compile warnings in db.c
For the compiler classmark1 is a struct and the compiler is
unaware that it fits into an unsigned int. Use memcpy to
copy it to a u_int8_t (the compiler should inline this).

dbi_conn_quote_binary_copy works on unsigned char* change
q_apdu to be unsigned char.
2009-10-22 15:34:37 +02:00
Harald Welte e73501a4f6 [ipaccess] revert commit 9bd7bc1b4c
Commit 9bd7bc1b4c caused the RSL
initialization to happen too early, resulting in the BTS
bootstrapping but missing [some of?] the system information
types.
2009-10-21 21:16:00 +02:00
Harald Welte 17ddc50338 Merge remote branch 'origin/master' 2009-10-21 20:24:09 +02:00
Holger Hans Peter Freyther 1565bd3226 [timer] Initialize i with zero
In case no timers were registered the result was not defined.
2009-10-21 16:38:19 +02:00
Holger Hans Peter Freyther cbbd49807f [msgb] Add msgb_reset to reset an existing msgb* to the initial state
The reset is useful if one msgb is supposed to be used over and
over again and is avoiding to use msgb_free,msgb_alloc in the
application code.
2009-10-21 16:38:13 +02:00
Harald Welte d99fb99647 [ipaccess] fix ipaccess-config (we now use TEI as stream ID) 2009-10-20 21:54:06 +02:00
Harald Welte 8406ec2437 [nanoBTS] move nanoBTS initialization completely into state event handler 2009-10-20 17:31:00 +02:00
Harald Welte a8bd6d4a34 [abis_nm] introduce debugp_foh() function for object class printing 2009-10-20 09:56:18 +02:00
Harald Welte 77a838dff7 ip.access: use correct stream identifier when connecting RSL 2009-10-20 00:51:01 +02:00
Harald Welte 9bd7bc1b4c input/ipaccess: remove one more static variable 2009-10-20 00:50:03 +02:00
Harald Welte 8175e95222 ip.access: Support multi-TRX / RSL stream ID
In order to support multi-TRX configurations, we need to be able
to cope with multiple RSL streams (each with their own stream identifier)
inside one ip.access TCP connection.

Since this is very similar to using the TEI on a E1 line, we simply
recycle the logic and data fields that are used for the TEI.
2009-10-20 00:22:00 +02:00
Harald Welte 31a74906a3 [abis_nm] print ip.access TCP port in correct byte order 2009-10-19 22:50:30 +02:00
Harald Welte 35d447b022 [abis_nm] print ip.access stream_id in RSL connect ack 2009-10-19 22:49:33 +02:00
Harald Welte 746d6091d9 [abis_nm] introduce and use abis_nm_ipaccess_rsl_connect() 2009-10-19 22:11:11 +02:00
Harald Welte d004a6462a ip.access / multi-TRX: correctly identify TRX number on SW ACT REP 2009-10-19 21:47:54 +02:00
Harald Welte af7b2faf71 ip.access maximum output power depends on GSM band 2009-10-19 21:47:31 +02:00
Harald Welte a62202be31 [abis_nm]: Print Object Class of ip.access messages 2009-10-19 21:46:54 +02:00
Harald Welte 4d0481dbe9 [bsc_init] use new NM_AVSTATE_* enum instead of hard-coded numbers 2009-10-08 20:53:42 +02:00
Harald Welte 4bd0a98a77 [abis_nm] print object class/instance for NACK 2009-10-08 20:49:51 +02:00
Harald Welte 15c44179c3 [abis_nm]: print ip.access SET ATTR [N]ACK 2009-10-08 20:49:44 +02:00
Andreas Eversberg 38ae5cb2c2 use tx delay timer instead of usleep() in ip.access input driver
this fixes the delay of audio caused by stalling of the openbsc process.
the use of 'usleep(100000)' for slowing down transmission to nanoBTS is
replaced by the tx-delay timer. i did this on bs11 code, so i did it the
same way. it actually queues frames for transmission not nanoBTS. on
transmission a timer is started and when this timer expires, the next
frame in the queue is transmitted (timer restarted) until the queue is
empty.
2009-10-08 12:53:16 +02:00
Holger Hans Peter Freyther ca6bc1d10f [gsm0408] Add parameter to gsm48_send_rr_ciph_mode for controling the response
This parameter controls if the response should include the
IMEISV or not. This will be set by the MSC and this is why
this parameter was added.
2009-10-06 04:34:25 +02:00
Holger Hans Peter Freyther ea4088a7ea [gsm0408] Move encryption message creation to gsm_04_08_utils.c
Be able to use the cipher mode command message from the MSC code.
2009-10-06 04:34:25 +02:00
Mike Haben e2d8227499 [ipaccess] Add nanoBTS 1900 support
Add support for 1900 nanoBTS by using unified bts_type
GSM_BTS_TYPE_NANOBTS for 900, 1800 and 1900 versions.

Reduce the nanoBTS enum values to one and derive the
version from the user supplied band. In the future we
might want to do auto band detection.

The configuration file needs to be changed to refer
to nanobts instead of nanobts900/nanobts1800.

Signed-off-by: Mike Haben <michael.haben@btinternet.com>
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-05 12:12:54 +02:00
Mike Haben a03f97775b [ipaccess] Parse Software Activate parameters
Addresses a FIXME in abis_nm.c, parsing the parameters
passed by a Software Activate request.  I've tested this
on three different IpAccess BTSs (including one which
didn't work with the original code), would be good if
someone could check it on a BS11.

Signed-off-by: Mike Haben <michael.haben@btinternet.com>
Tested-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-01 14:58:30 +02:00
Holger Hans Peter Freyther e48b9562a4 [lac] Do not use the reserved LAC 0x0 for two different things
We are using LAC=0 for remembering that a GSM subscriber is
detached. I recently added code to gsm_bts_by_lac that will
return every BTS in case the lac is 0. Harald highlightes
that we would now search for detached subscribers at every
BTS of our network which is clearly not what we want.

Introduce two defines for the two reserved LAC, add a
pointer to the specification, check that our config files
do not contain these reserved values, use the define
and change gsm_bts_by_lac to use the other define.
2009-10-01 04:07:15 +02:00
Sylvain Munaut 86538c7fab input/ipaccess: Fix segv caused by use of uninitialized var
This is a regression coming from the recent split of the
handle_ts1_read method in two.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-01 03:53:31 +02:00
Holger Hans Peter Freyther d5f052230c [ipaccess] Prepare to reuse parts of the code for the A-link
For the MSC<->BSC connection we are going to use the same header
as used from BTS<->BSC but we are not having an E1-Link, a gsm network
or a gsm_bts available and can not use this part of the code.
2009-09-30 06:27:16 +02:00
Holger Hans Peter Freyther 0b7f4b36be [lac] The lac must be 16 bit. Change it in gsm_bts and vty parsing
The LAC can be 16bit of size. the generation of the LAI, struct
gsm_subsriber and the BSC<->MSC was already using it as a
16bit (short) value.

Change struct gsm_bts to parse 16bit and change the vty configuration
parsing code to deal with a short too.
2009-09-30 05:49:26 +02:00
Holger Hans Peter Freyther 927f056f34 [paging] Use paging_request_stop to stop all paging requests
This loop looks a lot like the one inside the paging code. Call
it instead and change the code in paging_request_stop to cope
with a NULL _bts.
2009-09-28 12:50:49 +02:00
Holger Hans Peter Freyther 45f9b3d3fc [paging] Use one of the two reserved LAC to page every BTS
For the on-waves.com MSC case we want to page every BTS reached
of the network. Our gsm_subscriber entry does not have a LAC
entry set and defaults to zero. Use the reserved 0x0000 to
indicate that we want to use every bts in the network.

This will influence the paging code to start and stop paging.
2009-09-28 12:50:49 +02:00
Holger Hans Peter Freyther 3ee5d3e8af [gsm0408] Move paging handling to gsm_04_08_utils.c
Add one method to extract the MI which will allow to load
the gsm_subscriber depending on the MSC/BSC setup and then
use gsm48_handle_paging_resp to finish the paging response
handling.
2009-09-28 12:50:49 +02:00
Holger Hans Peter Freyther adc1478a47 [gsm0408] Move send_siemens_mrpci to gsm_04_08_utils.c 2009-09-28 12:50:49 +02:00
Holger Hans Peter Freyther 9f16a869a5 [subscr] subscr_paging_cb is called for expire and success
Gracefully handle a case where success and expire could fire... I'm
only hitting this when doing something evil to simulate network code
but it seems appropriate to handle this gracefully.
2009-09-28 12:50:45 +02:00
Holger Hans Peter Freyther 049935b9cc [subscr] When paging fails to start, send an expired event 2009-09-28 06:04:40 +02:00
Holger Hans Peter Freyther c4a49e3e2d [bsc] Store the cell_identity in gsm_bts and set it on the SI3 and SI6
Transfering the cell_identity from BSC to MSC is required for the
on-waves.com support. Allow to set the cell_identity in the cfg
file and patch the system information tables to set it.
2009-09-28 06:04:40 +02:00
Holger Hans Peter Freyther 98dd1c85ab [paging] Kill old defines from paging.c 2009-09-28 06:04:40 +02:00
Holger Hans Peter Freyther b28285d8e7 [paging] Implement paging by IMSI.
Try to page by IMSI when the TMSI is not set. This will be required
to properly support the MSC/BSSMAP.
2009-09-28 05:14:25 +02:00
Holger Hans Peter Freyther 2223025e21 [tmsi] Make the tmsi a 4 octet number
tmsi is four octets long, there is no need to make it a string
and then jump through hoops to convert it to a number. Keep the database
using it as a string to benefit from the NULL handling of the db.

Introduce the reserved tmsi which has all bits set to 1 according
to GSM 03.03 §2.4 and start checking for it and make sure the db
code will never allocate such a tmsi.
2009-09-28 05:14:25 +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 23b710fa4f Merge branch 'master' into encryption 2009-09-27 11:13:55 +02:00
Sylvain Munaut 82aa6843ba [abis_rsl] Fix rsl_encryption_cmd L3 length computation
msg->l3h doesn't have any coherent value at that point,
can't use that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-09-27 11:13:18 +02:00
Sylvain Munaut 1dcfc00192 [gsm_04_08] Fix gsm48_send_rr_ciph_mode algorithm ID
The algorithm ID used in the GSM 04.08 RR message is
(x-1) for A5/x. In RSL it's (x+1) for A5/x so there is
a difference of 2.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-09-27 11:11:41 +02:00
Sylvain Munaut 849f554c87 [gsm_04_08] Fix gsm48_tx_mm_auth_req implementation
It was mainly missing the key_seq field, causing the
command to just be rejected by the ME.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-09-27 11:10:17 +02:00
Mike Haben 59d284e8cf non-call related SS (USSD) is not unknown, but unimplemented
also, if we write 0x in front of a number, it should be hex.
2009-09-26 19:00:03 +02:00
Harald Welte 55726d73d7 Use correct capitalization on SQL statements
otherwise, SQLite seems to return the wrong data types ?!?

Signed-off-by: Mike Haben <michael.haben@btinternet.com>
2009-09-26 18:54:59 +02:00
Harald Welte 4381cfe41b add VTY/configfile command for setting encryption (A5) level
This is just configuring the gsm_network property, nobody uses it yet
2009-08-30 15:47:06 +09:00
Harald Welte 08d91a5b26 A5 support for RSL and 04.08 (not used yet)
This just adds the 04.08 and RSL bits for A5, but not the logic
for performing authentication.

The caller would first set lchan->encr and then call
gsm48_send_rr_ciph_mode(lchan), which encapsulates the 04.08
CIPHERING MODE COMMAND into a RSL ENCRYPTION COMMAND and sends it
to the BTS for execution + forwarding.
2009-08-30 15:37:11 +09:00
Harald Welte 196d0528ff [abis_rsl] Set lchan->tch_mode properly when responding to CHAN_RQD
This fixes the 'only first call works' problem that some of us were
having with the nanoBTS.
(the field just happenned to be 0 == GSM48_CMODE_SIGN after startup)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-08-28 23:28:28 +09:00
Holger Hans Peter Freyther 5d0e56f722 [gsm48] Introduce a gsm48_generate_mid_from_imsi method
Prefix generate_mid_from_tmsi with a gsm48_, create a new method
to binary encode the imsi. Add a unit test for parsing and decoding.

The implementation can parse the data it generated and the
last octet seems to be filled with the end mark.
2009-08-20 13:59:14 +02:00
Holger Hans Peter Freyther d1862d7cf9 [gsm48] Move parsing of the MI from to gsm_04_08_utils.c
The parsing of the IMSI is needed for the MSC part as well. Move
it to the gsm_04_08_utils.c so it can be used.
2009-08-20 13:57:12 +02:00
Holger Hans Peter Freyther 081c00d885 [paging] Better use ';' for the command... 2009-08-20 13:57:12 +02:00
Holger Hans Peter Freyther e4e8bf4dd0 [subscr] Change the signature... the gsm_network is in the subscr
Remove the extra parameter from the method, the network can be
taken from the subscriber.
2009-08-20 13:56:45 +02:00
Holger Hans Peter Freyther 4a5cf5f23d [cleanup] Remove old and dead code from the telnet_interface.c 2009-08-20 13:56:45 +02:00
Holger Hans Peter Freyther e78074eb07 [debug] Make the hexdump parameter const
This way it can be used from values coming TLVP_VAL.
2009-08-20 13:56:45 +02:00
Holger Hans Peter Freyther 5ce73fed26 [bsc] Remove HAR feature to advertize neighbor cells
Do not advertize to broadcast on a different frequency, this
was only useful for the HAR2009. The frequency list of the cell
probably needs to migrate into the vty config file.

Revert of ee4410a4f3
2009-08-17 15:56:38 +02:00
Holger Hans Peter Freyther 8b457fb350 [bsc_init] Create a bsc_init.c that can be used for setting up hings.
Share the initialization and bootstraping of the network by moving
the code to a new file and making boostrap_network and shutdown_net
external.

Cleanup the header list after the move and remove trailing whitespace.
2009-08-17 09:52:42 +02:00
Holger Hans Peter Freyther cfa90d4165 [vty] Move layer3+ functionality to vty_interface_layer3.c
Move everything that is policy, requires access to a DB or is
generally in the domain of the MSC to vty_interface_layer3.c.
2009-08-17 09:52:42 +02:00
Holger Hans Peter Freyther 1494a768c1 [bsc] Move the GSM 04.08 helper functions to gsm_04_08_utils.c
The existing gsm_04_08.c implementation is mixing BSC and MSC
behavior. Move some simple parsing and generation functions over
to gsm_04_08_utils.c to allow a different MSC to define the policy.
2009-08-17 09:52:42 +02:00
Holger Hans Peter Freyther 93d4394d1d [msc] Move gsm_04_08.c, mncc and various others to libmsc
Currently we have circular dependencies from libbsc to libmsc
and this requires to play some linker tricks. The problem will
be solved in two ways, first we will get rid of the circular
dependencies and second we can start using --start-group and
--end-group of the linker to play the tricks for us.
2009-08-17 09:52:42 +02:00
Holger Hans Peter Freyther 857e5e6e30 [subscr] Split gsm_subscriber.c in BSC and MSC part
For the BSC part we still assign a gsm_subscriber to lchan but it
might only contain the TMSI of this subscriber.

For the MSC part we will need the HLR/VLR feature of the gsm_subscriber,
specially the lookup's by number...

So if libbsc.a/libmsc.a are compiled in one app and used the
subscribers will be shared, and if only libbsc.a gets used we will
have more empty gsm_subscriber.c..
2009-08-17 09:52:42 +02:00
Holger Hans Peter Freyther 42e327b52f [msc] Introduce a libmsc.a library
Attempt to split up bsc/msc functionality according to the specs. The
libbsc.a will be responsible for communicating with the BTS, configuring
it, paging, channel allocation and passing layer3 messages in both
ways. libmsc.a will implement the policy and such.
2009-08-17 09:52:42 +02:00
Harald Welte (local) ee4410a4f3 actual code running at end of har2009 2009-08-17 09:39:55 +02:00
Harald Welte (local) b8afe81e96 trigger RRLP position requests after paging succeeded and after subscriber attach 2009-08-16 13:18:51 +02:00
Harald Welte (local) 026531ec92 store all APDU's received from the MS in the database
This helps us to analyze data such as RRLP location information for
later analysis.
2009-08-16 10:40:10 +02:00
Harald Welte (local) 6eef564e2d add support for APPLICATION INFO RR messages 2009-08-15 23:32:44 +02:00
Harald Welte (local) db552c56bb don't try to deliver sms to a subscriber that's not registered 2009-08-15 20:15:14 +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 10250e657b sms_from_text needs to return struct gsm_sms * 2009-08-15 03:28:15 +02:00
Harald Welte 731fd91b24 fix printing of TMSI on VTY 2009-08-15 03:24:51 +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
Harald Welte (local) efc92311e2 allow vty to set periodic location updating timer t3212 2009-08-14 23:09:25 +02:00
Harald Welte (local) 143fd51da9 display TMSI in 8 digit hex 2009-08-14 21:17:44 +02:00
Harald Welte (local) 15920de8ce add 'show subscriber cache' vty command to debug subscriber refcount leaks 2009-08-14 20:27:16 +02:00
Harald Welte (local) 05e676356f sms send pending now sends _all_ pending at the same time 2009-08-14 16:01:20 +02:00
Harald Welte (local) 86b17172fd fix sms layer timer leak/corruiption using trans_free()
we only stopped the cp1* timer on reception of cp-ack, but not
in error cases like rx of cp-error.
2009-08-14 14:52:17 +02:00
Harald Welte (local) fed176ab90 implement a timer_list check before we return into the select() loop
this helps us to debug timer_list corruption
2009-08-14 14:30:00 +02:00
Harald Welte (local) daef606502 respect the link_id, not only the SAPI from SMS code
SMS related messages are all sent over SAPI=3.  But in addition
to that, we also need to send it over the correct link identifier,
i.e. SACCH or main signalling channel
2009-08-14 11:41:12 +02:00
Harald Welte (local) c89a511616 add more debugging to SMS layer 2009-08-14 10:42:43 +02:00
Stefan Schmidt 2c2ecdf610 Merge branch 'master' of git@192.168.100.10:openbsc 2009-08-13 21:34:02 +02:00
Stefan Schmidt aa665876c0 Merge branch 'master' of git@192.168.100.10:openbsc 2009-08-13 21:01:25 +02:00
Stefan Schmidt 689537af9d gsm_04_11: Month in unix time starts with 0. 2009-08-13 21:00:44 +02:00
Harald Welte (local) ee9afe332d when in token auth mode, accept phones that are authorized 2009-08-13 20:44:23 +02:00
Harald Welte (local) 2928bc0233 add the allocated subscriber extension to the auth token SMS 2009-08-13 20:43:58 +02:00
Daniel Willmann bc9e9f856b Merge commit 'har/laforge' 2009-08-13 20:30:46 +02:00
Harald Welte 7f69816144 disable emergency call bit (i.e. cell does not support emergency call) 2009-08-13 20:26:10 +02:00
Daniel Willmann eea9337e9e Encode the network name int the MM info messages in GSM 7bit alphabet. 2009-08-13 16:38:56 +02:00
Daniel Willmann 9aef14547a Beautify septet->octet calculation (do not use ceil) 2009-08-13 16:35:00 +02:00
Daniel Willmann 58c83d8368 Support sms with a validity period format of none 2009-08-13 16:08:09 +02:00
Harald Welte (local) 50d127199d fix token auth implementation 2009-08-13 13:52:14 +02:00
Harald Welte (local) aa9dc19ca7 remove FIRST_CONTACT signal, the subscriber flag is sufficient 2009-08-13 13:49:51 +02:00
Harald Welte (local) 3feef255d2 fix token allocation sql strings 2009-08-13 13:26:11 +02:00
Harald Welte (local) 571602f43c fix segfault in vty sms sending code 2009-08-13 13:25:32 +02:00
Jan Luebbe 336f8ec57a allocate a token for new subscribers 2009-08-13 10:15:09 +02:00
Jan Luebbe 06513f26a1 replace the command line option -a with the auth-policy config option 2009-08-13 10:14:59 +02:00
Harald Welte (local) 0e451d0f2e add 'ms max power' vty command to set the maximum MS power in dBm 2009-08-13 10:14:26 +02:00
Harald Welte ccceef8fe9 add code for token auth sequencing
* When we first see a subscriber, send the sms
* when the sms completes, send auth req + auth reject and close the channel
2009-08-13 00:57:54 +02:00
Harald Welte 8c340fee21 factor out the function to generate struct gsm_sms from a string 2009-08-13 00:57:31 +02:00
Daniel Willmann 6b1e822611 Fix gsm_7bit_{en,de}code function and sms user_data calculations
With the 7bit alphabet the user_data_len field needs to be in
septets (characters) and not in octets occupied.
2009-08-12 23:49:48 +02:00
Harald Welte 7984d5c260 add functions to send AUTH REQ and REJECT 2009-08-12 22:56:50 +02:00
Jan Luebbe f0b4cef137 fix random extension generation 2009-08-12 22:22:53 +02:00
Jan Luebbe 9eca37f93c fix problems with tmsi uniqueness in the subscriber table 2009-08-12 22:22:42 +02:00
Jan Luebbe 1da59edf83 fix a wrong format specifier 2009-08-12 22:22:26 +02:00
Jan Luebbe ebcce2aae1 allocate an extension when creating the subscriber 2009-08-12 22:22:20 +02:00
Jan Luebbe 31bef49be2 token support in the DB 2009-08-12 22:21:56 +02:00
Harald Welte c70979a337 add help message about timestamp option 2009-08-12 21:52:11 +02:00
Harald Welte 61cd8831eb patch power reduction into NM attributes 2009-08-12 21:50:41 +02:00
Harald Welte 000c0f44f3 patch the SI and NM attr tables independently 2009-08-12 21:45:02 +02:00
Harald Welte (local) 37a7d361f4 remove printf for every packet in pcap code 2009-08-12 21:04:50 +02:00
Jan Luebbe 370b41d7f1 look up subscriber in memory before loading from DB 2009-08-12 21:04:33 +02:00
Jan Luebbe b0dfc31d7d flag new subscriber structs in memory and send a signal 2009-08-12 21:03:00 +02:00
Harald Welte (local) 7f28cd559a set nominal TRX power for BS-11 and nanoBTS 2009-08-12 20:56:16 +02:00
Harald Welte (local) 5dececfa41 implement bts->cell_barred feature, configurable in VTY 2009-08-12 20:55:00 +02:00
Harald Welte (local) 69de397ff4 add a authorization policy field to the network and VTY
this is not being used yet
2009-08-12 20:53:36 +02:00
Stefan Schmidt a29216b1e1 vty/command: Use CONFIGFILE_MASK as mask in chmod and not as mode. 2009-08-12 20:52:35 +02:00
Stefan Schmidt beccbc3fbe vty_interface: Remove bogus checks for Site ID and BTS ID. 2009-08-12 20:49:18 +02:00
Harald Welte d069deabe4 Merge commit 'origin/master' 2009-08-10 14:45:08 +02:00
Harald Welte 65676fe73f when channel allocator operates in reverse order, prefer SDCCH/8 over SDCCH/4 2009-08-10 14:44:24 +02:00
Harald Welte 9c31b5eeca now that we send MRPCI, we can treat T_MSRFPCI error message as fatal 2009-08-10 14:43:59 +02:00
Holger Hans Peter Freyther 557ca78b49 bsc_hack.c: Unconditionally listen for the nanoBTS
As proposed on the mailinglist, initialize the socket once
and wait for the nanoBTS to connect.
2009-08-10 14:16:08 +02:00
Harald Welte e991c26387 BS11: send measurement report every 5 SACCH frames 2009-08-10 14:09:28 +02:00
Harald Welte 7a8fa412fd add "channel allocator (ascending|descending)" command to VTY 2009-08-10 13:48:16 +02:00
Harald Welte fc0d952602 introduce bts->chan_alloc_reverse flag
The channel allocator can be set in ascending or descending order.

Ascnending means we first try to allocate channels on TRX0, then TRX1, etc.
Descending means we first try to allocate cahnnels on TRXn, then n-1 down to 0.
2009-08-10 13:46:55 +02:00
Harald Welte 8836726348 use list iteration macros to iterate over list of TRX 2009-08-10 13:25:55 +02:00
Harald Welte 349aba603c perform A-bis OML configuration based on config file
This means that the config file is now finally the central source of not only
the E1 configuration on the BSC, but also the E1 and GSM channel configuration
on the BTS.
2009-08-10 12:31:31 +02:00
Harald Welte 21bd3a52f1 move chcomb4pchan to public abis_nm_chcomb4pchan() function 2009-08-10 12:21:22 +02:00
Daniel Willmann 65f68fa961 Add {create, delete}-bport1 and bport0-{star, multidrop} to bs11-config
This adds the possibility to bs11-config to add the second bport and
change the line config to star or multidrop.
2009-08-10 11:49:36 +02:00
Harald Welte 99b4ecd78a Merge commit 'origin/master' 2009-08-10 11:43:52 +02:00
Harald Welte 115d1036d6 rename rsl_channel_release to rsl_rf_channel_release
and add some more comments to help understand the complex release
procedures.
2009-08-10 11:43:22 +02:00
Harald Welte f1676e5f9d add support for more nanoBTS 12.21 tests
* perform a channel usage test
$ ./ipaccess-config -l 64 192.168.100.100
paccess-config.c:142 ==> ARFCN    3, RxLev 16
[...]
<0020> ipaccess-config.c:142 ==> ARFCN    4, RxLev 33
<0020> ipaccess-config.c:142 ==> ARFCN    8, RxLev  6
<0020> ipaccess-config.c:142 ==> ARFCN    5, RxLev 16
<0020> ipaccess-config.c:142 ==> ARFCN   11, RxLev  5
<0020> ipaccess-config.c:142 ==> ARFCN   12, RxLev  8
<0020> ipaccess-config.c:142 ==> ARFCN   10, RxLev  6
[...]

* perform a BCCH usage test
$ ./ipaccess-config -l 65 192.168.100.100
[...]
<0020> ipaccess-config.c:107 TEST REPORT: test_no=0x41 test_res=SUCCESS
<0020> ipaccess-config.c:142 ==> ARFCN    4, RxLev 32
<0020> ipaccess-config.c:142 ==> ARFCN    8, RxLev  6
<0020> ipaccess-config.c:142 ==> ARFCN   12, RxLev  6
<0020> ipaccess-config.c:142 ==> ARFCN   20, RxLev  9
<0020> ipaccess-config.c:142 ==> ARFCN   31, RxLev  6
<0020> ipaccess-config.c:142 ==> ARFCN   37, RxLev 23
<0020> ipaccess-config.c:142 ==> ARFCN   49, RxLev  7
<0020> ipaccess-config.c:142 ==> ARFCN   53, RxLev 14
<0020> ipaccess-config.c:142 ==> ARFCN   57, RxLev 19
<0020> ipaccess-config.c:142 ==> ARFCN   60, RxLev 63
<0020> ipaccess-config.c:142 ==> ARFCN   71, RxLev 15
<0020> ipaccess-config.c:142 ==> ARFCN   90, RxLev  4

* perform a frequency sync test
$ ./ipaccess-config -l 66 192.168.100.100
[...]
<0020> ipaccess-config.c:107 TEST REPORT: test_no=0x42 test_res=SUCCESS
<0020> ipaccess-config.c:130 ==> ARFCN    4, Frequency Error     -2
<0020> ipaccess-config.c:130 ==> ARFCN    8, Frequency Error    -40
<0020> ipaccess-config.c:130 ==> ARFCN   20, Frequency Error    -21
<0020> ipaccess-config.c:130 ==> ARFCN   31, Frequency Error      1
<0020> ipaccess-config.c:130 ==> ARFCN   37, Frequency Error     -4
<0020> ipaccess-config.c:130 ==> ARFCN   45, Frequency Error     -4
<0020> ipaccess-config.c:130 ==> ARFCN   53, Frequency Error     22
<0020> ipaccess-config.c:130 ==> ARFCN   57, Frequency Error      3
<0020> ipaccess-config.c:130 ==> ARFCN   60, Frequency Error      0
<0020> ipaccess-config.c:130 ==> ARFCN   69, Frequency Error      2
<0020> ipaccess-config.c:130 ==> ARFCN   73, Frequency Error     30
<0020> ipaccess-config.c:130 ==> ARFCN   89, Frequency Error     44
<0020> ipaccess-config.c:130 ==> ARFCN   90, Frequency Error      8
<0020> ipaccess-config.c:130 ==> ARFCN  123, Frequency Error     27
2009-08-10 11:39:47 +02:00
Harald Welte ddfdef1529 Merge commit 'origin/master' 2009-08-10 11:28:33 +02:00
Harald Welte 3c456d06e0 use proper message discriminator for MRPCI
Siemens overloaded the definition for location based services, so
our automatic determination of the message discriminator no longer
works fine.
2009-08-10 11:26:14 +02:00
Holger Hans Peter Freyther 100325a87e bsc_hack.c: Explain why the program will exit... 2009-08-10 10:36:06 +02:00
Harald Welte 3ac7f10450 add code to GSM 04.08 to send MRPCI message once we have classmark2
* afert we receive a CM SERVICE REQUEST
* after we receive a PAGING RESPONSE
2009-08-10 10:12:45 +02:00
Harald Welte 31c489390c make rsl_siemens_mrpci() use struct rsl_mrpci 2009-08-10 10:07:33 +02:00
Harald Welte 67fa91bf42 Add function to generate siemens-specific MRPCI RSL message
MRPCI (MS RF Power Indicator) informs the BTS about the power
capabilities of the MS.
2009-08-10 09:51:40 +02:00
Holger Hans Peter Freyther d5d1cef7c2 bsc_hack.c: Allow to use a different file for the config file 2009-08-10 08:39:27 +02:00
Holger Hans Peter Freyther 850326e377 db.c: Move the schema revision check after creating the tables
When starting the first time there are no tables, doing a revision
check will fail and bsc_hack will exit without tables created. Do
the revision check within db_prepare and allow new tables to be
created before.
2009-08-10 08:36:04 +02:00
Holger Hans Peter Freyther 6d30a35d21 vty: Avoid implicit declaration warning and check result code 2009-08-10 08:26:15 +02:00
Holger Hans Peter Freyther c423a12392 vty: Fix format string issue 2009-08-10 08:26:15 +02:00
Holger Hans Peter Freyther 656b129812 vty: Make the argument const 2009-08-10 08:26:14 +02:00
Holger Hans Peter Freyther 336f509941 ipaccess.c: Make the compiler happy...
The compiler thinks the variables might not be initialized, we
know it is wrong... but just make it happy.
2009-08-10 08:26:14 +02:00
Holger Hans Peter Freyther 4e2973d2d3 misdn.c: Fix warning about redefining AF_ISDN..
We use the same construct in e1_inpit.c, use it here too.
2009-08-10 08:26:13 +02:00
Holger Hans Peter Freyther e4042c72d7 misc: Remove some obviously unused and unneeded variables.. 2009-08-10 08:26:13 +02:00
Holger Hans Peter Freyther 09e364b167 misc: Fix warnings about returning with value...
return rc in these cases.
2009-08-10 08:26:12 +02:00
Holger Hans Peter Freyther 1ddb356912 rtp_proxy: Add two case and a DEBUG statement..
Handle the case values to make the compiler happy and a runtime
warning... This is similiar to other places of the code
2009-08-10 08:26:12 +02:00
Holger Hans Peter Freyther 966de68539 db: Fix warning about truncating the size
We are truncating the size and might should simply use a MIN
here to get the returned size or the maximum we can hold..
2009-08-10 08:26:07 +02:00
Holger Hans Peter Freyther 34e97495a6 misc: Add prototypes to header files, include more header files
Fix various warnings about implicit declarations of functions.
2009-08-10 07:54:02 +02:00
Harald Welte e58ca7c181 revert commit b400dd8f64 regarding NECI=0
As it turns out, we start to allocate SDCCH for voice calls.  Since we
don't yet implement switching from SDCCH to TCH during call setup,
this leads to various problems.
2009-08-10 02:14:46 +02:00
Harald Welte 0b2124be48 set BS power to Pn == nominal output power
This is only relevant for TRX1, since TRX0 will always opwerate at constant
power.  However, when channels on TRX0 are activated, we should provide
a reasonable BS poewr level.
2009-08-10 00:45:40 +02:00
Harald Welte b400dd8f64 We're using NECI=0, but the channel reauest reasons we're seeing from MS's are wrong
So we don't know what's the problem.  Using the NECI=1 tables makes us allocate SDCCH
for MO SMS, which is good.
2009-08-10 00:26:50 +02:00
Harald Welte b7e8116bfa add T3101 to release lchan in case MS never responds to IMMEDIATE ASSIGN 2009-08-10 00:26:10 +02:00
Harald Welte 4198561305 add SMS CP timer TC1* to tear down lchan in case MS never responds to CP-DATA 2009-08-10 00:24:32 +02:00
Harald Welte 0d544e7db5 fix off-by-one error in calculating RPDU length for CP-USER-DATA IE 2009-08-10 00:22:19 +02:00
Harald Welte 6c3d2edebf the RELEAESE MODE IE is mandatory 2009-08-10 00:19:36 +02:00
Harald Welte 89e9d5927e chane TRX0/TS0 channel combination to not include a CBCH
We don't support CBCH anyway, and using CBCH will reduce the number of uesable
SDCCH/4 channels to 3 on TS0
2009-08-09 22:01:26 +02:00
Harald Welte 39c7debc9c verify bs11 channel combination constraints 2009-08-09 21:49:48 +02:00
Harald Welte 1e0a8ea4d5 Merge branch 'master' into config_file
Conflicts:
	openbsc/src/vty_interface.c
2009-08-09 19:55:21 +02:00
Harald Welte 369cc27f3b Merge commit 'origin/master'
Conflicts:
	openbsc/src/vty_interface.c
2009-08-09 19:53:12 +02:00
Harald Welte 3073a9f241 if we receive CHANNEL ACTIVATE NACK, we should release the lchan 2009-08-09 19:50:08 +02:00
Harald Welte cf6a3819aa SMS improvements
* send more pending messages after RP-ACK of DELIVER has been received
* send pending messages after RP-SMMA has been received
* clear the transaction when sending CP-ACK in MT/DELIVER case
* always use the same transaction ID (since my assumptions about
  SMS transactions were wrong)
* try to deliver messages through existing lchan rather than starting
  paging
* send pending SM's after LOCATION UPDATE ACCEPT has been sent
2009-08-09 19:07:41 +02:00
Harald Welte ee5ad16582 ensure we send the LOCATION UPDATE ACCEPT before issuing any signal 2009-08-09 19:07:00 +02:00
Harald Welte d11ea93e26 ensure that we use the SACCH where apropriate for RLL connections 2009-08-09 19:06:24 +02:00
Harald Welte 2ebabca32a new db_sms_get_unsent_for_subscr() function
The function retrieves the oldest not-yet-sent SM for the given subscriber
2009-08-09 19:05:21 +02:00
Harald Welte d0b7b7719f add ud_hdr_ind to SMS table
we also implement verification of the database schema number by
using the 'Meta' table.
2009-08-09 19:03:42 +02:00
Harald Welte 1a6f79818e move search for existing lchan for subscriber to new function
There's now a new function called 'lchan_for_subscr()' which can be
used to determine if there is any existing lchan for this subscriber.
2009-08-09 18:52:33 +02:00
Harald Welte f9daefd65b add SMS sending commands to vty
You can now type commands like
	'sms send extentsion 1003 This is a test message'
to trigger paging and delivery of the message 'This is a test message'
to the subscriber with extension 1003.  There's also a variant that uses
the IMSI of the subscriber.

Messages sent this way are only attempted to deliver immediately.  If
immediate delivery fails, there is no attempt to store it in the database.
2009-08-09 15:13:54 +02:00
Harald Welte cb8f443399 implement proper SAPI3 handling for SMS
SM's need to be transferred over their own RLL connection on SAPI3, rather than
the default SAPI0 connection that we're using for signalling like 04.08
RR/MM/CC.

This is not that much of a problem in the case of SMS SUBMIT from the MS to
the netwrok.  In that case, the MS will start its primary RLL connection
with SAPI3, and we can just respond with SAPI3.

However, in the case of SMS DELIVER to a MS, we first page the MS, it then
establishes SAPI0.  We then need to explicitly request the establishment of
a SAPI3 RLL connection, before we can send CP-DATA with our RP-DATA and DELIVER
RPDU

Now that we have the bsc_rll.c code, we can actually wait for a paging
response, and from the paging response request the establishment of the SAPI3
connection.  We will be called back once that connection is open and can
successively start transmission of the SM.
2009-08-09 14:59:02 +02:00
Harald Welte 66b6a8dde0 move ms_pwr utility function to gsm_utils.c
also, they should both take the gsm_band parameter, not a BTS
2009-08-09 14:45:18 +02:00
Harald Welte 31f03a6df6 configure MS CCH max power IEI of SI3 and SI4 to 20dBM (100mW) 2009-08-09 14:38:49 +02:00
Harald Welte 1c40927355 fix timer and linked list handling of new RLL code 2009-08-09 14:13:58 +02:00
Harald Welte edcc527371 Add new BSC RLL layer of code
A caller can call rll_establish(lchan, link_id) and a callback to the GSM RLL
code.  He will get called back if the RLL link is established or receives some
error message, or the establishment times out.

We need this for proper SMS implementation, where we need to restablish a SAPI3
RLL link before transmitting the actual CP-DATA messages.
2009-08-09 13:47:35 +02:00
Harald Welte 42b4557fca ensure vty code uses talloc_strdup() rather than regular strdup 2009-08-08 17:41:43 +02:00
Harald Welte 1bf1972d29 use one talloc context for entire vty code 2009-08-08 17:41:33 +02:00
Harald Welte 42581829ec the actual config file code (not just config files)
this was missing from commit a08a9acdb6
2009-08-08 16:12:58 +02:00
Harald Welte 3c5cb256c2 Merge branch 'master' into config_file
Conflicts:
	openbsc/src/vty_interface.c
2009-08-08 16:08:54 +02:00
Harald Welte 76042188e0 first 'working' SMS implementation
we now have the full path from the MS into the database (SUBMIT), as well as
back from the database to the MS (DELIVER).  The database gets correctly
updated once a SMS has been successfully delivered.

What's still missing is the periodic scan over all undelivered messages,
trying to deliver them to the respective MS.  So far, you have to manually
trigger this on the telnet interface with 'sms send pending 1'
2009-08-08 16:03:15 +02:00
Harald Welte 1d014a5dfc parse_btstype() can use const qualifier 2009-08-08 15:38:29 +02:00