Commit Graph

7092 Commits

Author SHA1 Message Date
Neels Hofmeyr f74c466354 msc_a: store BSS codec list from Compl L3
Related: SYS#5066
Change-Id: I7cdc348218433141a43d2e42750af02591688240
2022-09-23 19:00:00 +02:00
Neels Hofmeyr 36d18d2f55 add trans.cc.codecs
Related: SYS#5066
Change-Id: Ib3fdeff8d1e1ea0760168d63ee6e1b1fb993aa5f
2022-09-23 19:00:00 +02:00
Neels Hofmeyr 7eb4a50b2c codec t9n: add IUFP
Related: SYS#5066
Change-Id: Ie03e2b09f411acd3a0eded7121c9123e33f70b3e
2022-09-23 19:00:00 +02:00
Neels Hofmeyr 8f2905cb54 add api comment in sdp_msg.h
Related: SYS#5066
Change-Id: Ifce7d3860411a46b614eff2e9d9ed922cb8d8123
2022-09-23 19:00:00 +02:00
Neels Hofmeyr e45943bdc9 add codec_filter.h,c
Related: SYS#5066
Change-Id: I4d90f7ca62f2307a7b93dd164aeecbf4bd98ff0a
2022-09-23 19:00:00 +02:00
Neels Hofmeyr efbfc66c7f fix sdp_msg_to_sdp_str(), never add fmtp for unset codec
Change-Id: I1892efd9360585f98419ebbd0df180f7f3a8160d
2022-09-23 18:59:02 +02:00
Neels Hofmeyr 12d8dcc924 add sdp_audio_codec_is_set
Change-Id: I078efe5b42367ad1089c53f11f7eb6f3a9dd9443
2022-09-19 16:02:57 +02:00
Neels Hofmeyr 6b9c5cb3cd add codec_sdp_cc_t9n.h,c
Related: SYS#5066
Change-Id: Iaa307be6a8487aa8d4ba7cd59d5c5ef04818a744
2022-09-19 16:02:57 +02:00
Neels Hofmeyr 3280f006ef log CC timeouts
Change-Id: I857b4b15ebf75cf253697e96d358128620923221
2022-09-19 16:02:57 +02:00
Max be768ac302 Set working directory in systemd service file
By default systemd will execute service with root directory (or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it to 'osmocom' subdir of state directory (/var/lib for system instance) instead.

Fixes: OS#5661
Change-Id: I0f942545d9e920ba8a2d8645512ec3414ab27418
2022-08-30 19:37:20 +07:00
Vadim Yanitskiy 088043fae4 contrib/jenkins.sh: do not override parallel make for libsmpp34
Parallel build has been fixed [1] and re-enabled [2] back in 2018.

Change-Id: I13d2d6f3b5ffae390cf429e41bf9035b8c551f66
Related: [1] I5a9d7dbd7b992d322ed0d852ebf8ca2252b51a12 libsmpp34.git
Related: [2] Id41fbcb5a96093eb6c3dc00bcacbd379111ada70 libsmpp34.git
2022-08-29 00:43:09 +07:00
Max 62977d0484 Add ESME-specific logging
Related: OS#5568
Change-Id: Ie5ddde762350385f8d18ee1d441584a41b0290ec
2022-08-05 22:12:09 +07:00
Max 5346f69a54 Introduce libsmpputil
As part of preparation for libosmo-netif migration let's move common SMPP code
into separate build-time library and use it for both smpp_mirror and OsmoMSC
renaming the files if necessary.

While at it we also fix id/password legth limits in smpp_mirror and drop unused
fields from ESME struct.

Related: OS#5568
Change-Id: I61910651bc7c188dc2fb67d96189a66a47e7e8fb
2022-08-05 22:12:09 +07:00
Max 3948fcc476 tests: use common stubs for SMS queue test
Related: OS#5568
Change-Id: Ic854eb919e6fcc82bd0245f62c72985b938c6b7a
2022-08-01 13:53:37 +00:00
Max 1470d0b870 ESME: use osmo_sock_get_name() for logging
This allows us to drop single-use parameters from osmo_esme to facilitate further code changes.

Related: OS#5568
Change-Id: I34bd4c145b0f6287a323e2350808feb59f1d3187
2022-08-01 13:53:37 +00:00
Max 7038dd0e05 Ignore .deb build byproducts
Change-Id: I0ff10ef5766edf5f2aacf62acc98f25f01706ab4
2022-08-01 13:53:37 +00:00
Max 4b1202bfdf SMPP: clarify (re)start logic
Having smpp_smsc_stop() called from within smpp_smsc_start() instead of
explicitly inside smpp_smsc_restart() is confusing and could lead to
hard-to-trace bugs. Let's get this fixed first before going further.

Related: OS#5568
Change-Id: I353f5b82c9f5308d93e926538d4ef7e24d0b0339
2022-08-01 13:53:37 +00:00
Neels Hofmeyr d20dd22082 sdp_msg: s/sdp_audio_codec_/sdp_audio_codecs_
Some functions act on a struct sdp_audio_codecs but begin with the name
sdp_audio_codec (singular). That's confusing.

Related: SYS#5066
Change-Id: Id87eb350c1f17f8dbf776909824bfa06634c1d04
2022-07-25 14:25:07 +02:00
Neels Hofmeyr c9e0ca3d1f sdp_msg: add sdp_audio_codecs_cmp(), add compare flags
A problem with SDP fmtp handling is visible in this patch: when cmp_fmtp
is true, we compare fmtp strings 1:1, which is not how things should be
done. The intention is to fix fmtp handling in a later patch.

At least there now is a flag to bypass fmtp comparison altogether.

Related: SYS#5066
Change-Id: I18d33e189674229501afec950aa1c732386455a2
2022-07-25 14:25:07 +02:00
Neels Hofmeyr 99ab7c57da in sdp logging: add payload type number like 'AMR#111'
Related: SYS#5066
Change-Id: Icbb4e89ce2947bf787c3ee14e3e115d406e43de2
2022-07-25 14:24:48 +02:00
Neels Hofmeyr 9a515e5db0 sdp_msg: s/_name_/_to_str_/g
foo_name is intended for a short id, foo_to_str is more accurate naming
here.

Related: SYS#5066
Change-Id: I21d73b2e2633dd4841ff69a0c5fdf9b1a4c0615f
2022-07-25 14:07:14 +02:00
Neels Hofmeyr 90933d46ba cosmetic: log actual MNCC msg in tch_rtp_connect()
Related: SYS#5066
Change-Id: I99161eeb64fd0faa7be6fc1e4986e2ba1bdcc75c
2022-07-25 14:06:26 +02:00
Neels Hofmeyr 550506aaf1 err log: fix reverse statement in msc_a call handling
Change-Id: I937abe25ba87d0fcddc3351ac391cf6e7e776de6
2022-07-22 19:11:18 +02:00
Neels Hofmeyr a9e383f5bd missing whitespace in gsm_04_08_cc.c
Change-Id: If9e2f543d1924421c1a1f1e1e100c7d9fb63c139
2022-07-22 19:09:58 +02:00
Neels Hofmeyr 3551d84ad8 fix typo in msgb name for CC SETUP
Change-Id: Id2c44966152805ea52bd7e7534529832fc2312ab
2022-07-22 19:09:44 +02:00
Keith Whyte 99bd0f3204 Turn off secure_delete in sqlite
libsqlite3 that ships with some distributions may have secure_delete
activated by default. This means all database records are overwritten
with zeros on DELETE. We don't needs this extra overhead.

Change-Id: I9da6499a38096c8df2025bb9d35ec789864b7c5e
2022-07-08 00:44:52 +01:00
Keith Whyte ea62986928 Don't let this osmo-msc operate on a libdbi database
The Binary format changed when libdbi was removed. If we let osmo-msc run on an
unconverted database, the results are unpredictable, certainly undesirable.

Change-Id: I887b6a4374b1c83684f4007e9791ae58bba4e8c1
2022-06-30 20:44:28 +00:00
Pau Espin 5b06a8d6a5 Bump version: 1.8.0.43-2eaaf-dirty → 1.9.0
Change-Id: Iacb839715290b27f1f3d302e13f219f5f0e1d161
2022-06-29 11:32:12 +02:00
Harald Welte 2eaaf6f305 fix RPM build failures due to README -> README.md rename
This fixes a bug I introduced in I98e09e8900c359382e2a90b187f0c6f22a1cf81d

Change-Id: I9d7bc0aea404499315e212a2ebb92d54df85d812
2022-06-21 09:50:53 +02:00
Harald Welte 1b6289adce Convert + Expand README file
README.md in-line with that of other osmocom CNI projects:
* markdown syntax
* link to manuals, issue tracker, gerrit contributions, etc.

Change-Id: I98e09e8900c359382e2a90b187f0c6f22a1cf81d
2022-06-18 13:34:24 +02:00
Harald Welte 3b13edf48f update git URLs (git -> https; gitea)
Change-Id: I0d7a9140ccbe5adecddde1901703e49243ee0b92
2022-06-18 12:27:10 +02:00
Harald Welte a3c639ff5f sms: Introduce VTY-configurable minimum SMS validity period
This is meant as a safeguard against users or user equipment which
doesn't set a reasonable validity period.  Using this setting, the
SMSC administrator can set a minimum SMS validity period. Any SMS
submitted with lower validity period will be extended to that minimum.

Change-Id: I192528a6f9059d158fa12876a247d61bd7edaec8
Related: OS#5567
2022-05-19 19:34:41 +00:00
Harald Welte 2765a18450 sms: Make default SMS validity period configurable via VTY
Change-Id: Ie2c81c1d5795dd9aaf07b9766013f20b01abc762
2022-05-19 19:34:41 +00:00
Harald Welte e6f1160046 smpp: Parse and use SMPP-provided validity period
Before this patch, we always ignored any SMPP-provided validity period
and used '0' which is now, and means it expires immediately.

As SMPP allows for validity_period of NULL, use 7 days as SMSC default
in such situations.

Change-Id: Iad9f2697f045ed3bc0eb74c3a9730861f82e6c48
Closes: OS#5567
2022-05-19 19:34:41 +00:00
Harald Welte 53e2e5fe70 sms_queue: Make deletion of messages from DB VTY-configurable
This introduces some VTY settings that determine if delivered
or expired messages should be removed from he SQL database or not.

Change-Id: Id6174875d5c01c40d987077651b27ae1acbcaa93
2022-05-19 19:34:41 +00:00
Harald Welte 03e8583a43 sms_queue: Use local variable rather than 9x pointer de-ref in function
Change-Id: Idf6eb9ec6603a0643033396ed9227e4319724145
2022-05-19 19:34:41 +00:00
Harald Welte 1a62db20e7 sms: Give smsc its own VTY config node
The pre-historic sms_queue code used to have very strange aspects,
such as having some parameters (max-failure, max-pending) which could
only be sent from the 'enable' node, but not from a config file.

Before adding more configuration parameters, let's clean this up by
introducing a proper VTY config node for the 'smsc'; move the existing
config commands there and add new ones for max-failure and max-pending.

As the sms_queue data structure is only allocated after the config file
parsing happens, we are introducing a new 'sms_queue_config' data
structure.  This encapsulates the public readable/writable config
parameters.

Change-Id: Ie8e0ab1a9f979337ff06544b9ab3820954d9804a
2022-05-19 19:34:41 +00:00
Oliver Smith 6a0ab76d67 tests/msc_vlr/Makefile.am: drop -ldbi
Fix for:
  /usr/bin/ld: cannot find -ldbi

Fixes: d43c22 ("switch from libdbi to lbsqlite3")
Change-Id: I8dcce119a8121881d56cb18328b5f702763b43ea
2022-05-18 14:07:57 +02:00
Harald Welte d302bb11fa sms: Encapsulate SMS queue related config parameters
Introduce a 'struct sms_queue_config' that holds all config parameters
related to the SMS queue.

Change-Id: I559ab7a6e0502a1a12a662ebd5591875d47ec7b2
2022-05-17 14:47:31 +02:00
Harald Welte 1d72e301cb db: Switch from 'synchronous = FULL' to 'synchronous = NORMAL'
As we're using WAL mode, it is not neccessary to use synchronous=FULL
but rely on synchronous=NORMAL mode while still guaranteeing database
consistency.

To do this, we can fix the typo in one of our two PRAGMA statements,
and remove the other.

See https://www.sqlite.org/pragma.html#pragma_synchronous for the
sqlite3 documentation on that topic.

Change-Id: Ie782f0fe90e7204c4d55cdb3948b728c348367d1
Closes: OS#5566
RelateD: OS#5564, OS#5563
2022-05-17 14:04:44 +02:00
Harald Welte d43c22ef65 switch from libdbi to lbsqlite3
The choice of libdbi was one of the biggest early mistakes in (back
then) OpenBSC development.  A database abstraction library that
prevents you from using proper prepared statements.  Let's finally
abandon it and use sqlite3 directly, just like we do in osmo-hlr.

I decided to remove the database migration code as it would be relatively
cumbersome to port all of it to direct sqlite3 with prepared statements,
and it is prone to introduction of all kinds of errors.  Since we don't
have a body of older database files and comprehensive migration tests,
it is safer to not offer migration code of uncertain quality.  The last
schema revision (5) was introduced 5 years ago in 2017 (osmo-msc
v1.1.0), so it is considered an exceptionally rare case.  People can
install osmo-msc 1.1.0 through 1.8.0 to upgrade to v5 before using
this new 'direct sqlite3' version of osmo-msc.

Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790
Related: OS#5559, OS#5563, OS#5564
2022-05-17 14:04:44 +02:00
Harald Welte d677f51187 tests: Remove sms.db{-wal,-shm} files, not just sms.db
ERROR: files left in build directory after distclean:
./sms.db-shm
./tests/sms.db-shm
./tests/sms.db-wal
./sms.db-wal

Change-Id: Iecd380f598edbd1635361e4c340d54d092739919
2022-05-16 17:44:01 +02:00
Harald Welte 7262d0875a sms_queue: merge sms_pending_add into sms_pending_from
Both callers would immediately execute sms_pending_add() after
a successful sms_pending_from(); we can merge those two functions.

Change-Id: Iaf37234b3caafd568dd4fe17739be9ec842c2a8d
2022-05-16 17:44:01 +02:00
Harald Welte 7f918af50b sms_queue: refactor sms_pending add/remove code
This avoids every caller from manually having to remember to
increment the count, the stat_item and llist_{add,del}.

Change-Id: Ice4c73727ef2d7e4118f0ef5fe24cae943c7528f
2022-05-16 17:44:01 +02:00
Harald Welte bf254f6da5 smpp: don't enqueue write messages if ESME is disconnected
If the ESME has been disconnected (dead socket) but still is
in memory (other users hold a use count), we shouldn't enqueue
messages to the write queue.

This prevents messages like
DSMPP write_queue.c:112 wqueue(0x7f8bc392f6e0) is full. Rejecting msgb

Change-Id: I10a270f1d555782be272f4d78da43190618a9950
Closes: OS#3278
2022-05-16 17:43:57 +02:00
Harald Welte 022193da73 smpp: Fix use-after-free bug when ESME disconnects but has write pending
When the SMPP code free's an ESME it also free's the related write_queue
and the osmo_fd contained therein.  So if this happens while we are
in esme_link_read_cb(), we must return -EBADF to make
osmo_wqueue_bfd_cb() of libosmocore avoid further accessing related
memory.

Change-Id: I441d3b05c2f2556c530783a7f66c73adf6d845a1
Closes: OS#5565
2022-05-16 17:33:42 +02:00
Harald Welte 63494a6bef sms_queue: Introduce rate_ctr / stat_item
This allows us to monitor the load of the SMS queue.

Change-Id: I8c00b5b0d33695fbb5f89fd2a4c8e35c9f7df6ac
2022-05-16 10:30:43 +02:00
Harald Welte 123261e0bb vlr: Add rate counters and stat items
This should give us some more insight into what is happening inside
the MSC's VLR in terms of number of subcribers, rate of successful /
unsuccessful GSUP procedures, etc.

Related: OS#1974
Change-Id: I681bcfc1875363478190151f2931cad197323ee8
2022-05-15 16:23:02 +02:00
Harald Welte 173bdf303b vlr: Split vlr_subscr_rx_imsi_detach()
The function vlr_subscr_rx_imsi_detach() implies that an explicit IMSI
DETACH was received.  However, that same function was called in other
situations such as timer expiration or GSUP CANCEL.

Let's clean this up by splitting the function into two parts.

No logical change is introduced to the VLR in this patch.

Change-Id: Iffc02f3062ad591ca372a3c6d866066cf63a8830
2022-05-15 15:47:00 +02:00
Harald Welte dc7d841aad sms_queue: Annotate each function with some comment
It makes the code much more readable if there's at least a one-liner
documenting each function (and struct member).

Change-Id: I6d239369cabdf1703eba7f3606b46b95cbbb1ea7
2022-05-15 13:05:03 +02:00