Commit Graph

789 Commits

Author SHA1 Message Date
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
Holger Hans Peter Freyther d2aba27744 vty: Rename define to not clash with talloc's version of it 2009-08-10 07:52:50 +02:00
Holger Hans Peter Freyther bc621c2e1e misc: Fix make distcheck
Add some missing header files
2009-08-10 06:48:54 +02:00
Holger Hans Peter Freyther 7673ce4ebe misc: Firs round of fixing compilation of test cases
Next round should be using them again
2009-08-10 06:40:05 +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 cf845cb8d3 add comments about channel combinations 2009-08-09 21:49:37 +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 ce2eb871e1 fix SMS RP message type definitions to reflect SMMA and MT ERROR 2009-08-09 14:58:21 +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 e122855f3c define data structure for gsm48_cell_sel_par IEI of SI3 / SI4 2009-08-09 14:38:32 +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 dc2c029098 Merge branch 'master' into sms 2009-08-08 16:04:57 +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
Harald Welte f6cea1db99 when paging a MS, use the channel type indicated by caller
The existing code always paged for a TCH/F, which is really wasteful
when considering the delivery of SMS messages.

Also, increase the verbosity of the debug message a bit.
2009-08-08 15:08:19 +02:00
Harald Welte d2dc1de9d9 start using the RLL RELEASE procedures
So far, we immediately disable the RF channel without following a proper
RLL RELEASE procedure.  This patch changes this.

If we locally terminate the connection, the channel allocator now triggers a
RLL RELEASE REQuest, which is responsed by the MS with a RLL RELEASE CONFirm,
based on which we send the RF CHANnel RELease to the BTS.

If the MS terminates the connection, we receive a RLL RELEASE INDication,
based on which we trigger RF CHANnel RELease to the BTS.
2009-08-08 13:15:07 +02:00