falconia has uploaded this change for review. ( 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 4 files changed, 35 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/42167/1
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 b5623e3..96d3f35 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->twjit_cfg); + bts->use_twrtp, bts->twjit_cfg);
if (!lchan->abis_ip.rtp_socket) { LOGPLCHAN(lchan, DRTP, LOGL_ERROR, "IPAC Failed to create RTP/RTCP sockets\n"); diff --git a/src/common/vty.c b/src/common/vty.c index 0411060..4c35cc7 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -424,6 +424,8 @@ 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); + vty_out(vty, " rtp library %s%s", bts->use_twrtp ? "twrtp" : "ortp", + 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 +799,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", @@ -2779,6 +2794,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);