Commit Graph

6115 Commits

Author SHA1 Message Date
Philipp Maier 51442a7886 osmo-bsc: rename calling_addr to msc_addr
The variable name "calling_addr" is not very expressive. Change
the variable name to "msc_addr".

Change-Id: I3a43880d4172063e78bfef1556dbb037f20a9a99
2017-07-25 15:14:15 +02:00
Philipp Maier 88824c7c7d osmo-bsc: change calling/called addr in VTY
The vty commands:
 called-addr my_msc
 calling-addr my_bsc

are not very expressive to the user. Change the command
names into something more expressive:

 msc-addr my_msc
 bsc-addr my_bsc

Also change the function and variable names accordingly

Change-Id: I8d46aad01fb80afcaccb966fadd6b2ecbd1a1f9e
2017-07-25 15:14:15 +02:00
Philipp Maier 6202b37a0b osmo-bsc: change calling/called_addr variable names
"calling_address" and "called_address" is not very expressive.

change the respective struct memeber names of bsc_msc_data to
bsc_addr and msc_addr to increase readability of the code.

Change-Id: I63b2e810b97131c690edd5a9cc5c7b3b54ec5e12
2017-07-25 15:14:15 +02:00
Philipp Maier dd93694587 osmo-bsc: check configured sccp addresses before start
do not start unless the user has configured sufficient SCCP
addresses via VTY. Do not accept address that lack point codes
or ssn

Change-Id: I42b4fb0ef93dec225e220e88e1b92664b9b55be3
2017-07-25 15:14:14 +02:00
Philipp Maier ead844e65e osmo-bsc: make sure only default SSNs are used
The VTY technically allows setting custom values for the
SSN. However, SSN values and their purposes are well
standardized.

If the user has configured an SSN, check that is compliant
to the standard. If not, warn and ignore the setting by
using the stanard SSN.

If the user left out the SSN, automatically use the standard
SSN.

Change-Id: Ib34fe0474f625b964dbfedfb4263fb0b5f976bdc
2017-07-25 15:14:14 +02:00
Philipp Maier d6278889c4 cosmetic: fix typo in log output
Change-Id: I8d76a61e28c0677e121586c1fe4666baa7196b18
2017-07-25 15:14:14 +02:00
Philipp Maier 2535d12377 osmo-bsc: only clear connections of a specific MSC
The BSC clears all connections on reception of a
BSSAP RESET, however, the RESET command must not
affect the connections of other MSCs.

Ensure that only the connections of the MSC who
actually sent the BSSAP RESET are cleared.

Change-Id: I68fe2eadeae8ba6b6728fced42f6308e9b2d997a
2017-07-25 15:14:14 +02:00
Philipp Maier ed21f2eecf osmo-bsc: Make SCCP-Addresses configurable via VTY
Add VTY commands to configure the sccp-address of the BSC
and the one of the MSC.

Change-Id: I49cedc0ce339defa6fb354f6fb9b1af7820da7cc
2017-07-25 15:14:14 +02:00
Philipp Maier 31b05fe895 common-vty: add ss7 nodes commands to VTY
The current VTY implementation has no knowledge about the
libosmo-sccp nodes and therefor can not resolve parent nodes,
nor decide if we deal with a config node.

Change-Id: I815a57ed6270bd55c25ee9a8f45026d4aaad9004
2017-07-25 15:14:14 +02:00
Philipp Maier e4b33dd303 osmo-msc: finish msc-sided reset
finish the implementation for msc sided reset, automatically
register connecting BSCs.

Ensure that all sccp connections are cleared when the reset
procedure executes.

Change-Id: Iba3f5523795c6972600bbfda2a02b06ba84ea12d
2017-07-25 15:14:14 +02:00
Philipp Maier 184892b371 msc_vlr: fix linker problem in testcase
Swap libmsc.a and libcommon-cs.a to make symbols from
libcommon-cs.a available to libmsc.a

Change-Id: I16fdd58d0b542aca987865a6bb7ca0f996693e81
2017-07-25 15:14:14 +02:00
Philipp Maier 8a3c5a0699 mgcp: Fix missing call id in DLCX
The call id field in the DLCX message is missing. Use the endpoint
id as call id in all CRCX and DLCX messages.

Change-Id: I8b78b76126c63c4882e982c64c3953dbe1dab179
2017-07-25 15:14:14 +02:00
Philipp Maier 7d5e706964 reset: fix allocation and add deallocator for reset procedure
When the reset is started, state machines are allocated. The user
must provide a correctly filled structure where the reset start
function adds the state machine into.

This is prone to errors, besides of that, a proper deallocator
function which tears down the osmo fsm is missing.

make a more cofmortable allocator function and add deallocator
function.

Change-Id: I0054fb31589fb9f4c63c45df436e83448c59bd97
2017-07-25 15:14:14 +02:00
Neels Hofmeyr 04d1ca7895 aoip: don't use iu struct: move rtp ports from .iu to new subscr_conn.rtp
Change-Id: Ib1a84b0733655b2e87c1598ae9df0640cdca833b
2017-07-25 15:14:14 +02:00
Neels Hofmeyr e4dc412e7b aoip: don't use iu struct: do not allocate unnecessary ue_conn_ctx
Change-Id: I06c4c3eac3cf95cef78d49f1462096d6350f226a
2017-07-25 15:14:14 +02:00
Neels Hofmeyr 1f94ba58ea osmo_bsc_main: use osmo_sccp_make_addr_pc_ssn() for SCCP addresses
Change-Id: I91eb444def4715652f7988189a58e1168ef15d19
2017-07-25 15:14:14 +02:00
Neels Hofmeyr 104548372c AoIP+3G: use one common SCCP client for A and IuCS
Move osmo_sccp_simple_client() setup out of iu_init() and a_init().
In msc_main.c and sgsn_main.c, initialize the STP connection first and then
pass to iu_init() and a_init().

This allows serving 3G (IuCS) and 2G (A) from one and the same MSC instance.

Since both OsmoHNBGW and OsmoBSC are using PC 23 by default now, move BSC to PC
42 (because OsmoBSC typically has vty port 4242, bla).

Also:
a_iface.c: remove now unused defines
a_init(): remove osmo_ss7_init() call that duplicated msc_main.c

Change-Id: I963a94e1a0bfc455992d22940dcc9c67c44570b9
2017-07-25 15:14:14 +02:00
Neels Hofmeyr 79b2387c0b msc: re-enable iu_init()
Change-Id: Iee7fa94d3f6880847020f3e0dfe7ed7672d4fb23
2017-07-25 15:14:14 +02:00
Neels Hofmeyr 39bc234f9e a_init: use name arg for sccp client and user bind
Change-Id: Ie281e8a486471e1d48a1444a07795e97c17627f2
2017-07-25 15:14:14 +02:00
Philipp Maier 3a401548ce a_iface: fix typo in function name
Change-Id: Ia545a0daec6336732f1bcaa01e27c843eb732dd8
2017-07-25 15:14:14 +02:00
Philipp Maier cc12b708a7 a_iface: Check if channel type and speech codec list are successful
Currently we do not check for errors during the generation of
channel type and speech codec list. This might blow an assertion
in gsm0808_create_ass if the generated data is invalid. So
we need to check beforehand.

Change-Id: Ifa7ba00e0d731a3c43a8dbfac893c71d63559eb5
2017-07-25 15:14:14 +02:00
Philipp Maier 114c4ff913 rsl: fix stray line break in logtext
The log output from the rsl layer injects line breaks at wrong
places in the log. This messes up the logtext. This commit fixes
the problem.

Change-Id: Ibebffd52a551ead0f5486a56a92774204b337c7d
2017-07-25 15:14:14 +02:00
Philipp Maier 9fa9783dc6 mgcp: fix line-break problem in log
When the mgcp_client prints MGCP strings in the log text, it does
not remove the line break before printing. This will mess up
the log text. This patch removes the line break characters before
printing properly.

Change-Id: I7fce23a50371ce94a8f2d8aef2fe9d2001d41b8c
2017-07-25 15:14:14 +02:00
Neels Hofmeyr 3d09bbbbc4 apply function renames in merged libosmocore patches
Change-Id: Ic659d6d79a6284732e1837f8b0947e8a128ddd87
2017-07-25 15:14:14 +02:00
Philipp Maier 34ed929877 osmo-bsc: react on reset requests from MSC
The bsc side currently can not receive reset commands from an
MSC. This patch adds required functionality to receive a reset
command and acknowlege it properly. The effects are the same
as with when sending resets (all drop all ongoing calls and
sccp connections)

Change-Id: I44c7e54c845948c54614b36d97d2ba1e760ac46b
2017-07-25 15:14:14 +02:00
Philipp Maier fef5ee84f2 libcommon-cs: genralize a interface reset fsm
The AoIP standard also describes an MSC->BSC reset procedure. We
currently do not implement it. However, the fsm that is used to
issue the reset request from the bsc side is not generalized. This
patch generalizes the code in order to be able to use the same
code on the MSC side to perform a reset procedure from there.

Change-Id: I65e20bebb126ba35122ca3a545393d18fcadf5ad
2017-07-25 15:14:14 +02:00
Philipp Maier ad228e16cf fixup: remove unused counter
Forgot to remove the counter struct osmo_timer_list msc_reset_timer;
Needs to be fixuped into the reset handling patches

Change-Id: I6d397188732f4593edc12459de6f3b5f47b7f06a
2017-07-25 15:14:14 +02:00
Philipp Maier 869842e16c sccp-lite: remove old sccp-lite code
in osmo_bsc_sccp.c all code is commented out. There is no point
in keeping the file. This commit deletes it.

Change-Id: I5c9f15a658c41fd872db7b078d38fbfdeb2bdcbd
2017-07-25 15:14:14 +02:00
Philipp Maier 3bac10082a osmo-bsc: Send USSD notification when an MSC loss is detected
the old sccp-lite based imlementation offered support for sending
an USSD notification as soon as a loss of the MSC connection is
detected. This is done before forcefully dropping the affected
connection.

This commit ports the feature to the new libosmo-sigtran
implementation.

NOTE: I do not know if this works and I also do not really
understand how this is even possible. Sending an USSD notification
would rquire the subscriber to be properly attached? When the MSC
is lost this almost not possible since no backend to authenticate
against is available.

Change-Id: Idaadf8d708608843e3c36ed35b3661b48096c21b
2017-07-25 15:14:14 +02:00
Philipp Maier 158d842969 cosmetic: make function names in a_iface_bssap more expressive.
The function names in a_iface_bssap.c are not very expressive.
The problem not only exists on the API side, but also for static
functions. This patch replaces the function names with more
expressive names.

Change-Id: I1cdf37e4034ed8a9536c253c13910fc436c66f04
2017-07-25 15:14:14 +02:00
Philipp Maier a2ec888287 cosmetic: more expressive function names in a_iface
The function names if the API function in a_iface.c are not
very expressive. Besides of that, the prototypes are in the
wrong header file. This commit gives the function more
expressive names and moves the prototypes in the right header
file.

Change-Id: I6af4b7deed9d11ac5fe188eb5625fba50caad7c1
2017-07-25 15:14:14 +02:00
Philipp Maier 1a331b5405 fixup: return with value in void function
Change-Id: Iab2569205eac9cb96a7d6f756f087413af5fc68c
2017-07-25 15:14:13 +02:00
Philipp Maier 83d75bb19a mgcp: make bts base port configurable
Currently the rtp base port of the BTS is hardcoded (4000) and not
configurable. This patch adds VTY configuration options to make
it adjustable.

Change-Id: I76e008eb0bd95b2941b67ea2fbdc1a82eef3cc5f
2017-07-25 15:14:13 +02:00
Philipp Maier 7a8e4a0215 Revert "mgcp: make sure all endpoints are closed on startup"
Clearing all endpoints by sending a DLCX on startup has ben found
to be a bit too offensive. It also will not help against
inconsitancies that may occour during runtime (e.g. an overheard
DLCX during regular call teardown).

This reverts commit b669ea94cb78fd9b56ee8dd9392538151349f8ba.

Change-Id: Ia3bd8bfe9a09e300cf11629f7d7e3012ca8f394d
2017-07-25 15:14:13 +02:00
Philipp Maier d4d44cacbc mgcp: Make sure endpoint is free on CRCX
The MSC is aware of the assigned endpoints at all times, so it
will not assign an occupied endpoint to someone else. However,
if it has just restarted, there maybe lingering open endpoints.

This patch introduces a fairly simple soultion. Before a new
endpoint is seized (CRCX), a DLCX is send in advance. If the
endpoint was still occupied with a dead connection, it will
be freed. If it was free anyway, the DLCX will just have no
effect.

Change-Id: I7990e9e7c4c8101b8772ab5505a7cc11f8f7cd23
2017-07-25 15:14:13 +02:00
Philipp Maier 554488dee8 a_iface_bssap: clear lingering subscriber connections on reset
When the BSC is vanishing, the subscriber connections will stay
active until the MSC is instructed via tha A interface to clear
the connections. Unfortunately, this will most likely not be
the case because the BSC will most likeley have lost all its
state and does not know about the old connections anymore.

This patch fixes the problem by looping through the list with
the active gsm subscriber connections and clearing them manually
when the reset from the BSC is received. Only connections by the
bsc who actually executes the reset are affected. Connections
from other BSCs will not be touched.

Change-Id: Ic2b43b937d08a6dea4fe70dbc3eb722323338dc1
2017-07-25 15:14:13 +02:00
Philipp Maier d46c75dac9 cosmetic: fix typo
Change-Id: I2cfea36a5626605ecb72d0f0927ac1a731aa1609
2017-07-25 15:14:13 +02:00
Philipp Maier 2a6629b27e mgcp: make sure all endpoints are closed on startup
If the MSC is crashing and restarting, it may leave some endpoints
open. The endpoints can not be re-used until they are deleted
(DLCX). This patch sends a DLCX to all possible endpoints (usually
this is in a countable range) in order to clear possible open
endpoints from a previous run

Change-Id: I9de2f67ffe08b2d76574ef4470c7a9767ca74702
2017-07-25 15:14:13 +02:00
Philipp Maier 95e1a3b53c mgcp: make structs accessible from outside
struct mgcpgw_client and struct mgcp_inuse_endpoint are not
accessible from outside, making it difficult to look in the
mgcp client properties and status. The commit moves the
structs into the header file.

Change-Id: I20dcdaac013e3bcbd870eaf34a17598eac373f95
2017-07-25 15:14:13 +02:00
Philipp Maier 00a0862e9c mgcp: release no longer used endpoint identifiers
When an MGCP endpoint is deleted, we need to mark its endpoint
id as unused, so other calls can used it. This is currently not
happening. This patch fixes that.

Change-Id: I346affea940efb3a55e9b34c28a6cbe676d57d56
2017-07-25 15:14:13 +02:00
Philipp Maier d4195472f5 mgcp: improve endpoint management
Currently the assignment of endpoint identifiers works by just
incrementing a counter. The mgcpgw only has a limited amount
of endpoint identifiers avaliable, this means we will run out
of endpoints after only a few calls.

This commit adds a mechanism to keep track of used endpoint
identifiers so unused endpoint identifiers can be re-used

Change-Id: I081f9178975b6593a7ab8de5261a29a1d43d36a3
2017-07-25 15:14:13 +02:00
Philipp Maier 741b987923 mgcp: use mgcp DLCX command to terminate endpoint after call is done
Currently no DLCX command is sent to the mgcpgw when a call is over,
this leaves the endpoint open. This means that the endpoint can not
never be reused by other calls. This patch adds a DLCX that
terminates the the endpoint when the call is done.

Change-Id: Ifc5a7a62fc07b4b7fee612d52e949fcd6a8e04ed
2017-07-25 15:14:13 +02:00
Philipp Maier 3398964176 mgcp: add DLCX command to mgcpgw client
The mgcpgw client currently lacks support for DLCX. This patch
adds a generator function to generate a DLCX command as well.

Change-Id: I1ac4635fc1371f2d3a46815f26a1f9ede3eedafa
2017-07-25 15:14:13 +02:00
Philipp Maier c5bb5816cd cosmetic: fixing coding style
Change-Id: I9dc3b1d2990ad6c89932d77632c3b22748e8361e
2017-07-25 15:14:13 +02:00
Philipp Maier 1c832b34b1 fixup: in osmo-bsc-sigtran.h header (bsc_msc_data.h) was missing
Change-Id: I4220bc9a3a6f13fd6b09c3a7edadea5b8823d1c5
2017-07-25 15:14:13 +02:00
Philipp Maier 88e9ecbfb5 osmo-bsc: Handle RESET/RESET-ACK properly
Improve the way the BSC executes its RESET/RESET-ACK sequence.
Currently only a simple bool variable serves as a state holder.
We set this variable to true when we receive the RESET-ACK
message. Unfortunately no further checking is done. This
patch replaces the old mechanism with a more elaborated
implementation which also detects a loss of the connection
and makes sure to reconnect properly afterwards. Also the
all open connections are closed on connection loss

Change-Id: I876319b15103cc395e74597a52ce4d1a934915f4
2017-07-25 15:14:13 +02:00
Philipp Maier 3386a8791e sccp: Use osmo-stp instead of direct server/client connection
This patch adjusts the code to use osmo-stp. This is only an
intermediate solution, since we still have hardcoded parameter.
Next step is to use the VTY options from libosmo-sigtran to
issue the configurations.

Change-Id: I2b02bf159051beed6ff3afc66fcfb7a30e8d2541
2017-07-25 15:14:13 +02:00
Philipp Maier 2529f046e8 fixup for: aoip: signal channel type to BSC
The channel type and the speech codec element is now
signalled to the BSC. The BSC checks both fields and
select a codec by its preference. The choosen speech
codec and the choosen channel (type) is returned to
the MSC. Currently the MSC ignores the return values

Change-Id: I5c422a1e831f572e493db9756cf45e7a0b7ec7d0
2017-07-25 15:14:13 +02:00
Philipp Maier ae819a1be4 aoip: signal channel type to BSC
obtain the permitted speech and the prefered channel parameters
and signal it to the MSC with the channel type field.

Change-Id: I642480fa408dee7a4f40f7aab95f40383b3e91af
2017-07-25 15:14:13 +02:00
Philipp Maier 2878423b95 osmo-msc: Integrate A interface into existing call control
The MSC already has some basic call control handling mechanism, that
was primarily used with 3G before. However, the already existing
code that handles the 3G calls is also perfectly fine for handling
2G calls. This commit integrates the A interface without breaking
it for 3G.

Change-Id: Ib61cf2987823958314c9016d5a3f494c1aaaabbc
2017-07-25 15:14:13 +02:00