aboutsummaryrefslogtreecommitdiffstats
path: root/src/trau
AgeCommit message (Collapse)AuthorFilesLines
2020-03-09ortp: disable SO_REUSEADDR + SO_REUSEPORTHarald Welte1-0/+6
ortp >= 0.24.0 doesn't differentiate between SO_REUSEADDR and SO_REUSEPORT, and has both enabled by default. The latter means that we can end up with non-unique port bindings as we will not fail to bind the same port twice. This should have caused visible problems not only when operating multiple osmo-bts on one machine (rare), but also with a single osmo-bts. Once the range (default 16384-17407 ) wraps, there is a risk of new sockets (for new cals) colliding with old ones. As two ports (RTP+RTCP) are used per call, this means every 512 voice calls we expect the BTS to wrap. And from that point onwards there's a risk of overlapping with previously allocated sockets. Change-Id: I4fc9eee561c7958c70c63b4ffdc6cb700b795e28 Closes: OS#4444
2019-03-19rtp: Add 'autoconnect' feature to the osmo_rtp_socketSylvain Munaut1-0/+22
The bound RTP socket will wait for incoming RTP packets and as soon as it sees one, will 'connect' to it, so all replies will go to that sources and incoming messages from other sources will be discarded. This obviously only works once. Change-Id: I5b54ca4296901fcf37794faf29e0b2acca27bd1b Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2018-11-12osmo_ortp: Log domain and fix strings without endl charPau Espin Pedrol1-1/+28
Change-Id: Ib6df0df04cd6ba342753c84398274d04917ace40
2018-06-05Revert "ortp: enable scheduled mode on rtp socket creation"Philipp Maier1-1/+0
We discovered that enabling the scheduler caused a segfault on the ARM build of osmo-bts. So we have to revert the following two changes: Change-Id I3a63c23f5ede47773b6a249a48ecebd5d3b45ace Change-Id I4b8f0349d5503bbe53745cc8903beb26f149f219 This reverts commit 5a236ce1d414625476d0c0f652ecbe0eb2bbeaf1. Change-Id: Ic81062d79a304038a50658b955f7d05edb3fa28e Related: OS#3299
2018-06-05Revert "ortp: make sure the ortp scheduler is started"Philipp Maier1-1/+0
We discovered that enabling the scheduler caused a segfault on the ARM build of osmo-bts. So we have to revert the following two changes: Change-Id I3a63c23f5ede47773b6a249a48ecebd5d3b45ace Change-Id I4b8f0349d5503bbe53745cc8903beb26f149f219 This reverts commit 7632278ea36c25eaa0d8e35fa0ee102ec05dc802. Change-Id: Ie375b9eb0dc8ec4f8d4ca12940a7bc5dfc1f6235 Related: OS#3299
2018-05-31ortp: enable scheduled mode on rtp socket creationPhilipp Maier1-0/+1
we use some functionalities of libortp that require to use rtp sessions with the scheduled mode enabled. Since we do not enable the scheduled mode, yet, we receive error messages in the log that complain about a non enabled scheduled mode. - Turn on scheduled mode using rtp_session_set_scheduling_mode() when osmo_rtp_socket_create() is called. Note: this patch is related to chane: I3a63c23f5ede47773b6a249a48ecebd5d3b45ace Unfortunately we observed a segfault with ortp version 0.25.0 (ARM), which seems to be related to an unintialized scheduling mode. We expect this patch to fix the problem. Change-Id: I4b8f0349d5503bbe53745cc8903beb26f149f219 Closes: OS#3299
2018-05-30ortp: detect ssrc changes immediatelyPhilipp Maier1-0/+2
libortp detects an ssrc jump using a packet count thresold. This threshold is set to 50 by default. This means that libortp has to see 50 rtp packets with the new SSRC before it accepts the new stream. In our application we want to detect the changed SSRC (Handover) as fast as possible. So we should change the threshold to zero. - use rtp_session_set_ssrc_changed_threshold() to set a thresold of 0 packets when osmo_rtp_socket_create() is called. Change-Id: Id88c2c44d29a409affc2e47fdb932e1187020593 Related: OS#3299
2018-05-30ortp: reset rtp session on SSRC changesPhilipp Maier1-1/+2
When libortp detects a timestamp jump, we resynchronize the session in order to restore proper rtp frame reception. However, we do not resynchronize on an SSRC change. An SSRC change usually indicates the change of an RTP stream source, which is a much more profound event than a timestamp change, so we should even reset the session on SSRC changes. Also, not resynchronizing the session on an SSRC change causes problems when the jitter buffer feature is used. In those cases it takes libortp a long time until it finally detects the timestamp jump and the session resyhcornization happens late. - reset the ession on SSRC changes by calling rtp_session_reset() Change-Id: I8688a55cd20d0e14493c357db80754851e12f2fb Related OS#3299
2018-05-29ortp: make sure the ortp scheduler is startedPhilipp Maier1-0/+1
the function osmo_rtp_init() is initializing ortp at the start of the application. However, it does not start the scheduler of ortp, which leads into error log messages in some situatios. - make sure that ortp_scheduler_init() is called with osmo_rtp_init() Change-Id: I3a63c23f5ede47773b6a249a48ecebd5d3b45ace Related: OS#3299
2017-12-03Add a new osmo_rtp_set_source_desc() function to set the RTCP SDES itemsHarald Welte1-0/+7
This allows the users of libosmotrau to set the content of the SDES items to something more useful than their compile-time defaults. Change-Id: Ice794f9e0c6caeea1c67520c12efbfa375d1fb82 Related: OS#2701
2017-11-13Add SPDX-License-Identifier to all source filesHarald Welte1-0/+2
Change-Id: I9f2bc8c5d8a2c0bb0dd6caa4de5e2cb11be210e7
2017-06-29osmo_ortp.c: Duration of a RTP frame affects timestamp of the next onePau Espin Pedrol1-1/+1
Duration of an RTP frames dictates the timestamp used for the next frame, not for the one being sent now. It was done like this before to account for possible losses. Implementation wise, the duration was understood as "duration between last frame was sent and now when current one is sent". It makes more sense to use it as the duration in number of sampling ticks as described on the function documentation, specially now that we can account for extra time by means of osmo_rtp_skipped_frame. Change-Id: Ib8f5fa5509059fe908c09a4381844c613d478548
2017-06-29osmo_ortp: Add osmo_rtp_drop_frame APIPau Espin Pedrol1-0/+22
This API will be used by osmo-bts to maintain the sampling clock of the RTP socket whenever a frame should be sent but it is not available, for instance due to low quality of signal. Change-Id: Id6099372b6231c0a4b6ea0716f46f5daee7049e1
2017-06-22osmo_ortp.c: Fix warning: check ortp API in rtp_session_signal_connectPau Espin Pedrol1-4/+7
Since ortp commit 5ab29c50adc7948b11449e3aeee66010379ff7dc preceeding ortp 0.24, the API is fixed and requests a pointer instead of an unsigned long. As we now require at least ortp 0.22 since libosmo-abis 15d9b7929d449e4138bcb003c614035bceadc3d1, we need to support both old and new version of the API to continue having support for 0.22 but still supporting new versions of the library. Change-Id: I2dbd0498d75160358eca4336850e1a0ad2efdbeb
2017-06-22osmo_ortp.c: Fix warning: implicit use of functionPau Espin Pedrol1-1/+5
Explicitly state that we are using an internal API from ortp, and define the function we are using to avoid printing a warning. Change-Id: I9cadcb31ce7ade3632d83753be97fdc9ea518b5b
2017-03-29Fix RTP jitter buffer that never stop to increase.Jean-Francois Dionne1-1/+1
Duration passed to osmo_rtp_send_frame_ext function is based on the last frame and the current one. Duration must then be added to the timestamp before being transmitted. Change-Id: I0593d6530c097cca34125a0ae2dd1b019b4dd80d
2017-03-27configure: Fix compilation with new libortpPau Espin Pedrol1-3/+11
Commit 0c8d9ddaea8c1afdc0e9b8c37a31c9d158e57efd in ortp broke old API: function ortp_set_log_level_mask requires one new parameter 'domain'. This commit fixes compilation in my Archlinux box using ortp 1.0.1. Change-Id: I46e565f1873c7baf3c3b0aafe73951d20ce083b4
2016-12-16Enable adaptive jitter compensationMax1-10/+16
* check RTP socket parameter and enable necessary jitter buffering * return the status of requested jitter buffering instead of always returning 0 * document function parameters and return value Change-Id: I87d4d9fe990683adbb02b64cb39b78de533d8046
2016-12-16Remove obsolete compile-time conditionalMax1-4/+0
Change-Id: If8f87587227b09635361b758873f75d8b6aa3497
2016-12-12Expand network error callbackMax1-1/+1
ortp: use extra parameter for network_error callback in log message as it's described in oRTP documentation (error string). Change-Id: I581db499d453b80230198d95000f0f6fc20752d1
2016-12-05osmo_rtp_socket_poll(): Fix log message to match function nameMax1-1/+2
Change-Id: I5c36bbc35e2ba794b5e446f52a0752bcf1367d11
2016-11-26osmo_rtp_socket_fdreg(): Check return value of osmo_fd_register()Harald Welte1-2/+11
Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5 Fixes: Coverity CID 57631
2016-10-28Fix metadata corruptionHarald Welte1-2/+3
Use separate pointer for payload to make sure mblk->b_rptr is not advanced (which breaks the use of rtp_get_* macros that assume mblk->b_rptr is pointing to the RTP header, not the payload). Committed by: Max <msuraev@sysmocom.de> Change-Id: I205630e1da98693ba0ac25e86e21780284185077 Related: OS#1802
2016-10-27Unify RTP receivingMax1-31/+21
* Remove code duplication * Use return value of rtp_get_payload() instead of pointer arithmetic Change-Id: Id42e85b55eab33c5eb81ac7a2cdea7962b2e30ef
2016-10-21Extend RTP RX callback parametersMax1-0/+4
While debugging low-level RTP issues it is handy to be able to match exact RTP packet with the payload available to higher-level functions. Having Sequence number and Timestamp RTP fields as parameter to receiving callback is the easiest way to do so. Change-Id: I0c9b08d247d7342d6139badca77ce64fda0cf274
2016-10-12Resync RTP session in case of timestamp jumpYves Godin1-1/+2
This will prevent the timestamp jump to occur between each call for DTX if something goes wrong. It's handy as oRTP does not manage well timestamp jump if it is not resynced. Fixes: OS#1803 Change-Id: Iae5da832218dbd1ede7a9451102074f2a5eb66df
2016-10-06Really fix order of set_connected_mode and set_remote_addrNeels Hofmeyr1-6/+12
This reverts commit c77c2a6aa13accbc558888ab788d1148eb9aeb1a, and explicitly sets connected mode to zero for set_remote_addr to work around internal libortp problems. See https://osmocom.org/issues/1661#note-15. Related: OS#1661 Change-Id: I9d146c3bd76e02685b09278167b56029152221a0
2016-09-24Bump minimum oRTP version3G_2016_09Max1-8/+2
Require version 0.22.0 which matches Debian stable ATM to simplify testing and maintenance across all supported BTS models and corresponding toolchains. Change-Id: I005d60bb50889edad3e6fc0cd9f7f180aeaf1dab Fixes: SYS#2569
2016-09-20Use callback for polling dataMax1-1/+0
Previously rs->rtp_bfd.when and rs->rtcp_bfd.when value of BSC_FD_READ was overridden by 0. Fix it. Reported by coverity: CID 1357763. Change-Id: I11940cbf50361c4ea262d7001a16f9a982392f27
2016-09-09Change API to convey marker bitMax1-2/+4
Previously RTP receive callback ignored Marker bit from RTP headers. Extend API to include it explicitly. Change-Id: I3c2b6365d8a51bf98805614e07344d2639875fde Related: OS#1750
2016-09-05osmo_ortp.c: fix order of set_connected_mode and set_remote_addrNeels Hofmeyr1-4/+6
In libortp, rtp_session_set_connected_mode() sets a flag that is used in rtp_session_set_remote_addr(). The name rtp_session_set_remote_addr() is misleading: this function actually does take a lot of action, including an attempt to connect to the remote server. Thus the "connected mode" flag needs to be set before this. Suggested-by: NuRan Wireless <nuranwireless.com> Change-Id: I92308ddffc376af8d4d65e6b9cbeee222b7bff5e
2016-06-06Extend RTP frame sending APIMax1-0/+18
Add osmo_rtp_send_frame_ext() which accept boolean parameter in addition to arguments of osmo_rtp_send_frame() to explicitly set marker bit in RTP header. Previously it was always unset which resulted in degradation of speech quality for codecs with explicit talkspurt events (was tested with AMR's ONSET). Related: OS#1562 Change-Id: I23e6dccfad5643e662391a0a2abebbb45597ffd9 Reviewed-on: https://gerrit.osmocom.org/82 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-04-29Set connected mode after setting remote addressMax1-4/+5
ortp: according to oRTP documentation rtp_session_set_connected_mode() uses the address set by rtp_session_set_remote_addr() - move the function call accordingly. Fixes: OS#1661
2016-04-29Fix RTCP port allocationMax1-1/+2
Force use of RTCP port adjacend to random RTP port, if random RTP port is used. Before this patch, port 0 could be selected for RTCP.
2016-04-29Do not send RTP to port 0Max1-2/+12
Previously it was possible to send RTP data to port 0. This produce multiple errors during the beginning of RTP transmission. To address this OSMO_RTP_F_DISABLED flag was introduced. It's set by default for all new RTP sessions. It can be manually unset after the call to osmo_rtp_socket_create(). When the flag is set it prevents transmission and reception of RTP frames for the session. The flag is unset automatically in osmo_rtp_socket_connect() when session is bound to non-zero remote port. Fixes: OS#1662
2015-09-21ortp: Guard the jitter stats with a version checkHolger Hans Peter Freyther1-1/+4
ortp 0.18 has introduced the jitter_stats but we only check for 0.21 an later. It is okay that at some point the jitter stats will be reported. For previous versions it is 0.
2015-09-21ortp: Export statistics for the bts or similarv0.3.2Holger Hans Peter Freyther1-0/+26
We might want to know how many things arrived at the BTS and ortp is already counting for us. We don't intend to use RTCP so I am not sure what the last "sender report" is and how accurate the jitter is.
2014-06-24rtp: Randomize the initial timestamp for RFC complianceHolger Hans Peter Freyther1-0/+1
Pick a random timestamp when creating the session. RFC 3550: The initial value of the timestamp SHOULD be random, as for the sequence number. Fixes: SYS#403
2014-06-24rtp: Randomize the initial sequence number for RFC complianceHolger Hans Peter Freyther1-0/+4
The usage of random() is not that unpredictable but the closest we can get right now. RFC 3550: The initial value of the sequence number SHOULD be random (unpredictable) to make known-plaintext attacks on encryption more difficult, even if the source itself does not encrypt according to the method in Section 9.1, because the packets may flow through a translator that does. Techniques for choosing unpredictable numbers are discussed in [17]. Fixes: SYS#403
2013-10-06ortp: Fix the version check for ORTP by not using the cached resultHolger Hans Peter Freyther1-1/+1
The second check used the cached result for ORTP. Store the result in ORTP_VERSION and my system properly detects that it is running on < 0.21. The HAVE_ORTP_021 will always be defined so just use #if and not the #ifdef to fix the build.
2013-10-06enable support of libortp >= 0.21, which has an API breakageHarald Welte1-1/+5
in libortp >= 0.21, rtp_session_set_local_addr() has one extra argument for the RTCP port.
2013-02-19ortp: Don't write error callbacks to stderr, but use osmocom loggingHarald Welte1-4/+24
2013-02-14RTP: Allow disabling jitter buffer by setting a buffer size of 0v0.1.5Andreas Eversberg1-1/+4
2013-02-09Permit libortp to use the connect() syscall, enabling later getsockname()Harald Welte1-0/+5
If we bind a local socket to INADDR_ANY, then getsockname() will always return 0.0.0.0 for the local IP address _unless_ the socket was previously connected to a specific remote IP/port using connect(). This will have the side effect that we only accept RTP packets from the one IP/port that we have connect()ed to, but that is actually intentional and useful in our applications.
2012-07-01build: build libosmotrau.la in the src directory.Diego Elio Pettenò1-15/+0
This spares us another recursion, and allows a much higher parallelisation, since trau is only one source unit and one standalone library. Incidentally, also make sure that the version specification for libosmoabis is applied. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-07-01build: use LT_INIT([pic-only]) instead of forcing -fPIC in AM_CFLAGS.Diego Elio Pettenò1-1/+1
Also contextually remove the AC_PROG_LIBTOOL call (which is an obsolete name for what is now LT_INIT). Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-02-04osmo-ortp: Prefix oRTP messages with osmo-ortpHolger Hans Peter Freyther1-4/+4
When many applications write to the stdout it is not clear that 'network_error' comes from osmo-bts due the usage of oRTP. At least provide a hint that oRTP is involved.
2011-10-22osmo_ortp: include ortp/port.h for the memory management functionsHarald Welte1-0/+1
2011-09-08add osmo_rtp_socket_set_param() and osmo_rtp_socket_log_stats()Harald Welte1-0/+42
2011-09-07libosmo-trau: doxygen documentationHarald Welte1-8/+54