Commit Graph

6584 Commits

Author SHA1 Message Date
Neels Hofmeyr 2868b3ec43 send the RAT type (GERAN-A / UTRAN-Iu) to HLR on LU
Use new OSMO_GSUP_RAT_TYPES_IE to transmit the subscriber's RAT type to the
HLR.

Depends: I3e399ca8a85421f77a9a15e608413d1507722955 (osmo-hlr)
Change-Id: I1b0c43c5ab03bc4dd146fdb3f5479b131d4f3b67
2018-12-26 18:48:20 +01:00
Neels Hofmeyr 3b0808196d use osmo_rat_type from libosmocore
Replace locally defined enum ran_type with libosmocore's new enum
osmo_rat_type, and value_string ran_type_names with osmo_rat_type_names.

The string representations change, which has cosmetic effects on the test suite
expectations.

Change-Id: I2c78c265dc99df581e1b00e563d6912c7ffdb36b
2018-12-26 18:26:07 +01:00
Alexander Couzens 8ee7f936bd deploy include/osmocom/
Change-Id: I6935626f1b16e2910a53ca8123582f712269b644
2018-12-26 01:34:08 +01:00
Alexander Couzens 98a5efaf2d include: install ran_conn.h as it's used by the osmo-sip-connector
Change-Id: I7279d4364341275654c2ec943e116eb2a18e049d
2018-12-26 01:22:34 +01:00
Alexander Couzens ada0f7c231 msc/ran_conn: ensure enum ran_type has defined values
as this is sent over the network, it's important to have well defined types
2018-12-26 00:20:37 +01:00
Alexander Couzens 9fcc523314 mncc: add field ran 2018-12-26 00:20:29 +01:00
gsmevent admin 0514e80fc9 gsm_04_08_cc.c: drop non-sensible error message 2018-12-25 14:26:22 +01:00
Neels Hofmeyr a0e39fee4d use mgcp-client configured endpoint domain name
Rationale: reading pcaps becomes so much easier when each of osmo-bsc and
osmo-msc address their MGW with differing domain names. Otherwise, both will
have a '0@mgw' endpoint and it gets really confusing.

After this, with according configuration, there can be a '0@bsc' and a '0@msc'
endpoint.

osmo-mgw-for-msc.cfg:
 mgcp
  domain msc

osmo-msc.cfg:
 msc
  mgw endpoint-domain msc

Depends: Ia662016f29dd8727d9c4626d726729641e21e1f8 (osmo-mgw)
Change-Id: I87ac11847d1a6d165ee9a2b5d8a4978e7ac73433
2018-12-24 15:45:52 +01:00
Neels Hofmeyr ea621a7227 msc_vlr_tests: tweak logging in verbose mode
Change-Id: Ia06245f3adc6cf4c483d9c12c387cd5169582353
2018-12-24 15:45:52 +01:00
Neels Hofmeyr 50fba5e487 err log: fully log MS supported A5 algos on mismatch
Change-Id: Icb18e0f0bb420de066e7eb8fc683f192ba2a7368
2018-12-24 15:45:52 +01:00
Neels Hofmeyr c741c5026c tweak fsm_msc_mgcp FSM and FI name
Instead of

  MGW(MGW_99)

use a name of

  msc-mgcp(MSISDN:2331_GERAN_A:00000017_trans99)

1. The FSM is communication towards an MGW, not the MGW itself. When reading
combined logging (gsmtap_log), it is confusing to read 'MGW' in a log coming
from the MSC. The API is also called msc_mgcp_*.

2. Calling the FSM instance 'MGW_' again doesn't make sense.

3. Indicate 'trans' before the trans_id (trans_id was already shown, but not
indicated what it was).

4. Also indicate the actual subscriber's identification.

5. Also indicate the RAN connection and conn_id.

This comes up while trying to understand a call coming in on an already
established call: parsing the log with a human brain is near torture without
this info, taking extremely long to get grips on.

Change-Id: Ie5fc1ffb7eba0209fee4666a075655cd24d27473
2018-12-24 15:45:52 +01:00
Neels Hofmeyr 1fbf45c291 enrich context for vlr_subscr_name and ran_conn fi name
Include all available information in vlr_subscr_name(); instead of either IMSI
or MSISDN or TMSI, print all of them when present. Instead of a short log,
rather have more valuable context.

A context info would now look like:

  Process_Access_Request_VLR(GERAN-A-3_IMSI-901700000014706_MSISDN-2023_TMSI-0x08bde4ec_PAGING_RESP)

It does get quite long, but ensures easy correlation of any BSSAP / IuCS
messages with log output, especially if multiple subscribers are busy at the
same time.

When showing the RAN conn id, instead of

  GERAN_A-00000017

write

  GERAN-A-23

- We usually write the conn_id in decimal.
- Leading zeros are clutter.
- Don't mix - and _ separators.

These changes are combined to produce only one burst of humungous amounts of
msc_vlr_tests expected output. That is definitely a weak point of these tests:
blowing up the git history. OTOH they do show logging changes nicely.

Change-Id: I66a68ce2eb8957a35855a3743d91a86299900834
2018-12-24 15:45:51 +01:00
Neels Hofmeyr 4fdefe537d abort assignment on Assignment Failure
If Assignment fails in the BSC, trigger an EV_TEARDOWN_ERROR in the mgcp_ctx
FSM instance, so that the call gets torn down immediately. Before this, the
non-call would idle around without anything happening.

Related: OS#3236
Depends: I11b182a03f5ecb6df7cd8f260757d3626c8e945d (libosmocore)
Change-Id: I358cfbaf0f44f25148e8b9bafcb9257b1952b35a
2018-12-24 15:45:51 +01:00
Neels Hofmeyr aed4b1579d fix: incoming call during ongoing call
If a call is already busy and another call is coming in, do not try to
immediately assign an lchan (before this patch, it fails because there already
is an mgcp_ctx for the conn). Leave the second CC transaction waiting.

When a call is hung up, as soon as the old mgcp_ctx is discarded, look for
other CC transactions that are waiting. If there is one, trigger assignment, so
a new mgcp_ctx is set up for the new call.

This fixes the following scenario:

- from A, call B.
- from C, call B; B rings during ongoing call.
- in B, pick up the call, choose to drop the old call.

After this patch, and with osmo-bsc patch with change-id
  I0c00ec2c120e5008281755adcd4944a3ce4d8355
we are now able to talk to the new caller.

I currently haven't tested yet what happens if there is *three* peers trying to
talk to the same number, running out of lab phones (not really, just not
bothering now). Possibly we should be taking over the particular call indicated
by the CC TI; instead, the current patch version takes on whichever waiting
call it finds first. This is fine if *one* additional call comes in on an
ongoing call, and this is already a huge improvement to what we had before.

Related: OS#3735
Change-Id: I0ba216b737909e92080a722db26e3577726c63cb
2018-12-24 15:45:51 +01:00
Neels Hofmeyr f1b0fe143e move trans->assignment_done to cc.assignment_started
The flag is set to true when an assignment has been started, and it is only
relevant for a CC transaction. So fix naming and place in cc struct.

Cosmetic preparation for I1f8746e7babfcd3028a4d2c0ba260c608c686c76 and
I0ba216b737909e92080a722db26e3577726c63cb/

Change-Id: I8dacf46141ba0b664e85b0867ade330c97d8495f
2018-12-24 15:45:51 +01:00
Neels Hofmeyr 37944691de remove code dup: add msc_mgcp_try_call_assignment()
Various places in the code check a flag whether assignment was started and
launch it. To fix incoming-call-during-ongoing-call, I will tweak that logic.
To be able to do that only in one place, remove code dup.

Cosmetic preparation for I1f8746e7babfcd3028a4d2c0ba260c608c686c76 and
I0ba216b737909e92080a722db26e3577726c63cb/

Depends: I11b182a03f5ecb6df7cd8f260757d3626c8e945d (libosmocore: LOGPFSMSL)
Change-Id: I11c0b7dc3f1a747028629b48e522bb3b864884ba
2018-12-24 15:45:51 +01:00
Neels Hofmeyr c1c4a13206 release RTP stream only for matching CC transaction
Do not break the currently ongoing call when rejecting a second incoming
caller.

There may be multiple (up to seven) simultaneous CC transactions, and there is
one mgcp_ctx for the currently active RTP stream.

Release the MGCP context only when the active CC transaction is releasing.
Before this patch, any CC transaction release would destroy the single MGCP
context, possibly breaking the currently ongoing call (another CC trans).

This also fixes a possible use-after-free if there were pending MGCP message
responses for the MGCP context; they are canceled properly for a released
transaction, but since one transaction would free the other transaction's MGCP
state, the clean up did not take place and possibly caused an mgcp client
response handling to access a freed mgcp_ctx.

Related: OS#3735
Change-Id: I1f8746e7babfcd3028a4d2c0ba260c608c686c76
2018-12-24 15:45:50 +01:00
Neels Hofmeyr 7cd1b89fd3 cosmetics in msc_mgcp_call_release()
Use local variables instead of writing trans->conn-> all the time.

Cosmetic preparation for I1f8746e7babfcd3028a4d2c0ba260c608c686c76 and
I0ba216b737909e92080a722db26e3577726c63cb/

Change-Id: I99717b3b72a9d7cbc95455ea25b2018ec1755308
2018-12-24 15:45:50 +01:00
Max 3332ac4430 MNCC: use log wrapper for call processing
Add log/debug wrappers to conveniently print local and remote call
references.

Change-Id: I5c44d7bb28f1ff895dd4f839d75840495503c916
2018-12-23 09:51:53 +00:00
Stefan Sperling b361ea7037 use vty->type instead of local variable
We can check if we're parsing the config file by checking
whether vty->type equals VTY_FILE. This avoids the use of
an extra local variable to track the parsing state.

Change-Id: I85161575e025f7c389832427a434bd8e2d6ecc75
Fixes: 1051c42088
Related: OS#3355
2018-12-21 12:38:47 +00:00
Neels Hofmeyr b12b6cb006 fix test_nodes.vty after libosmo-mgcp-client vty changes
osmo-mgw I98a9f1f17a1c4ab20cea3b08c7d21663592134d6 broke the build here. Fix
that.

Change-Id: I20e37c5228928b67e67f16aef0eb2930d21ef60a
2018-12-20 04:42:10 +01:00
Neels Hofmeyr 4e0bd4b598 mgcp log tweak: say RAN, not BTS, like surrounding logging
Change-Id: Ibb40155189a7f05ba2da4fcf9cf03fda5ffc3683
2018-12-19 17:17:06 +00:00
Neels Hofmeyr 5d66970cd7 fix msc_mgcp_fsm_evt_names: two missing events
Change-Id: I66ebaf0a55de1a46bccbc86652ffa9b73c951ebf
2018-12-19 17:17:06 +00:00
Philipp Maier 6d71ccf484 msc_vty: also show IMEI and IMEISV
When the VLR subscriber information is shown on the VTY it shows IMSI
and TMSI, but not IMEI and IMEISV. Since in some cases this information
might be helpful, lets display it as well.

Change-Id: Iedd75dbb9850388ec1fedb984ed0b8bf4c62e780
2018-12-19 12:27:17 +00:00
Max 7d41d870de Remove redundancy in LAC processing
Always use LAC which is part of Cell Global ID otherwise we might end up
in a situation where separately stored LAC differs.

Both are described in 3GPP TS 23.008 $2.4 as temporary subscriber data
to be stored in VLR. Both are defined in 3GPP TS 23.003. The LAC is part
of LAI which is part of CGI so there should be no case when those values
differ for a given subscriber.

Change-Id: I993ebc3e14f25e83124b6d3f8461a4b18f971f8e
2018-12-19 11:48:33 +01:00
Philipp Maier 2a0ac3b162 msc_vty: display current RAN type
When a subscriber is displayed the RAN type is not included in the
overview. Meanwhile the MSC supports multiple different ran types it
becomes important to see in which RAN the subscriber is currently
active.

Change-Id: I000cafd5e41b9951d51b6bd6672ee68a224b8212
Related: OS#3615
2018-12-19 10:17:59 +01:00
Philipp Maier 89561bc4e7 msc_vty: display subscriber flags
When a VLR subscriber is displayed on the VTY we get a lot of meta
information, but there are also some flags to handle the internal
subscriber status e.g. conf_by_radio_contact_ind. Lets display those
flags as well as this information can be very helpful when debugging
problems in the VLR

Change-Id: I59a9145a4daad50d68de3fd5c3291f027256917f
2018-12-19 10:17:59 +01:00
Neels Hofmeyr 14c6f3ee95 vty: show subscriber: put() before printing the use count
Do not show the VTY command's own use count during 'show subscriber <ID>'.

When using 'show subscriber msisdn 2023', I was surprised to see a use count of
2 and suspected a use count leak. With 'show subscriber cache' however, the use
count is 1.

So I realized it is the vty command's own use count that makes it two, besides
the lu_complete=true one.

Change-Id: Id02b57b7ed299b010b9f8b9e809548eb1e6aa699
2018-12-18 18:01:26 +00:00
Max 4776b0526c VLR: drop unused struct members
Change-Id: I322072653b41cf250aa2c1e346e00bae884feb84
2018-12-18 17:57:27 +00:00
Max c4e4fa762c Use proper type for tch_rtp_connect() parameter
Change-Id: I6e2efcd2e25d6ec2ff35a4b8cfcda02abe97fa59
2018-12-18 17:46:15 +01:00
Max 33b6d0c2dd VLR tests: avoid leaking LAC access details
Avoid leaking details on accessing data structure for LAC value into
test output: that's irrelevant clutter which forces unnecessary test
output modifications.

Change-Id: I4a1d7884cf47ad513d7d6fb27c5c6f1b829dff2e
2018-12-18 15:36:49 +01:00
Max bb53a3f64a VLR tests: add logging macro with explicit value description
To avoid leaking structure details into test we sometimes have to
separate value description from actual value. Introduce new macro which
makes that possible and convert old one into trivial wrapper around it.

Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
2018-12-18 14:35:10 +00:00
Max 964da93c69 CC: log more details about unhandled message/state
Change-Id: I8e0febd04f7338aed7222dcfcd9bfddc7b8fda59
2018-12-17 17:45:41 +00:00
Max 020ec7ac0c cosmetic: drop unused variable
Change-Id: Iff358eb2328cdd052e66b572aeec1b767174949b
2018-12-17 17:36:25 +01:00
Neels Hofmeyr 5c8b144ebd comment: vlr: put the 'balancing' comment closer to the put()
Change-Id: Ic42768b22d63d182455c8d860961c44159973d0c
2018-12-17 14:39:16 +00:00
Neels Hofmeyr d50f8988f7 vlr_lu_fsm: drop unused out_state INIT -> WAIT_IMEI
There is no state transition from INIT to WAIT_IMEI, only to WAIT_SUB_PRES.

If there were code to skip WAIT_SUB_PRES, the allowed state transitions would
have to be the same as for WAIT_SUB_PRES, i.e. also WAIT_IMEI_TMSI and
WAIT_TMSI_CNF. For now just opt for the status quo.

Change-Id: I18ef9e8c96b52401d98f49dc410f13681231b533
2018-12-17 14:39:16 +00:00
Neels Hofmeyr 5f1ac6dce6 tweak comment to indicate sub_pres_vlr fsm as dead code
sub_pres_vlr_fsm_start() only ever has an effect if ms_not_reachable_flag ==
true. But there simply is no code that sets this flag. So
sub_pres_vlr_fsm_start() is currently dead code.

Also, examining the FSM, if it should ever be set to true, this would halt the
LU/CM Service/Paging response, since the FSM would merely change its state
without dispatching asynchronous messages. No chance of finishing.

Short of dropping the code entirely, first just mark it. The point being that
this models some FSM definition from 3GPP specs, and we have a couple other
"if (0)" branches in the VLR...

Change-Id: I198d442e9ed288f37c7d4e5ec87b82dc53114e99
2018-12-17 14:39:16 +00:00
Neels Hofmeyr 88063dd368 log: by default start with all categories on LOGL_NOTICE
They were on DEBUG during early development stages, and it's high time that I
drop those back to NOTICE.

Change-Id: I3b46e9107a7a1d81a44d2a2eb855c10960a1ab6b
2018-12-17 13:50:49 +00:00
Max b099a7f8ad cosmetic: drop duplicated #include
Change-Id: I216425ba5994a49981d51bce6cfa7c3fa5fe9e40
2018-12-17 10:49:50 +01:00
Stefan Sperling 1051c42088 require 'ipa-name' option to be set via config file
The 'ipa-name' option can now only be set via the configuration file
because changing the IPA name at run-time conflicts with active
GSUP connections and routes configured in the HLR. The osmo-msc
program must be restarted if its IPA name needs to change.

Change-Id: I6cff91793e646e0396e8f1bc87d0f52709e5f12a
Related: OS#3355
2018-12-13 10:16:49 +01:00
Neels Hofmeyr 85cb2538f4 Revert "move ASS-COMPL MGCP handling out of a_iface_bssap.c"
Two reasons:

- the caller of msc_mgcp_ass_complete() from Iu, iucs_rx_rab_assign(), failed
  to be adjusted, breaking IuCS, as an --enable-iu --enable-werror build shows.
  Unfortunately our gerrit verification doesn't --enable-werror for osmo-msc.

- the condition of requiring ST_MDCX_RAN is faulty, breaking GSM CS.

This reverts commit 212c0c9bda.

Change-Id: I8348675c2f7c8856ea1682d05ee54160d4cfeb96
2018-12-11 19:52:30 +01:00
Stefan Sperling 36dedeeb12 provide software version information to gsup peer
Provide software version information to the GSUP peer. The version now
shows up in logs like this: Software_Version='osmo-msc-1.2.0.120-1263b'

Change-Id: I2eba32569349facdbb1fda201067c62cc804ccf4
Depends: I317d6c59f77e92fbb2b875a83dc0ec2fa5cb6006
Related: OS#3355
2018-12-11 13:08:00 +00:00
Stefan Sperling afa030d6f9 make gsup ipa name configurable in osmo-msc.cfg
Add a 'ipa-name' VTY command which overrides the default IPA name
used by the MSC. This is a prerequisite for inter-MSC handover.

Related: OS#3355
Change-Id: I317d6c59f77e92fbb2b875a83dc0ec2fa5cb6006
2018-12-11 13:08:00 +00:00
Neels Hofmeyr aa14bac370 LU: do not always invoke sub_pres_vlr_fsm_start()
sub_pres_vlr_fsm_start() starts the FSM, invokes the START event, and then this
FSM invariably always directly terminates when vsub->ms_not_reachable_flag ==
false.

So if it is false, there is not much use in instantiating a whole FSM instance
that just terminates again, we might as well directly issue the
parent-term-event and save some logging space.

The same condition is already in place in the vlr_proc_acc_fsm.c in
_proc_arq_vlr_node2_post_vlr() for CM Service Request and Paging Response. Now
also skip this for LU.

Change-Id: Id2303a795dfd381f76e94ff8ff2f495926ca8ba0
2018-12-11 11:37:27 +00:00
Stefan Sperling ad797ce2bb detach cancelled subscribers from VLR
When a subscriber is cancelled, fake an IMSI detach to
ensure that the subscriber gets removed from the VLR.

I am not entirely sure if this change is correct but
it does make TTCN3 test MSC_Tests.TC_gsup_cancel pass.

Change-Id: I5918106e4a94ba2e6c61bcd7b90d3bf0565513cc
Related: OS#2886
2018-12-11 09:16:15 +00:00
Neels Hofmeyr 325f106b34 drop gsm48 RR ciph mode compl from permitted initial messages
It is a message that is initially permitted, but it is in fact not handled in
the L3 code but already before, upon receiving
BSS_MAP_MSG_CIPHER_MODE_COMPLETE.

Change-Id: I0079f07271ca76bd457d0e700f3a736eb9066b47
2018-12-10 14:21:03 +01:00
Neels Hofmeyr 212c0c9bda move ASS-COMPL MGCP handling out of a_iface_bssap.c
BSSMAP Assignment Complete: sort MGCP handling upon Assignment Complete to the
proper locations. a_iface_bssap.c is not the right place to invoke the MGCP
related procedures.

- in a_iface_bssap.c only decode the IEs.
- call ran_conn_assign_compl() and pass decoded values.
- drop msc_assign_compl(), it was dead code; instead:
- add ran_conn_assign_compl()
- pass on all MGCP related info to msc_mgcp_ass_complete()
- move all MGCP ctx related handling from a_iface_bssap.c to msc_mgcp.c.

I'm dropping some comments to save some time, because if I adjust them IMHO
they would still anyway restate the obvious.

ran_conn_assign_compl() is now quite a thin shim, but it makes sense to have
it:

- This is the place that should tear down the ran_conn in case assignment
  failed, left for a future patch.

- In the light of upcoming inter-MSC handover, ran_conn_assign_compl() will be
  the place where the Assignment Complete message might be relayed to a remote
  MSC.

Change-Id: I8137215c443239bddf3e69b5715839a365b73b6c
2018-12-10 14:20:59 +01:00
Neels Hofmeyr 4e0dd536b4 ASS-COMPL: do not fire Sec Mode Compl event
BSSMAP Assignment Complete:
Do not invoke ran_conn_rx_sec_mode_compl(), that's just weird.

Instead this should call msc_assign_compl(), which is currently dead code and
does nothing ... and there are some more strings attached, being resolved in a
subsequent patch.

Change-Id: I448fdb783364628005437b3d866d1a076a9767d7
2018-12-07 15:04:33 +01:00
Oliver Smith 65a8daadfd contrib: fix makedistcheck with disabled systemd
EXTRA_DIST files need to be distributed, no matter if the systemd option
is configured or not.

Change-Id: I4a5fc5778bc527aeb0602a7e57d9d2acb6988caa
2018-12-06 16:31:01 +00:00
Neels Hofmeyr 80447ebe6c add VTY commands: mncc internal / external (== -M)
So far the only way to use external MNCC is to pass the -M cmdline arg:

  osmo-msc -M /path/to/socket

However, the osmo-msc.service file for systemd is installed by 'make install',
and hence it is quite impractical to depend on such a config item to be
required in the service file:

- It defies any scheme an operator may have in place to compose the
  osmo-msc.cfg file -- this option doesn't go in the .cfg file but needs
  separate action to add to the installed service file.

- After a make install or package upgrades / re-installations, this option will
  be plain overwritten silently, or lead to the need for resolving file
  conflicts.

The initial spark for this came from configuring the 35c3 GSM from cfg
templates.

Change-Id: I2ec59d5eba407f83295528b51b93678d446b9cee
2018-12-05 19:35:11 +00:00