Commit Graph

3074 Commits

Author SHA1 Message Date
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 c407ba5ed2 Merge branch 'zecke/sms-queue' 2010-12-26 09:42:19 +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