Commit Graph

7372 Commits

Author SHA1 Message Date
Vadim Yanitskiy
f7f0f451a0 SMS-over-GSUP: properly update MSC_CTR_SMS_RP_ERR_{MEM,OTHER}
These counters have not been updated in SMS-over-GSUP mode so far.
Move the logic updating counters to the common code path.
Take a chance to use rate_ctr_inc2().

Change-Id: I97b4699e5b2c44989368004a53e26ca5daaa7b14
Related: SYS#7323
2025-04-16 02:14:54 +07:00
Vadim Yanitskiy
ce80fdf587 SMS-over-GSUP: send network-originated MT-forwardSM-Err
When SMS-over-GSUP is enabled, there's currently no indication of
failed MT SMS delivery due to paging timeout or connection issues.
In such cases, the SMSC that initiated the MT-forwardSM-Req receives
no response at all.  This leaves the SMSC with no clear criterion
for retrying delivery other than a generic timeout.

So far, MT-forwardSM-Err was only sent when the MS/UE explicitly
indicated an error (via RP-ERROR).  This patch extends its use to
also cover situations where no RP-ACK or RP-ERROR is received,
allowing the network to notify the SMSC of delivery failure
due to lower-layer issues.

The key difference between the MS/UE-originated and network-originated
MT-forwardSM-Err messages is presence/absence of the following IEs:

* SM-RP-Cause IE -- indicated by the MS/UE,
* Cause IE -- indicated by the network.

Either of these IEs shall always be present.

Change-Id: I51d92752471147e6d21a5059bebb0702b32642a5
Related: osmo-ttcn3-hacks.git Ief16753783e044911f1e3cef8d7012810d709e61
Related: osmo-ttcn3-hacks.git Ic27d943645fdff8d34f958e3bf16c8ee6e8368d2
Related: SYS#7323
2025-04-08 04:50:35 +07:00
Vadim Yanitskiy
d6bb80b496 gsm0911_gsup_rx(): invalidate vsub pointer
Calling vlr_subscr_put() in gsm0911_gsup_rx() may result in free()ing
the memory pointed by vsub, so let's set it to NULL to prevent
potential use-after-free.

Change-Id: If81df71a52e4fa972b48c61d1ed1361c6629ae94
2025-03-28 17:04:41 +07:00
Pau Espin Pedrol
1e886e4b99 Drop use of deprecated vty is_config_node() cb
This callback was drepecated and is not ever called since
libosmocore.git 70ce871532ab21955e0955d7e230eae65438f047 (release 1.3.0).

See also libosmocore.git d31de237582f6fe3315d61bb9a488d4cda92654e.

Change-Id: Id6620095af153781cde926458f54fed5bd51a9e7
2025-03-04 18:17:54 +01:00
Andreas Eversberg
a28c6efc4f Indicate error and release BSS connection when SMS transaction fails
When the creation of the transaction structure fails, the MSC will
send a CP-ERROR message.

This patch ensures that the MSC_A use counter is decremented, so
that the BSS connection is released, if it is not used by any other
transaction.

Without this patch, the msc_a_fsm would wait 5 seconds for an initial
transaction before releasing the BSS connection.

Related: OS#6427
Change-Id: I82da9c283205c69b19ceb4ba40ac5aa7f37d159b
2025-02-25 12:54:22 +00:00
Andreas Eversberg
bce6b7e1eb Release BSS connection when CC transaction fails
When the creation of the transaction structure fails, the MSC will
send a RELEASE COMPLETE message.

This patch ensures that the MSC_A use counter is decremented, so
that the BSS connection is released, if it is not used by any other
transaction.

Without this patch, the msc_a_fsm would wait 5 seconds for an initial
transaction before releasing the BSS connection.

Related: OS#6427
Change-Id: Icb893d5c1ce4c77a29259ce66189576dcaa5a44a
2025-02-25 12:54:22 +00:00
Oliver Smith
3ffa34f13c Bump version: 1.12.1.34-1e24a-dirty → 1.13.0
Change-Id: Ia34d0c57a8d17a115a4f7e35ec8eb1470c5fb16e
1.13.0
2025-02-12 13:10:31 +01:00
Simon Cornish
1e24ae38af Include SM-RP-UI in outgoing GSUP message when presesnt
An SMS deliver report may be returned from the UE for any MT SMS.  A
common use is for remote communication with the SIM (UICC) whereby a
command requires Proof of Receipt in an SMS deliver report (see 3GPP
31.115)

SMS-DELIVER-REPORT TPDU is defined in 3GPP 23.040 s9.2.2.1a and
carried as a RP-User-Data element within an RP-ERROR or RP-ACK PDU

In 3GPP 24.011, the definition of RP-ACK (s7.3.3) and RP-ERROR
(s7.3.4) shows RP-User-Data encoded as an optional TLV.

In MAP (3GPP 29.002) the MSC transfers the user data in either
SM-RP-UI parameter (s7.6.8.4) or SM-DeliveryFailureCause
diagnosticInfo (s7.6.1h)

With GSUP the osmo_gsup_message struct member sm_rp_ui is used to
carry the user data in both cases.

Change-Id: I90a607900ac7c86b200c79b7e8c460d4cbb3c3ce
2025-01-30 18:04:25 +00:00
Alexander Couzens
3073635707 vlr: only set HLR number if field is present
Change-Id: I26dc4c00b81723cd7ead095a515269afd0f73f8e
2025-01-13 20:08:49 +01:00
Alexander Couzens
b8e419069b vlr: on subscriber disconnect, check if LU & Auth FSM are even valid
Those fsm can be NULL.

Change-Id: Iaea7d37cfa439fd1adea7440409f6248aef947ef
2025-01-13 20:08:49 +01:00
Alexander Couzens
177184ee2e vlr: Add support for CS and PS timers
To prepare for PS support, add related PS timers
and try to keep the code simple to support both domains.
Use osmo_tdef_fsm_inst_state_chg() where possible because
this way we can have a t_def pointer which we set at the start.

Change-Id: I364973b8d9e277ec5963343c0a83061e81a5baba
2025-01-07 11:41:16 +01:00
Pau Espin Pedrol
e2931c27ce jenkins.sh: No need to build libosmo-sigtran with doxygen
Change-Id: I5fdb9b139c1c233a0499ba1fbcd9046491714dd4
2024-12-10 16:55:48 +01:00
Pau Espin Pedrol
db268fa642 vty: Avoid accessing gsupclient object fields directly
Use new APIs recently added.

Change-Id: I7ead95bb86d1ab510090c29390255007923f895f
Depends: osmo-hlr.git Change-Id I401af83232022f1c141eef1f428cbe206a8aaaa2
2024-12-04 14:44:43 +01:00
Pau Espin Pedrol
c67e71275d Use gsup_client_mux from libosmo-gsup-client
gsup_client_mux code was cloned a couple months ago to
libosmo-gsup-client, use it in osmo-msc and drop its own copy.

The code was not dropped at the time because it required tweaking the
unit tests, because they were wrapping some underlaying functions which
cannot be wrapped anymore since the code using them is now inside the
separate already-linked libosmo-gsup-client.so.
Solve it by actually wrapping one layer up in the gsup_client_mux itself
since it now something we mantain here anymore.

Change-Id: I34d02ae219f3ec8daf47942c46f52b21eab21242
2024-12-04 14:44:39 +01:00
Alexander Couzens
40bb1f5b6e vlr: add bool is_ps to vlr_alloc()
The vlr must known if it is CS or PS. As this is a very
severe configuration entry, add it to the main allocation.

Change-Id: Ib77aad8492a198131c966d4ac4cf8f5f727edcfa
2024-11-25 15:40:56 +01:00
Alexander Couzens
826e2a14a2 vlr: vlr_auth_fsm: make the fsm private
Like all the other libvlr fsm, they are private to their own files,
keep the vlr_auth_fsm the same and be consistant.

Change-Id: Iec85f299cd99879475ab094998433d935e980394
2024-11-25 15:40:55 +01:00
Alexander Couzens
6729fa349b vlr: make vlr_parq_fsm_init() private
All other fsm initialisation are internal to the libvlr code.

Change-Id: I3b4cfc01e6dd5434c74b4fa24a3e0945668b2a74
2024-11-25 15:37:38 +01:00
Alexander Couzens
88b7d99932 vlr: drop msc/debug.h header
Since logging is done different, remove the MSC specific header.

Change-Id: I8fa2f16c07ef54be3a125c19e0990a68c4d5d2cf
2024-11-25 15:37:38 +01:00
Alexander Couzens
ac492ce788 vlr: add a logging layer
To prepare the split off into a separate library,
the logging can't use log category from a define.
Use the same strategy as all the other osmo libraries and
use a global array which is set on initialisation to define the logging
categories.

Change-Id: I6d87b38d6d7d704c7c7b2c90ad12187e4b953b8b
2024-11-25 15:37:35 +01:00
Pau Espin Pedrol
d2ed119f05 jenkins.sh: libosmo-netif no longer depends on libosmo-abis
Change-Id: I4d4ddaed02bb9e09251996315ed12d912b490851
Depends: libosmo-abis.git Change-Id I079dc3999de508301dd37ed03e399356a58d3cab
Depends: libosmo-netif.git Change-Id I13d6e88158f6d9ce017986283183ee9c2cc68cae
2024-11-21 14:56:35 +01:00
Pau Espin Pedrol
8834144550 Use new libosmo-sigtran APIs to access osmo_ss7_instance
Depends: libsomo-sigtran.git Change-Id I617e58f5f3f5420accbfe8b81ee8b3eb553330bf
Change-Id: I4c4f833cfcc4e65ee5372e7736dbef9c65c2f3de
2024-11-08 16:56:53 +01:00
Vadim Yanitskiy
ae8d6a96bb smpp: set TCP_NODELAY sockopt
Change-Id: Ibfaaeaa6e21f621eb32b37b783e286e40859c915
Fixes: OS#5568
2024-11-02 15:04:24 +07:00
Vadim Yanitskiy
408d2d1908 csd_bs: fix setting of Rate Adaptation for FAX and 3.1 kHz audio
Some FAX machines, like Siemens based Possia Greta, refuse MT data
calls when the Rate Adaptation field is set to GSM48_BCAP_RA_V110_X30.
Using GSM48_BCAP_RA_NONE makes the Greta machine happy.

After looking at various tables in 3GPP TS 22.002, I deduced that
GSM48_BCAP_RA_V110_X30 shall only be used for Unrestricted Digital
Information.  Use GSM48_BCAP_RA_NONE for both FAX and 3.1 kHz audio.

Change-Id: I3d608f412859df8988ce7a51aaef65949c80865b
Related: OS#4394, OS#5730
2024-10-24 01:08:40 +07:00
Vadim Yanitskiy
e21d359a66 csd_bs: do not hard-code GSM48_BCAP_ITCAP_UNR_DIG_INF
We should respect the Information Transfer Capability indicated
during the MO data call establishment.  Hard-coding UDI breaks
FAX calls for some FAX machines, such as Possia Greta.

Change-Id: Ibfb9f0097ca86092320cebed13a7a642080370f1
Related: OS#4394, OS#5730
2024-10-24 01:08:40 +07:00
Vadim Yanitskiy
daa90f3196 csd_bs: cosmetic changes to csd_bs_list_to_bearer_cap()
Change-Id: I101f55dfbd0d327269fcce76031a2db265ca2eb9
Related: OS#4394, OS#5730
2024-10-24 01:08:38 +07:00
Alexander Couzens
2fb32932ec msc_net_init: replace spaces with tabs as indention
Change-Id: I9290cc585601dbadda3a85eddd50ccd0354b0b0b
2024-10-15 05:19:45 +02:00
Alexander Couzens
b7e36255b8 vlr_auth_fsm: fix missing space
Change-Id: I8976221ca7e314cc655f43c3ccffd9f15364cc0e
2024-10-15 05:19:45 +02:00
Alexander Couzens
3832541c3f vlr: add the location update type to the callbacks tx_lu_acc/tx_lu_rej
The location update type (IMSI attach, periodic, location area change) is
required when the SGSN is using the vlr code to send back the correct PDU to the MS.
The MSC always sends Location Update Accept/Reject, but the SGSN has to transmit
either Routing Area Accept/Reject or Attach Accept/Reject.

Change-Id: I980a637333e92b15f2d516683feeaded910105b6
2024-10-15 05:19:45 +02:00
Alexander Couzens
45d9b166eb vlr: set the correct CN domain on GSUP messages
In preparation of splitting up the libvlr code, set the CN domain
on all required GSUP messages which allow the CN domain to be present.

The test cases expect the exact GSUP message. The additional TLV is
280102 (IE: CN domain, length 1, CS (2)).

Change-Id: I045f29647b0f122a653881030d09de35b64f4dd1
2024-10-15 05:19:45 +02:00
Alexander Couzens
5e13b6da05 vlr: add functions for vlr_is_cs() vlr_is_ps()
Make the code more readable when checking for cs or ps.

Change-Id: I88810f3703813e98be8a37d0445ad641b0cac11d
2024-10-15 05:19:22 +02:00
Alexander Couzens
64e4ae7bb7 vlr: refactor and rename vlr_timer into vlr_timer_val
Use correct types for vlr_timer. A timer T is always a signed integer.
Also osmo_tdef_get returns an unsigned long. Match the types from osmo_tdef.
Rename the vlr_timer() into vlr_timer_val() to make it more understandable.

Change-Id: Ic46ddb578962619fc08bd63645c76852e676fcc9
2024-10-14 16:07:46 +02:00
Alexander Couzens
36ad5f3276 vlr: fix typo in comment
Change-Id: I06baf0494fde1d0c8eb6aaf72f5ce6e9134f3905
2024-10-07 23:28:41 +02:00
Alexander Couzens
eac1b93bb5 vlr: refactor the reject cause codes
Use reject cause consistent within the VLR.
Convert the GMM cause code to reject cause, which contains the
exact same values. Reject cause includes both CS and PS cause codes,
because CS and PS cause codes uses the same numbering space.
See 24.008 annex G.

Filter early the HLR provided cause code based on the CN domain,
some values are invalid and will be converted into network failure.

Change-Id: Ib269e9f865cd23f9f2c0a1bac0e17c95974c1c9f
2024-10-07 23:28:16 +02:00
Alexander Couzens
eff28ab6ba Move vlr.h & vlr_sgs.h into osmocom/vlr/
Prepare libvlr to be independent, start by moving the vlr headers
into its own directory.

Change-Id: I8b18b05091b35e744b3234d1ce0d537f56bccf07
2024-10-07 23:16:13 +02:00
Alexander Couzens
651b8b1aa1 libvlr: use correct log facility within the VLR
Change-Id: Ia3170c3fe48402ab01bf994fd8d3fa8eec699647
2024-10-07 23:15:25 +02:00
Alexander Couzens
25a92b8953 libvlr: fix tab/space issue
Change-Id: I7f831e7ee0014a2241a69f7c75f2c6404bbb7087
2024-10-07 23:15:25 +02:00
Alexander Couzens
b5b4163a95 msc/gsup_client_mux.h: remove include of itself
Change-Id: I89ffdb98e98133bd28023a19076f3a5f02e520d2
2024-10-07 23:15:25 +02:00
Alexander Couzens
28e43ff299 libvlr: replace direct call of paging_expired() into a callback
libmsc internal functions shouldn't be called from within the libvlr.
Re-use the paging callback with an osmocom specific indication to
inform it to cancel paging.

Change-Id: I7a3d15e8f0fb51c6b32add2de5024fc4d599ecf0
2024-10-07 23:14:56 +02:00
Andreas Eversberg
5fb4a9efcf Release BSS connection when SS message is rejected
When an initial call-independent supplementary service message is
received, it is checked whether the message is a REGISTER message.
If it is not, the MSC will reject it by sending a RELEASE COMPLETE
message.

This patch ensures that the MSC_A use counter is decremented, so
that the BSS connection is released, if it is not used by any other
transaction.

Without this patch, the msc_a_fsm would wait 5 seconds for an initial
transaction before releasing the BSS connection.

Related: OS#6427
Change-Id: Ic6765e5d480735e67d97f0f560da24653b26d487
2024-10-03 15:24:22 +00:00
Vadim Yanitskiy
f663f4ea53 silent-call: add CSD channel modes
This is useful for BER testing and figuring out if the baseband
supports the requested channel mode, e.g. half-rate data calls.

Going below 2.4k (0.6k, 1.2k, 1.2k_75) makes no sense, because:

* these rates are carried by TCH/[FH]2.4 channels anyway, and
* we never tell the user data rate to the MS (part of CC SETUP)

The same applies to transparent vs non-transparent channel modes,
but let's add non-transparent variants anyway, just in case the
BTS PHY does not support transparent modes.

Change-Id: Ife83f5bcb2b68a228a014f47c7cbb21660290593
2024-09-29 02:13:34 +07:00
Andreas Eversberg
a980c57a61 Remove speech codec list from bearer_cap for phase 1 mobile station
According to TS 04.08 Clause 10.5.4.5.1, the octet 3a etc. shall not be
included, if only GSM full/half rate speech version 1 is supported.

As phase 1 mobile stations only support FR and HR speech, the speech
list in the bearer capability must be reduced to the codecs listed
above. If there is none of these codecs left, the call is rejected.

The octet 3a etc. must be omitted when encoding bearer capability for
phase 1 mobile stations. This is done by removing the speech list.

I do not use a "codec filter", because it is not required. The phase 1
mobile station can only respond with codecs it supports, so no filtering
is required.

Related: OS#6461
Change-Id: Idd267dad0ade18cee7d5be813a57e1ee3168e2db
2024-09-23 10:10:44 +02:00
Oliver Smith
00cb24d73e Bump version: 1.12.0.6-44f34 → 1.12.1
Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d
1.12.1
2024-09-16 12:24:50 +02:00
Oliver Smith
44f3481bac contrib/jenkins: libosmo-sccp -> libosmo-sigtran
Change-Id: I85b73284ca3ca5abcc076da71d5e0c5609149a2f
2024-09-16 12:22:02 +02:00
Alexander Couzens
620c60ff18 libvlr/vlr: remove gsm_subscriber.h
There is no need for gsm_subscriber.h except its include
of osmocom/core/stats.h

Change-Id: I8e1839d0be0a04deba639f267f14ffc3d5ccc42b
2024-09-12 15:06:17 +02:00
Alexander Couzens
0e18da5ae4 vlr_auth_fsm.h/vlr_sgs_fsm.h: forward declare struct vlr_subscr
Make the headers self-contained to not depend on the include order.

Change-Id: I0985b60ed252c37663b945eed939519d17c4c985
2024-09-12 15:06:17 +02:00
Alexander Couzens
08b8af8a93 vlr.c: drop unused header limits.h
Change-Id: I12a326e506551e97cb7d608dd16b28662a94927f
2024-09-12 15:06:17 +02:00
Alexander Couzens
7900a05cdb vlr.h: remove unused ran_conn out of the header
The ran_conn isn't used at all by the VLR

Change-Id: I247d636d835c09f7a7b66dee52eb8608aa358815
2024-09-12 15:06:17 +02:00
Harald Welte
0d89bd5797 configure.ac: Remove ibosmo-sccp dependency
osmo-msc had probably forever contained a configure.ac dependency
to libosmo-sccp (that's the old static library libsccp.a), which was
only added to use a single header file (sccp_types.h).  This file
has recently been migrated to libosmo-sigtran, as libsccp.a
has been removed.

Change-Id: Ifcdad8684614c95982b6b471a5585dd42a7fb897
2024-09-09 10:21:28 +02:00
Oliver Smith
2404422183 Bump version: 1.11.1.65-22d4f3-dirty → 1.12.0
Change-Id: Ic6f6d893025acff60df33cbfda980100e492e1c6
1.12.0
2024-07-24 17:23:02 +02:00
Neels Hofmeyr
22d4f35646 do not invoke two Assignments (fixup for re-assignment)
Make sure we wait for Assignment responses before dispatching an
Assignment Request towards RAN.

In particular, when the remote call leg sends its codecs, we may trigger
Re-Assignment to match that codec. Make sure this is done only once:
when receiving another SDP message, wait for the first Assignment.

Implement as an osmo_timer, since there still is no osmo_fsm
implementation for Assignment nor for CC trans FSM. Also it doesn't
belong in the msc_a FSM (it should remain in state COMMUNICATING).

Without this patch, new ttcn3 test TC_lu_and_mo_call_reass_for_mt_codec
sporadically fails, if MNCC with SDP falls in-between Assignment Request
and Assignment Complete.

Related: osmo-msc d767c73a1f == I8760feaa8598047369ef8c3ab2673013bac8ac8a
Related: osmo-ttcn3-hacks I402ed0523a2a87b83f29c5577b2c828102005d53
Change-Id: I0f1e1a551aed545b555b9f236fc5967b1e4cc940
2024-06-21 19:18:01 +02:00