Commit Graph

7163 Commits

Author SHA1 Message Date
Neels Hofmeyr 4ce159c9eb mncc: prevent duplicate release in two cases
After MNCC_REL_IND, set callref=0, the common way to indicate that a
call has already been released.

Change-Id: Idd782f0cb6a25bc2c93e63fd323a90828f2fd549
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 7ee0850914 rtp_stream_commit(): log caller file,line
Change-Id: I7fd1d91860ce8a091df7220a8d46b45bc95bcd13
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 019b89631d rtp_stream_commit(): don't return failure when skipping commit
Change-Id: I58972745645c7cc03de67a26fcd1a8f608d6c2a4
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 38b94e341f rtp_stream_ensure_ci(): don't return error if ci already present
Change-Id: Idb8e8388fe7ecf382ec245e467947ecb82980cbd
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 9e6f407224 amr oa wip
Change-Id: Iea6627ea7d6fcfc6da26f6a745b9ce27ef2616d0
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 5febbe7cec call_leg_local_bridge(): simplify and clarify
- With the codecs filter, determine what codec is intended for CN,
  rather than what might already be set (or not) on an rtp_stream.
- By call_leg_ensure_ci(), don't really care whether a CI for an
  rtp_stream has already been set up or not.

In practice, all rtp_streams for both call legs should already be set
up, but we don't actually require that.

Add illustrative logging showing the codecs chosen for both call legs.

Change-Id: I3b9db378f2b27f00e547248664acb2c2eb8aab1a
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 5724a0b813 HO Req: include IE Codec List (MSC Preferred)
Related: OS#5529
Change-Id: Ifcf719c5fc9e11749aafbd97bafda7f6f50973ea
2023-03-05 07:03:05 +01:00
Neels Hofmeyr cc6d818baa codecs: compose HO Req Ch Type from cc.codecs
Change-Id: Iba7a1a87ec5e6b487f763e84d60ed285da7b8fe1
2023-03-05 07:03:05 +01:00
Neels Hofmeyr ff752e16d2 [codecs filter] msc_vlr_test_call: test codecs resolution
Show that the codecs filter now works as expected in call messaging.

Related: SYS#5066
Change-Id: I879ec61f523ad4ffc69a0b02810591f7c0261ff9
2023-03-05 07:03:05 +01:00
Neels Hofmeyr a7bca62a89 mncc_recvmsg(): log caller file,line
Change-Id: I3755eb35b504f2f2580e0ba43dfa41f16087decc
2023-03-05 07:03:05 +01:00
Neels Hofmeyr 4cd1aed954 wip
Change-Id: I2bf75ba0f5a0d6828c8d4bad2a1596521f9cbf73
2023-03-05 07:00:48 +01:00
Neels Hofmeyr 5ecc9709b3 wip
Change-Id: Iab5c9e266fdc2467f0f874bdf5f0fe9476fd6bb8
2023-03-05 06:53:55 +01:00
Neels Hofmeyr c688bbe0a7 wip
Change-Id: I6516bb1727b07bc0aa56cbe7a31aede537b4b448
2023-03-05 06:39:41 +01:00
Neels Hofmeyr 341b318529 wip
Change-Id: I9b0f1de36bf3002c6bb91ebed5104718dee05f95
2023-03-05 04:58:36 +01:00
Neels Hofmeyr ecf764652c do CN CRCX first
In order to send the MSC's RTP endpoint IP address+port in the inital
SDP, move the MGCP CRCX up to an earlier point in the sequence of
establishing a voice call.

Update the voice call sequence chart to show the effects.

Though the semantic change is rather simple, the patch is rather huge --
things have to happen in a different order, and async waits have to
happen at different times.

The new codec filter helps to carry codec resolution information across
the newly arranged code paths.

Related: SYS#5066
Change-Id: Ie433db1ba0c46d4b97538a969233c155cefac21c
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 368ff74c32 [codecs filter] use codecs filter on crcx ok
Change-Id: I03753df567d1dc24852e6fbb681fbba81d2a545d
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 5abd123aee msc_vlr_tests: confirm crcx by RAN/CN side separately
Upcoming patch 'do CN CRCX first' changes the ordering of MGCP. To
properly show the change in behavior in the msc_vlr_test_call, first
clarify which side is expected to do MGCP when.

Related: SYS#5066
Change-Id: I972e7426006e5b62f81ccfe4fa224ee9eed7a7ac
2023-03-05 02:35:23 +01:00
Neels Hofmeyr fee7106ef1 send + receive SDP via MNCC
Transmit and receive full SDP information via MNCC, to accurately pass
codecs choices between the call legs.

In msc_vlr_test_call.c test_call_mt(), show that when receiving MNCC,
the codec information in SDP overrules the Bearer Cap codec information
-- we expect to still receive inaccurate Bearer Cap from e.g.
osmo-sip-connector, because we have chosen to add SDP to MNCC instead of
trying to fix the codecs represented in Bearer Cap.

For internal MNCC, the MT call leg now knows which codec the MO has
chosen and assigned.

For external MNCC, osmo-sip-connector receives SDP about our codecs
choices and sends it in SIP messages, and we also receive the full SDP
information from the remote SIP leg.

Update the SDP in codec_filter every time it is received, to always have
the latest SDP information from the remote leg.

 CC              MNCC
 | ---ALERTING--> |     add local side SDP to MNCC msg
 | <--ALERTING--- |     store remote side SDP
 | <--SETUP-RESP- |     store remote side SDP
 | --SETUP-CNF--> |     add local side SDP to MNCC msg
 | -RTP-CREATE--> |     use codec_filter, add local side SDP to MNCC msg
 | <-RTP-CONNECT- |     store remote side SDP

There still is one problem: when initiating MNCC, we do not yet know the
RTP address and port to be used for the CN side, because the CN CRCX
happens later. So far we send 0.0.0.0:0 as RTP endpoint in the SDP,
until the CN CRCX is done. A subsequent patch moves CN CRCX to an
earlier time, adding proper RTP information right from the start.

Related: SYS#5066
Change-Id: Ie0668c0e079ec69da1532b52d00621efe114fc2c
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 1dce5f9ea9 [codecs filter] use filter result in Assignment
So far, patches have set up rtp_stream to allow setting multiple codecs,
and collected the codecs information into the codecs filter struct.
Now actually use the codecs filter result to choose a codec.

Setting up the call leg FSMs and codecs still looks rather confusing in
this patch, because this is an incremental step in a larger series. The
upcoming patch 'do CN CRCX first' clarifies this substantially.

The resulting codecs behavior is tested in upcoming patch
I879ec61f523ad4ffc69a0b02810591f7c0261ff9. (The test ideally should have
come before this patch, but my time to rework this branch is up.)

With the codecs filter in place, we are ready for sending and receiving
full SDP via MNCC, see upcoming Ie0668c0e079ec69da1532b52d00621efe114fc2c
and Ie433db1ba0c46d4b97538a969233c155cefac21c

Related: SYS#5066
Change-Id: I66e7c8c5e401f4f3a7d3d42b9525b2c6e99691d9
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 8659c1ca97 [codecs filter] use filter result in MT DTAP CC Setup
So far, we just forwarded the Bearer Capabilities received in MNCC from
the remote MO call leg, and omitted Bearer Cap if the remote call leg
did not provide any.

Instead, always include Bearer Cap, and compose it from the codecs
filter result. Hence the Bearer Cap is now an intersection of MS, BSS
and remote call leg, instead of just the remote call leg.

Related: SYS#5066
Change-Id: I9586221ef56352b7ce4b2604ae0dc04554145a78
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 4e89d8a3b1 in ran_msg, return gsm0808_speech_codec (inter-MSC)
Get rid of enum mgcp_codecs in inter-MSC handover related code.

Change-Id: I9c649f98738a55b8637ae600d5cdf81099fd08e5
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 8b51741c65 in ran_msg, return gsm0808_speech_codec (intra-MSC)
Do not convert to enum mgcp_codecs, but directly pass the
gsm0808_speech_codec IE from the A interface to codecs handling.

For Iu:
- RAN side: use ran_infra.force_mgw_codecs_to_ran to keep the MGW
  endpoint towards RAN on IUFP.
- CN side: introduce flag ran_msg.assignment_complete.codec_with_iuup,
  so to decide whether to forward IUFP towards CN, we don't need to test
  the RAN type, but use the flag from the ran_msg implementation.

In msc_vlr_tests, use the SDP codec string instead of enum
mgcp_codecs.

So far limit to intra-MSC related messaging, adjusting inter-MSC
handover follows in a separate patch.

Change-Id: Ia666cb697fbd140d7239089628faed93860ce671
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 07e73c193f rtp_stream: allow multiple codecs / use codec filter from Assignment
Allow configuring MGW conns with multiple codecs. The new codecs filter
can have multiple results, and MGCP can configure multiple codecs. Get
rid of this bottleneck, that so far limits to a single codec to MGW.

On Assignment Complete, set codec_filter.assignment to the assigned
codec, and use that to set the resulting codec (possibly multiple codecs
in the future) to create the CN side MGW endpoint.

Related: SYS#5066
Change-Id: If9c67b298b30f893ec661f84c9fc622ad01b5ee5
2023-03-05 02:35:23 +01:00
Neels Hofmeyr 457fa815de add ran_infra.force_mgw_codecs_to_ran
Indicate in the ran_infra data structure whether a RAN needs specific
codecs to be set up on the RAN facing MGW endpoint.

This allows setting forced RAN codecs as first-class citizen in the
ran_infra data structure, instead of special cases in the code (for IuUP
on IuCS).

Will be used in subsequent commit
I37f65c36af2679ecba1040a11a9aa0eb9481d817, submitted separately for
easier readability.

Change-Id: I37f65c36af2679ecba1040a11a9aa0eb9481d817
2023-03-04 23:50:46 +01:00
Neels Hofmeyr 31d44cdd4f [codecs filter] apply BSS codecs from Assignment Complete
Codec List (BSS Supported) is received once in Complete Layer 3 and
again in Assignment Complete messages. Use the most recent one, i.e. the
one from Assignment Complete, when it occurs.

Related: SYS#5066
Change-Id: I5e66ecc7987fa926f39d8be8eaf5799b931ab20a
2023-03-04 23:50:46 +01:00
Neels Hofmeyr afe16ca383 msc_vlr_test_call: include RAN RTP addr in ass compl
I noticed by chance that the Assignment Complete message generated in
the test lacks a remote RTP address for the RAN side.

Make the test more realistic by adding a remote RTP address and port. It
doesn't have any bearing on the tests besides more accurately showing
RTP stream setup in the logs.

Change-Id: Ia428762a16dcc17f036d725a00e0b3767418289b
2023-03-04 23:50:46 +01:00
Neels Hofmeyr cda5eedfdc [codecs filter] MT call: store MS Bearer Cap from CC Call Conf
Related: SYS#5066
Change-Id: Ic3d0f05af57a493d500700c63b121c8114e7fbf4
2023-03-04 23:50:46 +01:00
Neels Hofmeyr 2995e195e9 [codecs filter] MT call: apply remote call leg codecs
Collect either the SDP or the Bearer Capabilites in the incoming
MNCC in the new codecs filter.

So far just collect the info and do not change the behavior, using the
filter result will follow in a subsequent patch.

Related: SYS#5066
Change-Id: I84d9bbca3e4061da622b1b2fc0bde8868e7e3521
2023-03-04 23:50:46 +01:00
Neels Hofmeyr cdb752a018 [codecs filter] MT call: apply BSS codec list
For MT call, initialize the codecs filter and apply the
Codec List (BSS Supported) from Compl L3.

Related: SYS#5066
Change-Id: I530409a64d11da48518a3dc60aa3a4e47c384663
2023-03-04 23:50:46 +01:00
Neels Hofmeyr d52bb73b07 [codecs filter] MO call: apply BSS codec list
Related: SYS#5066
Change-Id: I062268406ae3f3a63a7f413db51c509c9eaf9e8a
2023-03-04 23:50:46 +01:00
Neels Hofmeyr cfb8cdc29b [codecs filter] store BSS codec list from Compl L3
The initial Compl L3 happens long before we establish a CC transaction.
Remember the Codec List (BSS Supported), so that we can feed the new
codecs filter with it. Subsequent patches implement feeding the filter.

Related: SYS#5066
Change-Id: I7cdc348218433141a43d2e42750af02591688240
2023-03-04 23:50:46 +01:00
Neels Hofmeyr 9c8a0da5fc [codecs filter] add trans.cc.codecs
Add the central codecs_filter for Call Control. Subsequent patches will
start to populate the individual stages of this codec filter, one by
one.

Related: SYS#5066
Change-Id: Ib3fdeff8d1e1ea0760168d63ee6e1b1fb993aa5f
2023-03-04 23:50:46 +01:00
Neels Hofmeyr 58dea8d12f [codecs filter] add codec_filter.h,c
Add the infrastructure to store and filter all codec limitiations from
the different stages: MS, BSS, CN and remote call leg. Upcoming patches
will properly collect these and find an optimal codec.

No functional change, yet.

Related: SYS#5066
Change-Id: I4d90f7ca62f2307a7b93dd164aeecbf4bd98ff0a
2023-03-04 23:50:41 +01:00
Neels Hofmeyr 80ccc3503c MNCC: use codec_mapping, drop mgcp_codec_to_mncc_payload_msg_type()
Change-Id: I8995ef43b9f79bc1db5672362c6433e4d96dd9e0
2023-03-04 23:50:19 +01:00
Neels Hofmeyr 1a94c358e7 add codec_mapping.h,c
Converting between different codec representations is confusing. This
codec mapping provides a consolidated overview of all our codec
representations, and how they match up.

In particular, it adds the SDP codec representation repertoire,
preparing the use of full SDP on the MNCC interface.

Related: SYS#5066
Change-Id: Iaa307be6a8487aa8d4ba7cd59d5c5ef04818a744
2023-03-04 23:50:16 +01:00
Neels Hofmeyr a818153967 IuCS: remove IuUP LOOPBACK hack
Since osmo-mgw now supports IuUP properly, and since we indicate IUFP in
the MGCP CRCX towars an IuCS RAN [1], we should no longer place the MGW
endpoint in loopback mode to hack up an IuUP Initialization.

This hack should have been removed along with [1].

[1] IUFP sent to MGW since this commit:
commit 3a02d29804
Refs: 1.8.0-13-g3a02d2980
Announce IuFP audio codec for UTRAN conns in CRCX towards MGW
I7aca671e00ed27ac03f0d106b5a6b665a9bed4c1

Change-Id: I6446c64421e3e13e2b829293d031c98b99cd39a7
2023-03-04 03:58:30 +01:00
Neels Hofmeyr ede9083946 comment: clarify L3 Info processing
Related: SYS#5066
Change-Id: Ia9180eeb88b31a2cf7dea72b43affd0c7b239ccb
2023-03-04 03:58:30 +01:00
Neels Hofmeyr 8ff00e775c sdp_msg.c: fix missing rate in sdp_audio_codecs_add()
When a new entry is is added by sdp_audio_codecs_add(), also add the
proper rate.

Change-Id: I17ad8862f662975e2df72a332eb83df7fb048cad
2023-03-04 03:57:02 +01:00
arehbein ed606b4271 Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: Icc57c68337d55c6594c1c36e9bf41624d11dab0a
2023-02-25 17:48:58 +01:00
Pau Espin 964ce6f46c Bump version: 1.9.0.58-1289-dirty → 1.10.0
Change-Id: Ifff00a3107447da911629948e9f3061c93b6ac86
2023-02-07 17:28:17 +01:00
Vadim Yanitskiy 1289c7b1bc fix msc_vty_go_parent(): add missing case for MGW_NODE
A new VTY node was added in commit [1], but bsc_vty_go_parent() was
not updated.  Because of that, commands following the MGW node may
crash osmo-msc.  See related patch [2] for more details.

Change-Id: I2422fa9152ecc8c4be1f2487ee016c3fe737e653
Fixes: [1] b44cf2d575
Related: [2] osmo-bsc.git Id3050ff7e2402c33ee76c7bf0cc83603c0cc6dfc
2023-02-05 04:21:31 +07:00
Vadim Yanitskiy 603e1fc925 msc_main: fix wrong comment: HLR is a separate project
Change-Id: I68806e2b44239a5d30126938d065500078c123e2
2023-02-05 04:13:52 +07:00
Keith Whyte 404fb1b60e LCLS: Fix Global Call Reference generation
According to 3gpp spec the Call Reference part of GCR is 5 octets,
3 octets Call ID followed by 2 octets BSS ID.

We are using our internal call reference (4 octets) and the
location area code, or optionally Cell ID as BSS ID
(2 octets). Obviously it does not fit.

Let's use only 3 octets from the call reference, dropping the MSB.

Includes code by Vadim Yanitskiy <vyanitskiy@sysmocom.de>

Change-Id: I9c33a89c819e8925d89ca833d7705ed5ced6b566
2023-02-01 03:08:37 +01:00
Max 7d28d23469 SMPP: use proper type for boolean variables
Related: OS#5568
Change-Id: I033a2c863213a44f99827ef997f541a7a77f5d8a
2023-01-17 09:15:54 +00:00
Neels Hofmeyr 91c9c2f7aa rtp_stream: set_remote_addr: do nothing when unchanged
Change-Id: I15181d84f3eb8a4ab9077cf12fcb138d51733102
2023-01-03 00:31:38 +01:00
Neels Hofmeyr a899dea9aa rtp_stream_commit: check missing MGW ep only when ready for RTP
Change-Id: I24a81a926b97c9f0fb31df782d1cf931eaff9db1
2023-01-03 00:31:38 +01:00
Neels Hofmeyr 5b1f9a2d0c fix sdp_msg_to_sdp_str(), never add fmtp for unset codec
Change-Id: I1892efd9360585f98419ebbd0df180f7f3a8160d
2023-01-03 00:31:38 +01:00
Neels Hofmeyr 01431080a3 sdp_msg.c: parse send/recv mode
Related: SYS#5066
Change-Id: I529c0bfad1cab376e26173ed48db2767c7dfaa64
2022-12-23 14:54:26 +00:00
Max 038e3d6426 ctrl: take both address and port from vty config
Change-Id: I31e971270a6658366651b29c99ec5247656c62c6
2022-12-17 20:50:14 +03:00
Vadim Yanitskiy 8284fb053d libmsc: check return value of gsm0808_create_ass2()
Change-Id: I6fd1669f2919034599d99336cf56f25a97afdf7c
2022-12-14 04:47:58 +07:00