Instead of simply exiting the application we will handle it by
giving up all SCCP connections, once we have the MSC back we will
send a GSM 08.08 reset message, and we will free all resources
related to these connections. This includes the primary and secondary
lchan of these connections.
While we are not connected to the MSC we will handle each message
that would open a SCCP connection by giving up the lchan. This has
only been compile tested and will need to be manually tested during
a test session.
This also highlights a DoS that could be used against OpenBSC
by setting up a lchan but never send any GSM L3 message. We will have
to fix that at some point.
When we disconnect from the MSC handle it by pushing the problem
to our connected clients. We will simply close all connections,
reject all new BSC connections and attempt to reconnect to the MSC.
Create a BSC<->MSC interface and use it for the BSC MSC IP and the
BSC NAT to reduce code duplication on handling reconnects to the MSC
and cleaning up the local state. The code is only partially tested
and will contain bugs. Currently both the BSC and the NAT will just
exit on connection loss and this way have the current behavior.
The latency of setting up of the TCP connection can be quite high,
it is better to connect in a non blocking way. This code is working
by setting the socket nonblocking and temporarily replacing the
bfd callback with the connect handling.
Once the OS has connected our socket we switch back to normal operation.
In case we disconnect with some pending operations we will need to
signal the MSC that something is wrong. This could be by sending a
RLSD directly, or a clear command. Another part of the fix is to
respond with a RLC on unknown RLSD messages.
The SCCP stack was changed to give the ownership of the msgb
to the system integration, this allows us to use the stock write
queue to queue the write and write the msg to the MSC once we
are connected again.
Instead of deleting the msgb within the SCCP library the implementor
of the write callback needs to free it. This is required for non
blocking io with the server.
It is possible that the MSC is not sending the channel type it
needs for the operations it wants to do. Add a configuration option
to assign a TCH in case of paging any requests. It can be a good
idea to leave SDCCHs free for location updating requests.
Store the mapping from request to channel type in the GSM Network
struct as there is some policy involved with handling the request.
E.g. in a half rate network we don't want emergy calls to be getting
a TCH/F, or we want to have a different policy for early/late assignment
of phone calls.
Update the table when creating the network and when the neci is changed.
Together with the previos -e Number option one can easily turn on
debugging without needing to remember the category masks for a quick
check on what is going on.
Similar to the bsc_rll.c code we need to indicate if we want to
send the data on the SACH or on the normal signalling link. For
CC and any other SAPI=0 usage this bits must be zero, whener we
try to do something with SMS this bit needs to be set to one.
When we are on a TCH/H or TCH/F always use the SACH for SAPI!=0
for the establishment otherwise it will never be answered. This
can be tested by starting to page with a traffic channel and then
trying to submit the SMS.
The code in 354ef81d80 checked
for fd >= 0 but on startup the struct is memset to 0 so this
test is true. Initialize the fds to -1 to make the code work
and be able to handle all ranges of the fd.
In case the put_lchan is making the refcount drop to zero use the
release reason specified in the put_lchan call. This is used by the
BSC MSC IP implementation for the assignment handling where the old
channel is getting closed with a local end release (1).
Keep a static version as the shell script is not dealing well
with branch tags/names containing text.
Resolve merge conflict in the Makefile.am by adding both sides
to the list of sources for the libbsc.a
Conflicts:
openbsc/configure.in
openbsc/src/Makefile.am
Attempt to read the three byte IPA header. If we read 0 then
the socket can be closed otherwise we need to read three bytes, if
we don't we do have a failure.
After having parsed the header we need to evaluate the length,
if the length is bigger than would fit into our buffer we will
ignore that and print an error.
This is fixing a crash when the BTS is crashing...
This code used to be a sleep, it was changed to be a timer by Andreas
but this timer does not seem to have any use. When doing the sw load
this timer is increasing the upload time dramatically, reduce it to
make it work faster.