From be4a2088098a7b4fbfc1a5046e4c2ceb21ce1b1d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 3 Dec 2017 10:29:13 +0100 Subject: Put useful information in RTCP SDES. The RTCP Sender Description is supposed to contain useful information to identify the source of the RTP stream. So far, it only contained compile-time default data of libortp. Let's put the BTS UnitID, the lchan number and the OsmoBTS version in there. This change requires libosmo-abis Change-Id Ice794f9e0c6caeea1c67520c12efbfa375d1fb82 Change-Id: Id6ce7188354d3a0517661c9648854ec829ef1cac Related: OS#2701 --- include/osmo-bts/gsm_data_shared.h | 1 + src/common/gsm_data_shared.c | 9 +++++++++ src/common/rsl.c | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index 4c0fe5c1..a05e4caf 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -1002,5 +1002,6 @@ struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); bool ts_is_tch(struct gsm_bts_trx_ts *ts); +const char *gsm_trx_unit_id(struct gsm_bts_trx *trx); #endif diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index c2d196bc..f4fda55f 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -851,3 +851,12 @@ bool ts_is_tch(struct gsm_bts_trx_ts *ts) { return pchan_is_tch(ts_pchan(ts)); } + +const char *gsm_trx_unit_id(struct gsm_bts_trx *trx) +{ + static char buf[23]; + + snprintf(buf, sizeof(buf), "%u/%u/%u", trx->bts->ip_access.site_id, + trx->bts->ip_access.bts_id, trx->nr); + return buf; +} diff --git a/src/common/rsl.c b/src/common/rsl.c index 461b21d1..60f964e5 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -20,6 +20,8 @@ * */ +#include "btsconfig.h" /* for PACKAGE_VERSION */ + #include #include #include @@ -1668,6 +1670,7 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) } if (dch->c.msg_type == RSL_MT_IPAC_CRCX) { + char cname[32]; char *ipstr = NULL; if (lchan->abis_ip.rtp_socket) { LOGP(DRSL, LOGL_ERROR, "%s Rx RSL IPAC CRCX, " @@ -1736,6 +1739,12 @@ static int rsl_rx_ipac_XXcx(struct msgb *msg) return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL, inc_ip_port, dch->c.msg_type); } + /* Ensure RTCP SDES contains some useful information */ + snprintf(cname, sizeof(cname), "bts@%s", ipstr); + osmo_rtp_set_source_desc(lchan->abis_ip.rtp_socket, cname, + gsm_lchan_name(lchan), NULL, NULL, + gsm_trx_unit_id(lchan->ts->trx), + "OsmoBTS-" PACKAGE_VERSION, NULL); /* FIXME: multiplex connection, BSC proxy */ } else { /* MDCX */ -- cgit v1.2.3