Commit Graph

7310 Commits

Author SHA1 Message Date
Andreas Eversberg 5b1ab541a2 ASCI: Allow transaction without subscriber associated
Generally a transaction is linked with a subscriber (vsub).

A voice group call transaction may not have a subscriber associated. The
vsub field of the transaction will be NULL. If the group call is
initiated by a calling subscriber, the vsub field is set until the
calling subscriber is assigned to the voice group channel. If the group
call is initiated via VTY, vsub field is not set on creation of the
transaction.

Change-Id: I2b9afe95db4c106c141f4b7bd199ec74e197e523
Related: OS#4854
2023-07-09 07:41:33 +00:00
Andreas Eversberg 456c6f7e4d ASCI: Add two new transaction types for VGCS and VBS
- TRANS_GCC is used for the voice group call.
- TRANS_BCC for the voice broadcast call.

This also includes the use counters for transaction and CM service
request usage:
- MSC_A_USE_GCC
- MSC_A_USE_BCC
- MSC_A_USE_CM_SERVICE_BCC
- MSC_A_USE_CM_SERVICE_GCC

Change-Id: Iddd11f813582ac2ac2bdee91cc3a525986deb514
Related: OS#4854
2023-07-09 07:41:33 +00:00
Andreas Eversberg 7e4b032b88 ASCI: Add transaction type to trans_find_by_callref()
A transaction can be identified by the callref and the type. Because
transactions with different types may share the same callref value,
it is required to include the type in the trans_find_by_callref()
parameters.

E.g. a voice group call may have the same callref as a voice broadcast
call, but they are different calls. They also may not be confused with
other transaction types having eventually equal callref value, like
GSM 04.08 calls, SMS or supplementary services transactions.

By adding the transaction type to trans_find_by_callref(), we
essentially now use the (type, callref) tuple as unique ID for
transactions, instead of just callref.

Change-Id: Ic0b82033a1aa3c3508ad610c690a5f29073006c1
Related: OS#4854, OS#3294
2023-07-09 07:41:33 +00:00
Andreas Eversberg bcb4d6b26f ASCI: Allow usage of rtp_stream with other FSM
Allow the caller of rtp_stream_alloc() to define what events will be
dispatched to the parent FSM. This allows other state machines to use
rtp_stream. It is required for using RTP stream process with VGCS FSM.

Drop the unused parent_call_leg member.

Change-Id: I0991927b6d00da08dfd455980645e68281a73a9e
Related: OS#4854
2023-07-09 07:41:33 +00:00
Andreas Eversberg 58fe2e03c8 ASCI: rtp_stream_commit(): Also update MGW on conn mode change
So far rtp_stream_commit() triggers an MGCP MDCX message only when
codecs or the RTP address changed.
Do the same for mode changes. ('sendrecv', 'recvonly', 'sendonly',...)

Change-Id: I7a5637d0a7f1df13133e522fc78ba75eeeb2873e
Related: OS#4854
2023-07-09 07:41:33 +00:00
Andreas Eversberg 712b28e695 ASCI: Use a unique call-id for RTP streams
The MGCP protocol features the 'C' (call-id) to identify which
connections belong to the same call. They may be used by MGW for
accounting or management procedures.

So far we sent the MNCC callref as call-id. Instead, add a separate
unique call_id number space. Assign a unique call_id to each
transaction.

Change-Id: I36c5f159fa0b54fb576ff8bd279928b895554793
Related: OS#4854
2023-07-09 07:41:33 +00:00
Andreas Eversberg 0452cf9467 ASCI: Add log category for VGCS/VBS call and channel FSM
Change-Id: Icebc855fdc3f6ca7034ad3576b1acb5aed6bc435
Related: OS#4854
2023-07-09 07:41:33 +00:00
Andreas Eversberg b9162c7cc6 ASCI: Add log categories for GCC/BCC (call control)
Change-Id: I4c5d002b5bb1c2ebf2fac777ab784559fc265e7c
Related: OS#4854
2023-07-09 07:41:33 +00:00
Oliver Smith 412cf92d3c gsm48_cc_tx_setup: use MNCC bcaps for CSD
Use the MNCC bearer capabilities in CC setup for CSD, if available.

Note that in the MNCC_F_BEARER_CAP code path sdp_audio_codecs_set_csd()
also gets called by trans_cc_set_remote_from_bc().

Related: OS#4394
Change-Id: I56e49ebc41696912a81b8f4f63fbc36d0b605e9e
2023-07-06 14:52:06 +02:00
Oliver Smith 8d0aa26166 mncc_test: fix talloc_named_const
Change-Id: I0f0a5497eb37b9f9b9102e01cee8c1bda85c5dfe
2023-07-06 12:58:14 +02:00
Oliver Smith 8e16e8b338 gsm48_cc_tx_alerting: check rc of sdp_msg_from_sdp_str
Fixes: CID#321280
Change-Id: Id372d2d844446d6667a00dae22bdf8ed36c599ba
2023-06-23 10:55:55 +00:00
Oliver Smith 17399803a4 csd_bs_list_to_gsm0808_channel_type: fix rc check
Check the return code before writing it to unsigned ct->data_rate, as
"ct->data_rate < 0" is never true.

Fixes: CID#321277
Fixes: 106321 ("Add initial CSD support with external MNCC")
Change-Id: I5d77da71b60748818ba631229126c1bf061a9c7d
2023-06-23 10:38:46 +00:00
Oliver Smith 0d4607d90d msc_ho_send_handover_request: fix check_after_deref
Fixes: CID#211073
Change-Id: I9389cc9c4af987c11652c6fe9a0ff4289a7781c9
2023-06-22 14:53:17 +02:00
Oliver Smith 6a8dae666c smpp_msc: submit_to_sms: check ud_len > sms_msg_len
Fixes: CID#240727
Change-Id: Ie01ac84816f6ac3ba5631a643d486fb0dfb05eb2
2023-06-22 12:15:15 +02:00
Oliver Smith d0980a4e8b sdp_msg_test: fix dereference after null check
Fixes: CID#274690
Change-Id: Ic59252e4f1d4daf5f86c6b73ec951e02109df9bc
2023-06-22 11:56:11 +02:00
Oliver Smith 79d824f7f4 smpp_handle_bind_tx: initialize tlv
Fixes: CID#272977
Change-Id: I22da1aa95bf19a9bb1d8e0875f3b68356d801c70
2023-06-22 11:42:23 +02:00
Oliver Smith 1063213b38 Add initial CSD support with external MNCC
Implement and use CSD bearer service logic (with similar audio codec code):
* csd_filter (codec_filter)
* csd_bs (sdp_audio_codec)
* csd_bs_list (sdp_audio_codecs)

Related: OS#4394
Change-Id: Ide8b8321e0401dcbe35da2ec9cee0abca821d99a
2023-06-20 12:47:05 +02:00
Oliver Smith 64f3930c72 gsm48_cc_tx_setup: set trans->bearer_cap.transfer early
Prepare to use trans->bearer_cap.transfer in trans_cc_filter_run() to
differentiate between speech and data (CSD).

Related: OS#4394
Change-Id: Id0476a4882bcb27413d033f2de2c5288954f0b95
2023-06-15 15:06:46 +02:00
Oliver Smith 8a8ce714ff msc: add trans_cc_set_remote_from_bc
Prepare to set remote CSD bearer services in a future patch.

Related: OS#4394
Change-Id: I71a8ff6167e2adf3ee609883730e5f67b7539185
2023-06-15 15:06:46 +02:00
Oliver Smith c63c3a0cc5 transaction: move cc.codecs.result -> cc.local
Prepare for CSD where this will be used too.

Related: OS#4394
Change-Id: Iaf954be0455625faa06a64c19905b79b7045f8e4
2023-06-15 15:06:46 +02:00
Oliver Smith 593cd88535 transaction: move cc.codecs.remote -> cc.remote
Move remote out of codecs, as it will be used by CSD code as well.
Otherwise we would need to store it twice (in cc.codecs.remote and
cc.csd.remote).

Related: OS#4394
Change-Id: I5d2e078db3b3437cb6feae40d8955912d7a297e4
2023-06-15 15:06:46 +02:00
Oliver Smith ceca8e6d2d codec_filter_run: prepare for CSD
Related: OS#4394
Change-Id: I18b396193ad25a3905cc8c1853c9680dab0a2d44
2023-06-15 15:06:46 +02:00
Oliver Smith 1c7f1787bd codec_filter_set_bss: prepare for CSD
Related: OS#4394
Change-Id: I931db33820d9da81147bda84002ada0b80f11186
2023-06-15 15:06:46 +02:00
Oliver Smith c7c40c9648 codec_filter_set_ran: prepare for CSD
Related: OS#4394
Change-Id: I467a7bd461dcac2fff93a3777d4090d6b7d3d041
2023-06-15 15:06:46 +02:00
Oliver Smith a35abb761c codec_filter_init: prepare for CSD
Related: OS#4394
Change-Id: I1270b00464456abc5300fd47e6087a0ba6243d03
2023-06-15 15:06:46 +02:00
Oliver Smith 0b70b20a89 Cosmetic: gsm48_cc_tx_setup: remove TODO comment
Remove the comment as trans->bearer_cap will be used in CSD code to
differentiate between speech and data.

Related: OS#4394
Change-Id: I0539632f464bc44945599bec52dc2a4df2f0115f
2023-06-15 15:03:55 +02:00
Oliver Smith e545b9d3d6 Cosmetic: gsm48_cc_tx_setup: tweak comment
Remove the misleading "We must not pass bearer_cap to
codec_filter_init()" part of the comment. The function doesn't accept a
bearer_cap parameter, it cannot be passed to the function:

  void codec_filter_init(struct codec_filter *codec_filter)
  {
  	*codec_filter = (struct codec_filter){};
  }

Related: OS#4394
Change-Id: I87a1e371e108d8da514b30f1726aad0f85ea4111
2023-06-15 14:25:24 +02:00
Oliver Smith 5375f78ebb codec_filter_set_ms_from_bc: prepare for CSD
In all the places where codec_filter_ functions get called, for CSD we
will need to filter the bearer services. Add a new
transaction_cc.c file for functions that either combine the
codec_filter_ function with logic for CSD and voice calls or just call
the existing codec_filter function and a new csd_filter function.

Start with moving codec_filter_set_ms_from_bc to this new file, it will
be extended with a case for CSD in a future patch.

Related: OS#4394
Change-Id: If225f2a299ce6bc9ae35a17d6f591d889f49155e
2023-06-15 14:25:24 +02:00
Oliver Smith b1a1588f6e ran_a_channel_type_to_speech_codec_list: add CSD
Related: OS#4394
Change-Id: I336e6aa735f894aa35b2ccfe24a54eb171d7ad10
2023-06-15 10:29:29 +02:00
Oliver Smith b4b9ec805a codec_mapping: add clearmode
Related: OS#4394
Change-Id: Ieeaca6a00dc332424d443e44251f3219245511db
2023-06-15 10:29:29 +02:00
Pau Espin 9e3bab9e97 Use new mgcp_client_conf_alloc() API to alloc mgcp_client_conf
Depends: osmo-mgw.git Change-Id Iba0853ed099a32cf1dde78c17e1b34343db41cfc
Change-Id: I382046bba67646a7365d9290d604b97c9d886e02
2023-06-14 14:09:11 +02:00
Pau Espin 11c420a2fa Write explicit role & sctp-role fields in ASP configurations
Change-Id: I4901ea309cd5975117480642d068df3ca2f73662
2023-06-08 19:39:13 +02:00
Vadim Yanitskiy d3abcabdb3 tests/{ctrl,vty}_test_runner.py: raise an exception if proc's rc != 0
Change-Id: I4ed672d369bd379871a6a9fba5ff2da817e362d7
Depends: osmo-python-tests.git I1e11fcb6c5a587c27fc00920b6e157862d972fd9
Related: OS#5665
2023-06-01 20:08:02 +07:00
Vadim Yanitskiy 912f3501f2 fixup: contrib/jenkins: create workspace.tar.xz on error
cat-testlogs.sh does "exit 1", so no workspace.tar.xz is created.
Call this script after archiving the workspace.

Change-Id: Ibcb842f32418e66a186d6b21bb5861cf4a0b7c4a
Fixes: 799d972132 "contrib/jenkins: create workspace.tar.xz on error"
Related: OS#5665
2023-05-28 03:04:51 +07:00
Oliver Smith 902fb947b6 systemd: depend on networking-online.target
Related: SYS#6400
Change-Id: Ib6c78c76c5f13b9482428ce653a61b03b2aca1d3
2023-05-26 15:32:04 +00:00
Pau Espin 1c841f8a95 UserManual: Include sigtran*.adoc from osmo-gsm-manuals.git
They were only included in osmo-stp so far.

Change-Id: I37e36e7919d6996a79533b62564c5d82908b57f7
2023-05-26 14:11:01 +02:00
Oliver Smith 799d972132 contrib/jenkins: create workspace.tar.xz on error
In order to figure out why we sometimes get a coredump in the jenkins
master jobs, add a quick hack to get all relevant binaries on libraries
on error.

Related: OS#5665
Change-Id: If7b4eb050e2b3f763b5cfddf1a5b6a18bb41f46e
2023-05-23 16:21:04 +02:00
Vadim Yanitskiy 999a593efb copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
Change-Id: I81687235fedcbbb686db7def59318e891e00ced7
2023-05-18 17:22:26 +07:00
Oliver Smith e4aa86514e debian: set compat level to 10
Related: OS#5958
Change-Id: I9776c48f4f913dd7f7cde3afc6fe32bd0e9ba1b0
2023-04-25 16:48:30 +02:00
Neels Hofmeyr 85d7ba3d34 TODO-RELEASE: add note on osmo-sip-connector and SDP
Change-Id: I37fb5e18f06a5379d0320ee7d47885c9283cbd06
2023-04-15 21:57:22 +00:00
Vadim Yanitskiy 5d0bc330a0 tests: $(BUILT_SOURCES) is not defined, depend on osmo-msc
Change-Id: I3676a744bbe13d5d17caa94e9bd9e21c5c53de87
2023-04-14 11:16:51 +00:00
Neels Hofmeyr 388d7c9374 3G: decapsulate IuUP to AMR at the MGW; allow 3G<-AMR->2G
For all 3G calls, convert IuUP <-> plain AMR/RTP on the MSC's MGW hop
like this:

Before this patch:

 hNodeB <--IuUP--> MGW@hnbgw <--IuUP--> MGW@msc <--IuUP--> other call leg

After this patch:

 hNodeB <--IuUP--> MGW@hnbgw <--IuUP--> MGW@msc <--AMR--> other call leg
                                                    ^

This allows, in principle, 2G to 3G calls without expensive transcoding,
like this:

 hNodeB <--IuUP--> MGW@hnbgw <--IuUP--> MGW@msc <--AMR--> MGW@msc <--AMR--> MGW@bsc <--AMR--> 2G-BTS
                                                    ^
(So far only proven to work with AMR-FR at 12k2.)

3G to 3G calls now look like this:

 hNodeB <--IuUP--> MGW@hnbgw <--IuUP--> MGW@MSC <--AMR--> MGW@MSC <--IuUP--> MGW@hnbgw <--IuUP--> hNodeB
                                                    ^

Implementatino: get rid of the shim that was put in place to still send
IuUP (VND.3GPP.IUFP) to the CN. So now, for all 3G voice, the IuUP gets
decapsulated to plain AMR/RTP at the MSC's MGW hop.

What is proven to work with this patch:
successful voice call between 2G and 3G with these conditions:
- a hNodeB that stubbornly accepts only 12k2 AMR;
- a 2G BTS configured to use only TCH/F and only FR3, with only 12k2 as
  allowed AMR rate.

We have not yet seen a call working for TCH/H HR3 <-> 3G, because of the
lab hNodeB's limitation to 12k2.

Future work we probably need:
- properly request and negotiate AMR rates via SDP fmtp:mode-set.
- request more RFCIs in our RANAP RAB Assignment requests
  (see I61e0e9e75e3239662846fd797532acdefa9f73dc).
- Convert IuUP to AMR already at the HNBGW's MGW?
Solving this is not part of this patch.

Related: SYS#5092
Change-Id: I386a6a426c318040b019ab5541689c67e94672a1
2023-04-05 13:47:46 +00:00
Oliver Smith 40d3c793ce msc_main: close SMS db on startup error
When the SMS sqlite db is opened and not closed properly, sqlite will
print a trace on the next OsmoMSC startup while restoring the database.
This happens when e.g. attempting to bind OsmoMSC on an IP that is not
available (yet) and then restarting OsmoMSC.

db.c:521 Init database connection to 'sms.db' using SQLite3 lib version 3.34.1
db.c:318 SQLITE3: (283) recovered 37 frames from WAL file /var/lib/osmocom/sms.db-wal
backtrace.c:42 backtrace() returned 22 addresses
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0x36a56) [0x7f1518c00a56]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(sqlite3_log+0x9e) [0x7f1518c00b3e]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0x5f4f4) [0x7f1518c294f4]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0x5fbb3) [0x7f1518c29bb3]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0x7ee02) [0x7f1518c48e02]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0x7f908) [0x7f1518c49908]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xb9a5f) [0x7f1518c83a5f]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xcddac) [0x7f1518c97dac]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xcddef) [0x7f1518c97def]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xf537d) [0x7f1518cbf37d]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xb479e) [0x7f1518c7e79e]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xb79b6) [0x7f1518c819b6]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xb8116) [0x7f1518c82116]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(+0xb853f) [0x7f1518c8253f]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(sqlite3_prepare_v2+0x16) [0x7f1518c826a6]
backtrace.c:53         /lib/x86_64-linux-gnu/libsqlite3.so.0(sqlite3_exec+0xb4) [0x7f1518c8fce4]
backtrace.c:53         /usr/bin/osmo-msc(+0x1bf13) [0x564f81946f13]
backtrace.c:53         /usr/bin/osmo-msc(+0x524c0) [0x564f8197d4c0]
backtrace.c:53         /usr/bin/osmo-msc(+0x1324e) [0x564f8193e24e]
backtrace.c:53         /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xea) [0x7f1518991d0a]
backtrace.c:53         /usr/bin/osmo-msc(+0x13fea) [0x564f8193efea]

Related: SYS#6360
Change-Id: I9bb799048db5fcdb2a2520107bd75d5f7a865459
2023-04-05 11:26:55 +02:00
Oliver Smith 30cfe7174a msc_mgw_setup: use mgcp_client_pool_empty()
Don't fall back to the legacy config if the pool is configured but no
connection to any pool member can be established.

Depends: osmo-mgw I009483ac9dfd6627e414f14d43b89f40ea4644db
Related: OS#5993
Change-Id: I44e7b2723d801ceb03aaa2e5546802b4eb56b3c3
2023-04-04 16:08:52 +00:00
Neels Hofmeyr 7a5c8b5257 coverity: sdp_msg_test.c: check rc of sdp_msg_from_sdp_str()
Related: CID#310975
Change-Id: I69d8972c58fb7cde965ff0b231947dd26247c2c7
2023-03-28 03:55:23 +00:00
Neels Hofmeyr 6a1faa9f78 fix msc_vlr_test_call SDP mncc_rtp
In msc_vlr_test_call, we fail to send the right MNCC struct for
MNCC_RTP_CREATE. We should pass a struct gsm_mncc_rtp. Fix that.

Change-Id: Ia0b3253f85c716e45f925da3f58f025af1f15ec9
2023-03-26 00:03:50 +01:00
Neels Hofmeyr b091d2138d HO Req: include IE Codec List (MSC Preferred)
This will make the 10 inter-MSC HO tests in MSC_Tests.ttcn pass again.

Related: OS#5529
Change-Id: Ifcf719c5fc9e11749aafbd97bafda7f6f50973ea
2023-03-18 03:05:34 +01:00
Neels Hofmeyr b6c11c43bb codecs: compose HO Req Ch Type from cc.codecs
Change-Id: Iba7a1a87ec5e6b487f763e84d60ed285da7b8fe1
2023-03-18 03:05:34 +01:00
Neels Hofmeyr 3c323dcfb1 [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-18 03:05:34 +01:00
Neels Hofmeyr 1c0650767a mncc_recvmsg(): log caller file,line
Change-Id: I3755eb35b504f2f2580e0ba43dfa41f16087decc
2023-03-18 03:05:34 +01:00