Commit Graph

6788 Commits

Author SHA1 Message Date
Pau Espin b7f52b414e osmux: Rename field s/init/initialized
Change-Id: Ic48de396b1d8a0774611b4a1c2248ba79bdaf044
2022-09-25 00:14:03 +02:00
Pau Espin ea7aaf2eca vty: show per-connection Osmux VTY stats
Related: SYS#5987
Change-Id: Ieab6dcbd195c8e01a73a2a832bce78ee015ae1c3
2022-09-25 00:06:00 +02:00
Pau Espin 432ee9d150 osmux: Improve per-conn tx rate counters
Change-Id: If030f5d921bdfcfcd00b015b4a9e48bb3b04e721
2022-09-25 00:06:00 +02:00
Pau Espin b4a59475d2 osmux: Fix incorrect rate_ctr_group used in mgcp_osmux.c
During development of the counters, they were first added to the same
RTP counter group and later on split, but some places still used the
RTP related functions to increment the counters.
Let's add a seaprate set of helpers to update the correct osmux counter
group.

Fixes: 582c2bf7b0

Change-Id: Ia2e5601c7d476b79afd95032dbc019517f8209af
2022-09-25 00:05:49 +02:00
Pau Espin 2177919edb osmux: Support local CID != remote CID
So far the implementation only allowed the remote CID being the same as
the one dynamically implemented internally.

Related: SYS#6138
Change-Id: I6b03eabc0305580c9788c529bec7dda9044a008f
2022-09-23 16:55:46 +02:00
Pau Espin 87f114a1d0 Use bool type instead of int in config field
Change-Id: Ie2624a6a6848c3c88deb39760317860d8074acb9
2022-09-23 15:48:43 +02:00
Pau Espin 928a20b540 osmux: Rename field osmux usage policy and define it with proper type
Change-Id: I7f41a443f488b75df792597ec3cec8f7e97a7411
2022-09-23 15:48:20 +02:00
Pau Espin b9022497d8 cosmetic: osmux: Fix formatting of if-else brackets
Change-Id: I748d41cd110841ef121f70560e70c07de56aa9da
2022-09-22 21:47:23 +02:00
Pau Espin 582c2bf7b0 osmux: Add connection and global rate counters
Change-Id: I200a4aa3908cac0ec729d980a66f3df7f55e4da7
2022-09-22 21:44:46 +02:00
Pau Espin 663ba5c41f Use 'static const' instead of 'const static' everywhere
As requested by the linter on a new patch being submitted.

Change-Id: I692624da6a1c7f59ac2989509f074cb52d089907
2022-09-22 21:43:45 +02:00
Pau Espin daf5bcea99 mgcp_conn: rename field s/rate_ctr_group/ctrg/g
This makes all lines operating on rate groups way shorter. The "ctrg"
naming is already used in tons of places in osmocom code.

Change-Id: I745eddbf66e7d811bb73c8ae9bb54ea93073c71b
2022-09-22 21:21:12 +02:00
Pau Espin a29f155301 Fix typo in ratectr description
Change-Id: I2ac8581f13814f320767ba188ef7cf3286fa443d
2022-09-22 21:21:12 +02:00
Pau Espin 941e317c97 osmux: Get rid of static NULL talloc context
struct osmux_handle, which is shared by several rtp_conn, is
attached to the trunk object, since the socket also attaches to it.

Related: SYS#5987
Change-Id: If4980424cdb8e3dc26a23e9ee419c0a38912f38f
2022-09-22 21:21:11 +02:00
Pau Espin 3fbf035923 osmux: Clean up helper macro osmux_chunk_length()
Change-Id: I482d8c5be08610788c2ed98e3b87ae4184075e8d
2022-09-22 19:01:33 +02:00
Pau Espin 21bcf6abd8 osmux: Attach osmux to virtual trunk
It makes sense to handle one osmux socket per trunk. Since we only so
far operate one RTP/osmux trunk, let's stick to that only one for
simplicity.

Change-Id: I173266c4058d5db9479d773d7dec1304bc8f1f99
2022-09-22 18:23:05 +02:00
Pau Espin 26e810d8a9 cosmetic: mgcp_conn.h: fix indentation whitespace
Change-Id: I6b12b589d1b0a8f95a8283aac8ba0ad22026b43f
2022-09-22 17:16:20 +02:00
Pau Espin 4d1a52d463 osmux: Log sendto() error
Change-Id: Icd91b725ac6b5ef2b9307cc99d67d60efdfa32cb
2022-09-22 17:11:57 +02:00
Pau Espin 83df47cd7a cosmetic: vty: Fix indentation whitespace
Change-Id: I2f42707f815ca58690d86a956118b6661c59fda3
2022-09-21 20:07:59 +02:00
Pau Espin c5bbb78ffe osmux: set log level of expected code path to INFO
Change-Id: I5caf850b7bb19c66716139512f16568d4f8459eb
2022-09-19 16:46:02 +02:00
Harald Welte e0e5a772f4 Make osmo_mgcpc_ep_fsm_pre_term() static
This is a call-back for FSM pre-termination and it should not
be publicly exported.

Change-Id: Iaa44906baa201571f6bc3192bd3caacb272fec0b
2022-09-16 10:37:22 +00:00
Pau Espin e39ae87ea3 osmux: don't store conn ptr inside shared osmux_handle
The struct osmux_handle is a shared structure which goes together 1-1
with libosmo-netif's struct osmux_in_handle, which is common to all CIDs
to be muxed together. Hence, it makes no sense to store a specific conn
object to it, since it actually manages several of them. Hence, all the
conn specific stuff must be handled beforehand, not at osmux deliver
time.

Related: SYS#5987
Change-Id: Ie739b556e9eb7d3133e798831a09728c7cc87135
2022-09-09 18:13:45 +02:00
Pau Espin 8b0a614e43 osmux: Fix memleak on error code path
Change-Id: Ib84f78a53293799b925b645156513e129c32c705
2022-09-09 18:13:45 +02:00
Pau Espin c61664c2b2 osmux: Log refcounting of osmux_handle_list
Change-Id: Ia873e3021078976748762baaf406865149b2a090
2022-09-09 18:13:45 +02:00
Pau Espin 15e7e4f37d osmux: Use osmo_sockaddr wherever possible
This cleans up all the code, and makes it a lot easier to add IPv6 support
later on (mostly only a matter of adding an IPv6 bind address in VTY).
Similar changes were done to the Osmux code being added to osmo-bts.

Related: SYS#5987
Change-Id: I5a100fc654f88d29b2bcd85889a5a92aef3d576d
2022-09-09 18:13:40 +02:00
Pau Espin ab8371c6d7 osmux: Use better name for function which may allocate a new struct
Change-Id: I867e3f74775d97749a78c2f198452b1f2916492f
2022-09-09 16:40:57 +02:00
Pau Espin 8c777990a5 cosmetic: main: Properly format log_info_cat
Change-Id: If130d1debc1977b7f8d82f515861df2c513d55bb
2022-09-09 16:21:22 +02:00
Pau Espin ec5e85b84e Add Osmux log category
Change-Id: Ia75de7965c39f3f84164a25584d901dbdd43f10f
2022-09-09 16:04:19 +02:00
Pau Espin ab4e8663e1 mgw: Use X-Osmux string define
Change-Id: Ib437c0a6b414f1d8f08fdb90e88a61e9aed2780d
2022-09-08 15:15:37 +02:00
Pau Espin a4f783b51b cosmetic: osmux: Fix wrong indentation
Change-Id: I7675d17bb3fc827e05c197104be29eadd8ddf3f2
2022-09-07 20:04:20 +02:00
Pau Espin 479cf76e55 mgw: Fix osmux conn local IP selection
The local Osmux IP address (cfg->osmux_addr) was never applied in
generated MGCP messages. Instead, the RTP one was written into the
MGCP message.

Related: SYS#5987
Change-Id: I305f2501221e86d1eb0140446c03f36698f3194a
2022-09-07 19:42:59 +02:00
Pau Espin 33639166a2 osmux: Use new osmux APIs to let libosmo-netif alloc struct osmux_out_handle
This way we don't need to worry about implementation details (struct
size) in the future in case they change (they will).

Related: OS#5987
Requires: libosmo-netif.git Change-Id Ie8df581f375c9a183a7af60b431561bda82f6e34
Change-Id: I2d0d8c152b8f1234ddfcd74d6cb04b1818b41510
2022-09-07 08:29:35 +00:00
Max 709aad28ed 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.

Related: OS#4821
Change-Id: I7696cd92953787591e7b4777ee79c2671326b972
2022-08-30 19:45:32 +07:00
Pau Espin 5892b2e4db Use Osmux default port define from libosmo-netif
Change-Id: Ibf5fbec591307232be98cad914c0df4b2993db15
Requires: libosmo-netif.git Ibfd058bceeeaa1384a00d8fcd6d6268b445e19bd
2022-08-12 14:08:34 +02:00
Pau Espin f1f73b8e1d mgcp_osmux: Drop duplicated conn_osmux_release_cid() in code path
Change-Id: I65d9978ee93ef9b1a2e48a92617ae8de3e131a93
2022-08-12 14:06:50 +02:00
Philipp Maier 0fdc08c551 mgcp_e1: fix apidoc
Change-Id: Iaccb9b67e72d113483160e61f660ea9c4c2f53a5
2022-08-10 14:13:41 +02:00
Vadim Yanitskiy 5be57da075 libosmo-mgcp-client: add -no-undefined to *_la_LDFLAGS
Make sure that there is no undefined references in shared libraries.

Change-Id: If6aa8016026beb8bad735987f3ab6e0d114b86a5
2022-08-04 05:35:43 +07:00
Pau Espin 147184eb06 mgcp-client: Remove impossible code path
read(4096 - 128) cannot return > 4096 - 128.

Change-Id: I352c3b28c8de6482277cb84cd0f51893494dc929
2022-06-29 18:45:02 +02:00
Pau Espin cfef36837e Bump version: 1.9.0.26-c9466-dirty → 1.10.0
Change-Id: If6d23bd0628cebf6cfa8fca0ae8a91278264e2a3
2022-06-28 18:50:25 +02:00
Harald Welte c946605208 update git URLs (git -> https; gitea)
Change-Id: I122aa939df79663a4f226565b32524b2bfdf7c68
2022-06-18 12:18:10 +02:00
Pau Espin a02faff1ac iuup: Check for IuUP Initialization retrans
Since libosmocore.git Change-Id
I5cb740702805693cc7f0a550e2e093f9bfdd507c, the IuUP stack can send INIT
event more than once, it sends one each time an IuUP Initialization
message is received.
This is done since potentially a peer could send an Initialization
message at any time with a different subflow size configuration. So
ideally we should update all osmo-mgw state regarding codecs, and
forward the Init starting the procedure on the other conn of the
endpoint.
However, this scenario is most probably not going to happen right now
and it would be a lot of work to implement and test,
and subsequent INITs we received will almost surely come from
retransmissions of the initial Initialization message, which means
content will not really change.
Hence, it makes sense to simply drop the receive message (the IuUP stack
already takes care of re-ACKing it) and let the endpoint state continue
with its ongoing procedures.

Related: SYS#4705
Change-Id: Ib97bc6f57d265622e24a776b96f0a82c25d33d39
2022-06-13 15:57:39 +02:00
Pau Espin ce055d5ac4 iuup: Fix caps in logging message
Change-Id: Icf836f770f22a9460378f91ef037997a73464faa
2022-05-25 18:34:06 +02:00
Pau Espin 452f2ba5bd IuUP: Support RFCI ID != RFCI Index
The initially merged IuUP API and implementation in libosmocore assumed
that RFCI with ID was always in the position of its ID inside the list
of RFCIs. This was the case for messages sent by ip.access nano3g as well
as our own osmocom implementation. However it was noticed that other nodes
from other vendors actually use other order, as allowed by the IuUP message
format.
Hence, we need to break the assumption and provide explicit ID
information in the list.

NOTICE: This commit implies an API change when using libosmogsm.
However, the previous API was never available in any libosmogsm release,
and only available in both libosmogsm and osmo-mgw master, so we are
only breaking compatibility between different master versions, which is
acceptable.

Related: SYS#5969
Depends: libosmocore.git Change-Id Ib21cee2e30bf83dff4e167f79541796007af9845
Change-Id: I40ebf36ad37f5196751caf2297a340e538ad28bc
2022-05-25 13:37:28 +02:00
Vadim Yanitskiy 0b6faa4521 libosmo-mgcp: e1: fix memleaks in e1_recv_cb()
Change-Id: I4be9e6d09b34e792f24c9f09d19dce15b9dfbe3f
Fixes: OS#5533
2022-04-18 02:29:42 +03:00
Vadim Yanitskiy 1c69fb0f14 tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
When using 'check_PROGRAMS', autoconf/automake generates smarter
Makefiles, so that the test programs are not being compiled during
the normal 'make all', but only during 'make check'.

Change-Id: I938669a78b4afa808ca4f741aee9919944aeb7f6
2022-04-13 19:55:34 +03:00
Philipp Maier 069dd16b67 mgcp_network: fix typo RTPC -> RTCP
Change-Id: I3274441a1bf6f4f015f01017ef03451b7f79310a
2022-03-30 17:05:56 +02:00
Philipp Maier e144275757 mgcp_network: do not try to convert RTCP packets
Make sure that RTCP packets do not enter the code path where AMR OA and BWE
is converted. The conversion will fail and the RTCP packet will be
dropped.

Change-Id: Ic850344d8b5f7710d12e4553a4033b733dced52b
Related: SYS#5902
2022-03-30 17:05:56 +02:00
Philipp Maier e0058b7207 mgcp_codec: do not differentiate between oa and bwe when comparing codec
AMR that has the payload format bandwith-efficient is the same codec as
AMR that has the payload format octet-aligned. Its the same codec, and a
comparison of the codec info with the function codecs_same() should
return true (=equal).

The affected function codecs_same() is used by mgcp_codec_pt_translate().
When the egress payload type number is looked up, the ingress and egress
codec information is compared. When one end is using AMR in
bandwith-efficient format and the other end is using it in
octet-alingned format. Then the codec still must be recognized as the
same codec. Othersiwse the payload type number translation would not
work, even though the codec is the same on both sides.

Change-Id: I64731570c287a75d39c79c10e1bc09a37bdd54d6
Related: SYS#5834
2022-02-16 17:17:45 +01:00
Pau Espin bb3ccdea1a Initial IuUP support using proper FSMs
Related: OS#1937
Depends: libosmocore Change-Id I63ee780b4aa162ea097410b234e73984000c0965
Change-Id: I6694a21480b25ab8f35d375295be6601ce38e31d
2022-02-07 17:50:31 +00:00
Pau Espin 2799ff9bb9 Make function amr_is_octet_aligned publicly available
it will be used by mgcp_iuup.c in follow-up patch.

Change-Id: Iffaf90c1f713feef0c609a7581a346f5f28141d9
2022-01-18 14:56:34 +00:00
Pau Espin fed5feafd3 Drop unneeded ax_check_compile_flag.m4
The macro is no longer used since
172f5acfce.

Change-Id: I2daa73b960a9f3ae7babb8b44dc343aaaf3b57aa
2022-01-11 17:46:41 +00:00