falconia has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/42197?usp=email )
Change subject: RTP: make ortp optional at compile time
......................................................................
RTP: make ortp optional at compile time
It is now possible to run osmo-bts configure with --disable-ortp
option, which makes it use only twrtp library (integrated into
libosmo-netif) and removes all dependency on Belledonne software,
such that osmo-bts can be built on top of libosmo-abis that has also
been configured with its respective --disable-ortp option.
TODO: contrib/ber/rtp_ber utility still uses ortp and has no support
for twrtp or any other alternative - therefore, when osmo-bts is
configured with --disable-ortp, this utility is not built.
Related: OS#6474
Change-Id: Ib171bd42a65117457319befee2615e0c36c8d9e1
---
M configure.ac
M contrib/Makefile.am
M src/common/bts.c
M src/common/rtp_abstract.c
M src/common/vty.c
5 files changed, 50 insertions(+), 9 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/configure.ac b/configure.ac
index 423b710..fe69954 100644
--- a/configure.ac
+++ b/configure.ac
@@ -308,6 +308,19 @@
CPPFLAGS=$oldCPPFLAGS
fi
+AC_ARG_ENABLE([ortp], [AS_HELP_STRING([--disable-ortp], [Build without ortp support])],
+ [
+ ENABLE_ORTP=$enableval
+ ],
+ [
+ ENABLE_ORTP="yes"
+ ])
+AS_IF([test "x$ENABLE_ORTP" = "xyes"], [
+ AC_DEFINE([HAVE_ORTP],[1],[Build with ortp support])
+])
+AM_CONDITIONAL(ENABLE_ORTP, test "x$ENABLE_ORTP" = "xyes")
+AC_SUBST(ENABLE_ORTP)
+
# Generate manuals
AC_ARG_ENABLE(manuals,
[AS_HELP_STRING(
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 5594199..a34e66f 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1 +1,5 @@
-SUBDIRS = systemd ber
+SUBDIRS = systemd
+
+if ENABLE_ORTP
+SUBDIRS += ber
+endif
diff --git a/src/common/bts.c b/src/common/bts.c
index 11f57a7..2cf4d0a 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -20,6 +20,8 @@
*
*/
+#include "btsconfig.h"
+
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
@@ -38,7 +40,10 @@
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/gsm/gsm48.h>
#include <osmocom/gsm/lapdm.h>
+
+#ifdef HAVE_ORTP
#include <osmocom/trau/osmo_ortp.h>
+#endif
#include <osmo-bts/logging.h>
#include <osmo-bts/abis.h>
@@ -316,7 +321,6 @@
{
int rc, i;
static int initialized = 0;
- void *tall_rtp_ctx;
bts->band = GSM_BAND_1800;
@@ -358,11 +362,14 @@
* by users of the software (GSM network operators), as opposed
* to being imposed by developers as a flag day change.
* The current default is to use ortp, in order to avoid any
- * surprise changes in behaviour. It is expected that this
- * default will change at some point in the future, prior to
- * full discontinuation of support for ortp.
+ * surprise changes in behaviour - but only if ortp is available
+ * at compile time.
*/
+#ifdef HAVE_ORTP
bts->use_twrtp = false;
+#else
+ bts->use_twrtp = true;
+#endif
/* Default (fall-back) MS/BS Power control parameters */
power_ctrl_params_def_reset(&bts->bs_dpc_params, true);
@@ -393,10 +400,15 @@
oml_mo_state_init(&bts->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
oml_mo_state_init(&bts->gprs.cell.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
+#ifdef HAVE_ORTP
/* allocate a talloc pool for ORTP to ensure it doesn't have to go back
* to the libc malloc all the time */
- tall_rtp_ctx = talloc_pool(tall_bts_ctx, 262144);
- osmo_rtp_init(tall_rtp_ctx);
+ {
+ void *tall_rtp_ctx;
+ tall_rtp_ctx = talloc_pool(tall_bts_ctx, 262144);
+ osmo_rtp_init(tall_rtp_ctx);
+ }
+#endif
/* Osmux */
rc = bts_osmux_init(bts);
diff --git a/src/common/rtp_abstract.c b/src/common/rtp_abstract.c
index 4854b25..fabfe6f 100644
--- a/src/common/rtp_abstract.c
+++ b/src/common/rtp_abstract.c
@@ -11,7 +11,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
-#define HAVE_ORTP
+#include "btsconfig.h"
#include <osmocom/core/logging.h>
#include <osmocom/core/msgb.h>
diff --git a/src/common/vty.c b/src/common/vty.c
index af381b5..a923067 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -432,8 +432,10 @@
* In the meantime, however, extra attention is required to keep
* the following code in sync with changes in the default!
*/
+#ifdef HAVE_ORTP
if (bts->use_twrtp)
vty_out(vty, " rtp library twrtp%s", VTY_NEWLINE);
+#endif
if (bts->rtp_nogaps_mode)
vty_out(vty, " rtp continuous-streaming%s", VTY_NEWLINE);
vty_out(vty, " %srtp internal-uplink-ecu%s",
@@ -815,8 +817,18 @@
BTS_VTY_ATTR_NEW_LCHAN)
{
struct gsm_bts *bts = vty->index;
+ bool use_twrtp;
- bts->use_twrtp = !strcmp(argv[0], "twrtp");
+ use_twrtp = !strcmp(argv[0], "twrtp");
+#ifndef HAVE_ORTP
+ if (!use_twrtp) {
+ vty_out(vty,
+ "%% Error: OsmoBTS was built without ortp support%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+#endif
+ bts->use_twrtp = use_twrtp;
return CMD_SUCCESS;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42197?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib171bd42a65117457319befee2615e0c36c8d9e1
Gerrit-Change-Number: 42197
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/42167?usp=email )
Change subject: RTP: add vty option for ortp vs twrtp selection
......................................................................
RTP: add vty option for ortp vs twrtp selection
With this patch it finally becomes possible for the user to select
which RTP library should be used: ortp or twrtp. ortp is still
the default for now, in order to not alter behavior for existing
installations until twrtp receives more real world testing by users
beyond the original author. Future patches may change the default
or even remove ortp support altogether - but twrtp should receive
more testing as a user opt-in feature first.
Related: OS#6474
Change-Id: Iff4e3a399250c16ba8fe4cb12e4e22f4c6b346ec
---
M include/osmo-bts/bts.h
M src/common/bts.c
M src/common/lchan.c
M src/common/vty.c
M tests/osmo-bts.vty
5 files changed, 74 insertions(+), 1 deletion(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index ec13d71..8bd3a83 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -319,6 +319,7 @@
struct llist_head bsc_oml_hosts;
unsigned int rtp_jitter_buf_ms;
bool rtp_jitter_adaptive;
+ bool use_twrtp;
struct osmo_twjit_config *twjit_cfg;
uint16_t rtp_port_range_start;
diff --git a/src/common/bts.c b/src/common/bts.c
index 78ea417..11f57a7 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -347,6 +347,23 @@
bts->rtp_priority = -1;
bts->emit_hr_rfc5993 = true;
+ /* At the present point in OsmoBTS evolution the user can select
+ * which RTP library should be used: Belledonne ortp (legacy) or
+ * Themyscira twrtp (integrated into libosmo-netif). There is
+ * a desire to eventually deprecate ortp altogether and support
+ * only Osmocom-native twrtp, but because the two implementations
+ * take drastically different approaches to the hard problem of
+ * converting from an incoming RTP stream to fixed timing for
+ * GSM TCH Tx, the transition should involve extensive testing
+ * by users of the software (GSM network operators), as opposed
+ * to being imposed by developers as a flag day change.
+ * The current default is to use ortp, in order to avoid any
+ * surprise changes in behaviour. It is expected that this
+ * default will change at some point in the future, prior to
+ * full discontinuation of support for ortp.
+ */
+ bts->use_twrtp = false;
+
/* Default (fall-back) MS/BS Power control parameters */
power_ctrl_params_def_reset(&bts->bs_dpc_params, true);
power_ctrl_params_def_reset(&bts->ms_dpc_params, false);
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 1e8b501..1fdb3f1 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -587,7 +587,7 @@
//if (!payload_type)
lchan->tch.last_fn = LCHAN_FN_DUMMY;
lchan->abis_ip.rtp_socket = rtp_abst_socket_create(lchan->ts->trx,
- false,
+ bts->use_twrtp,
bts->twjit_cfg);
if (!lchan->abis_ip.rtp_socket) {
diff --git a/src/common/vty.c b/src/common/vty.c
index 0411060..af381b5 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -424,6 +424,16 @@
vty_out(vty, " rtp ip-dscp %d%s", bts->rtp_ip_dscp, VTY_NEWLINE);
if (bts->rtp_priority != -1)
vty_out(vty, " rtp socket-priority %d%s", bts->rtp_priority, VTY_NEWLINE);
+ /* We write out "rtp library" setting only when it differs from the
+ * default. This policy is necessary in order to make the new default
+ * take effect for 'indifferent' users when we change it - and finally,
+ * this vty setting will disappear altogether when we eventually drop
+ * ortp support and make twrtp mandatory.
+ * In the meantime, however, extra attention is required to keep
+ * the following code in sync with changes in the default!
+ */
+ if (bts->use_twrtp)
+ vty_out(vty, " rtp library twrtp%s", VTY_NEWLINE);
if (bts->rtp_nogaps_mode)
vty_out(vty, " rtp continuous-streaming%s", VTY_NEWLINE);
vty_out(vty, " %srtp internal-uplink-ecu%s",
@@ -797,6 +807,19 @@
return CMD_SUCCESS;
}
+DEFUN_ATTR(cfg_bts_rtp_library,
+ cfg_bts_rtp_library_cmd,
+ "rtp library (ortp|twrtp)",
+ RTP_STR "RTP library selection\n"
+ "Belledonne ortp\n" "Themyscira twrtp\n",
+ BTS_VTY_ATTR_NEW_LCHAN)
+{
+ struct gsm_bts *bts = vty->index;
+
+ bts->use_twrtp = !strcmp(argv[0], "twrtp");
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_bts_rtp_cont_stream,
cfg_bts_rtp_cont_stream_cmd,
"rtp continuous-streaming",
@@ -1482,6 +1505,33 @@
return CMD_SUCCESS;
}
+/* "show running-config" cannot reliably indicate which RTP library is
+ * selected because we have to omit "rtp library" setting when it matches
+ * the default, and that default is expected to change as we progress
+ * toward eventual removal of ortp. This additional show command
+ * allows an operator to see unambiguously which RTP library is in use.
+ */
+DEFUN(show_bts_rtp, show_bts_rtp_cmd,
+ "show bts <0-255> rtp",
+ SHOW_STR "Display information about a BTS\n"
+ BTS_NR_STR "RTP library selection\n")
+{
+ const struct gsm_bts *bts;
+
+ bts = gsm_bts_num(g_bts_sm, atoi(argv[0]));
+ if (bts == NULL) {
+ vty_out(vty, "%% can't find BTS '%s'%s",
+ argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ vty_out(vty, "RTP library: %s%s",
+ bts->use_twrtp ? "Themyscira twrtp" : "Belledonne ortp",
+ VTY_NEWLINE);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(test_send_failure_event_report, test_send_failure_event_report_cmd, "test send-failure-event-report <0-255>",
"Various testing commands\n"
"Send a test OML failure event report to the BSC\n" BTS_NR_STR)
@@ -2761,6 +2811,7 @@
install_element_ve(&show_lchan_cmd);
install_element_ve(&show_lchan_summary_cmd);
install_element_ve(&show_bts_gprs_cmd);
+ install_element_ve(&show_bts_rtp_cmd);
install_element_ve(&logging_fltr_l1_sapi_cmd);
install_element_ve(&no_logging_fltr_l1_sapi_cmd);
@@ -2779,6 +2830,7 @@
install_element(BTS_NODE, &cfg_bts_rtp_port_range_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_ip_dscp_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_priority_cmd);
+ install_element(BTS_NODE, &cfg_bts_rtp_library_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_cont_stream_cmd);
install_element(BTS_NODE, &cfg_bts_no_rtp_cont_stream_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_int_ul_ecu_cmd);
diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty
index 94f1fed..f6b1d2e 100644
--- a/tests/osmo-bts.vty
+++ b/tests/osmo-bts.vty
@@ -33,6 +33,7 @@
<0-255> BTS Number
OsmoBTS> show bts 0 ?
gprs GPRS/EGPRS configuration
+ rtp RTP library selection
<cr>
OsmoBTS> show trx ?
[<0-255>] BTS Number
@@ -134,6 +135,7 @@
<0-255> BTS Number
OsmoBTS# show bts 0 ?
gprs GPRS/EGPRS configuration
+ rtp RTP library selection
<cr>
OsmoBTS# show trx ?
[<0-255>] BTS Number
@@ -233,6 +235,7 @@
rtp port-range <1-65534> <1-65534>
rtp ip-dscp <0-63>
rtp socket-priority <0-255>
+ rtp library (ortp|twrtp)
rtp continuous-streaming
no rtp continuous-streaming
rtp internal-uplink-ecu
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42167?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iff4e3a399250c16ba8fe4cb12e4e22f4c6b346ec
Gerrit-Change-Number: 42167
Gerrit-PatchSet: 6
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-bts/+/42197?usp=email )
Change subject: RTP: make ortp optional at compile time
......................................................................
Patch Set 3:
(1 comment)
File contrib/Makefile.am:
https://gerrit.osmocom.org/c/osmo-bts/+/42197/comment/bc7957ce_dd8ca64d?usp… :
PS3, Line 4: SUBDIRS += ber
> I already added this ticket: […]
Since every patch in the series now got CR+2, I am marking this comment as resolved - let's continue this thread in the linked Redmine ticket.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42197?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib171bd42a65117457319befee2615e0c36c8d9e1
Gerrit-Change-Number: 42197
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Feb 2026 16:46:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: falconia, pespin.
fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-bts/+/42197?usp=email )
Change subject: RTP: make ortp optional at compile time
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42197?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib171bd42a65117457319befee2615e0c36c8d9e1
Gerrit-Change-Number: 42197
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Feb 2026 16:39:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Hoernchen, laforge, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/42203?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: fix --disable-log-macros
......................................................................
fix --disable-log-macros
Before 9197c1ac, the AC_ARG_ENABLE(log_macros, ...)
action was hardcoded to [log_macros="yes"], so *any*
use of the flag --enable-log-macros or --disable-log-macros
would set log_macros="yes" -> AC_DEFINE([LIBOSMOCORE_NO_LOGGING]).
The commit changed this to the standard [log_macros=$enableval], but
broke the conditional test, so
- AC_ARG_ENABLE sets $enableval to "no" for --disable-* flags
-> log_macros is now "no"
-> test fails
-> LIBOSMOCORE_NO_LOGGING is never defined...
The opposite of what it should do...
Change-Id: I809ab2f61e72428ba21061055296eb83d6d710ab
---
M configure.ac
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/42203/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/42203?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I809ab2f61e72428ba21061055296eb83d6d710ab
Gerrit-Change-Number: 42203
Gerrit-PatchSet: 3
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
pespin has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-trx/+/42199?usp=email )
Change subject: fix(threads): centralize portable strerror handling
......................................................................
Patch Set 2:
(1 comment)
File CommonLibs/Utils.cpp:
https://gerrit.osmocom.org/c/osmo-trx/+/42199/comment/a56f14db_9f90bb2b?usp… :
PS2, Line 36:
So now you are adding a function which is not used anywhere?I'd rather drop the c++ one and simply use this one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42199?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I642aff8a9f98823e117c4debd19384ddf5975039
Gerrit-Change-Number: 42199
Gerrit-PatchSet: 2
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Feb 2026 16:39:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No