Commit Graph

560 Commits

Author SHA1 Message Date
Alexander Couzens 35daa67763 e1_input: remove superflous semi colon
Change-Id: I7e9079cbac1d9920da2aace35810682b49ec532f
2016-11-16 10:08:02 +00:00
Harald Welte ab3b5606fe lapd_pcap.h: Add missing #include lines
we reference 'struct msgb' and mode_t, so we have to #include
the right header files.

Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863
2016-11-16 10:07:24 +00:00
Arran Cudbard-Bell 67b81eb6fe e1_input.h: add missing extern for value string arrays
Mark two value string arrays as extern, so symbols aren't created for
each source file that includes the headers.

Tweaked-by: nhofmeyr (commit log)
Signed-off-by: Arran Cudbard-Bell <a.cudbardb@freeradius.org>
Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb
2016-11-03 12:24:01 +00:00
Philipp Maier 0c7d5f4a61 lapd: adding support for ericsson's lapd dialect
Ericsson's RBS2111-BTS (and similar) implements a lapdm dialect which uses
a link establishment method that differs from the standard. While the BSC
is transmitting sabm frames on one specific timeslot, the BTS will
periodically scan through all timeslots to check for incoming sabm frames.
When the BTS detcts the sabm fames on one of the timeslots it will stay
there and continue to commence the link establishment.

The described procedure requires a slightly modified lapd profile, the t200
retransmission timeout has to be configured to exactly 300 msek. Otherwise
the link establishment will fail. Since the BTS will switch from timeslot
to timeslot most of the sabm frames will not be seen by the BTS, so the
maximum retransmission has to be increased. This patch suggests a maximum
retry count of 300, which is an educated guess and has worked fine during
our tests.

Change-Id: I892af57013d7ab4216e9e2d0873a69129aaeb8e5
2016-11-02 09:23:01 +00:00
Harald Welte 7895e0456a Fix metadata corruption
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-28 09:03:22 +00:00
Max f69060066c Unify RTP receiving
* Remove code duplication
* Use return value of rtp_get_payload() instead of pointer arithmetic

Change-Id: Id42e85b55eab33c5eb81ac7a2cdea7962b2e30ef
2016-10-27 18:06:20 +02:00
Max 02ceea8342 Extend RTP RX callback parameters
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-21 19:45:00 +02:00
Harald Welte 7a228ebc60 Add HDLC timeslot mode
This is useful for protocols that use HDLC framing for signalling on E1
timeslots, but which don't use LAPD inside (our E1INP_TS_TYPE_SIGN).

Examples are particularly a MTP2/MTP3 SS7 stack, like it is used on the
A interfaces or on the core network interfaces of classic
circuit-switched networks.

Change-Id: I2d75801df4d7cbb8dad325f4d6689841f0196fa6
2016-10-17 22:15:55 +02:00
Harald Welte a0108e78a9 Implement new 'raw' input type for E1 timeslots
In the past, the A-bis E1 input system only unederstood LAPD signalling
time-slots and trau-slots with 16kBps sub-slots.  This adds the notion
of a 'raw' transparent 64kBps slot, without any furthe de-multiplexing
nor any HLDC inside.

Change-Id: I0c25c2688eddd0c55c15b280a8c6e8a49629516b
2016-10-17 22:14:19 +02:00
Harald Welte 4ca5c53f7f Convert e1inp_{sign,ts}type_name() to use struct value_string
Change-Id: I0546c3f5aefe5e1cc33d8d82f1783fa467e37ff0
2016-10-16 22:14:08 +00:00
Harald Welte f35d8898ab e1_input: Add E1 timeslot number to input_signal_data
It is quite useful for the signal receiver to know on which of the many
E1/T1 timeslots a given event (like a 'link down' event) has happened.
The line number, TEI and SAPI are isnuficcient in case there are
multiple signalling TS in the line.

Change-Id: I07f0f79e0cda09766f357032ffb4e7ad643d448a
2016-10-16 22:13:46 +00:00
Harald Welte 1129040594 remove non-existant e1inp_update_ts() from e1_input.h
This function didn't exist ever since the inception of libomso-abis.

Change-Id: Ib471f03a93a73efe18fbd69d6eb1cb35bdb4e9a3
2016-10-16 21:46:00 +00:00
Neels Hofmeyr 017752fedc jenkins.sh: call cat-testlogs.sh on check failure
Change-Id: I60e70d290c41633528b39401219746ccf0f93784
2016-10-12 13:27:12 +02:00
Neels Hofmeyr fdcb961137 jenkins.sh: use osmo-build-dep.sh, print separator
Change-Id: I36ce41c669ffb123ec0741061e357a94baee6460
2016-10-12 11:22:21 +00:00
Neels Hofmeyr 04c73cb83f jenkins.sh: cosmetic: export instead of inlining PATH env
Change-Id: I24a383140f2f84e90ab743691bcbf041de7b034d
2016-10-12 11:22:20 +00:00
Yves Godin 2c32f0a269 Resync RTP session in case of timestamp jump
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-12 09:26:00 +00:00
Neels Hofmeyr a0ff942e92 Really fix order of set_connected_mode and set_remote_addr
This reverts commit c77c2a6aa1,
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-10-06 15:50:18 +02:00
Neels Hofmeyr 24796f2147 configure: check for pkg-config presence
Change-Id: If21ff26a836fd91021e0457ae0316be6b29b4577
2016-10-01 00:59:19 +02:00
Neels Hofmeyr f5d28602a7 build: be robust against install-sh files above the root dir
Explicitly set AC_CONFIG_AUX_DIR.

To reproduce the error avoided by this patch:

  rm install-sh        # in case it was already generated.
  touch ../install-sh  # yes, outside this source tree
  autoreconf -fi

This will produce an error like

  ...
  configure.ac:16: error: required file '../ltmain.sh' not found
  configure.ac:5: installing '../missing'
  src/Makefile.am: installing '../depcomp'
  autoreconf: automake failed with exit status: 1

See also automake (vim `which automake`) and look for 'sub locate_aux_dir'.

Change-Id: I5f69112f58b0a8ce0d848b0b6b543500ee63d133
2016-10-01 00:59:19 +02:00
Max 15d9b7929d Bump minimum oRTP version
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-24 16:30:22 +02:00
Max fc47015d91 Use callback for polling data
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-20 19:17:02 +02:00
Max 6dab90f39f Change API to convey marker bit
Previously RTP receive callback ignored Marker bit from RTP
headers. Extend API to include it explicitly.

Change-Id: I3c2b6365d8a51bf98805614e07344d2639875fde
Related: OS#1750
2016-09-09 06:34:54 +00:00
Neels Hofmeyr c77c2a6aa1 osmo_ortp.c: fix order of set_connected_mode and set_remote_addr
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-09-05 14:18:08 +02:00
Neels Hofmeyr 085ab0bb9c gitignore: platform-libtool
Change-Id: I73ad62a015827582d1ac005d9a326b86c699d46b
2016-08-08 16:02:02 +02:00
Harald Welte 7f9d851d9f e1_input: Use osmo_pcap_lapd if using software LAPD
The e1_input code for PCAP writing uses the Layer3 RSL/OML message and
prepends a fake LAPD header.  This means that all frames look like UI
frames in wireshark.  In case we use in-kernel LAPD of mISDN, this is
the best we can do.  However, in case of software (libosmocore) LAPD,
we can do better, by dumping the real LAPD frames at the interface
between LAPD code and the physical layer.

Related: OS#1763
Change-Id: Id0815690b5bc0a9b7f29f5cfde9d2f24c4f88ee5
2016-07-04 10:30:01 +02:00
Harald Welte b4698ef0d9 lapd_pcap: Correctly set the pseudo-header packet type
We want the direction of the packet to be properly reflected in the
pseudo-header, so wireshark can display if the packet is sent in
network->user (BSC->BTS) direction, or in th reverse direction.

Related: OS#1764
Change-Id: I19afca0ce7e8b068bc64fa14bce6feb35aa9f1fc
2016-07-04 10:29:48 +02:00
Harald Welte 47bee5bed5 Add osmo_pcap_lapd_set_fd() function
This way the caller can hand in an already-open file descriptor, rather
than calling osmo_pcap_lapd_open() with a file path name.

Change-Id: Ic7193907a96b0e2284cb6a8a942d2bf0fb95d7e4
2016-07-04 10:25:02 +02:00
Max c1cf14cae8 Fix macro definitions
Wrap macro parameter in brackets to make sure macros always work
properly: without it GSM_FN_TO_MS(a - b) will result in a - b *
GSM_TDMA_FRAME_MS contrary to the user's expectation of (a - b) *
GSM_TDMA_FRAME_MS.

Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41
Reviewed-on: https://gerrit.osmocom.org/217
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-12 15:45:25 +00:00
Max c42c2ca8e0 Add defines for FN to SAMPLE conversion
Add defines necessary to correctly convert number of TDMA frames into
number of voice samples. Defines are proposed by Harald in comments on
gerrit.

Change-Id: I1d8345352fb2ac76f71e88cb40f089fe3f9aae7e
Related: OS#1562
Reviewed-on: https://gerrit.osmocom.org/200
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-06 10:05:53 +00:00
Max 73b9bc72ac Extend RTP frame sending API
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-06-06 10:03:08 +00:00
Holger Hans Peter Freyther 6479728586 debian: Make upgrading from debian SID easier
Make sure the version number of this sourcepackage is higher than
the one found in Debian SID.

Change-Id: I393ef6624f112794e15b81a0cc9dbd8b0a871b07
Reviewed-on: https://gerrit.osmocom.org/110
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-25 19:40:39 +00:00
Harald Welte 9ed7ca5b86 ipa_bts_id_resp(): handle non-existing members of ipacces_unit
Just because the IPA server is requesting certain identities via the CCM
protocol, doesn't mean that the client actually has those fields
available and initialized in struct ipaccess_unit.

Instad of segfaulting the client, let's check if the respective
identities are known.  If yes, send them.  If not, send the empty string
for that particular identity.
2016-04-29 12:59:27 +02:00
Harald Welte 12814b9636 ipa_server_conn: Add server-side CCM handling
An ipa_server implementation may call ipa_server_conn_ccm for
the CCM processing on the server side of the connection.  This
function in turn will call a conn->ccm_cb() function for messages to be
handled by the server implementation, such as the ID_RESP message,
which contains the Unit ID of the client that has just connected.
2016-04-29 12:59:27 +02:00
Harald Welte b2d727a102 ipa_server_conn: Add remote (peer) address to struct
This is better than every implementation calling getpeername()
on its own.
2016-04-29 12:59:27 +02:00
Max 8c119f7a05 Set connected mode after setting remote address
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-29 12:54:38 +02:00
Max 80f7c0465f Fix RTCP port allocation
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-29 12:54:00 +02:00
Max e54d7bcef5 Do not send RTP to port 0
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
2016-04-29 12:53:21 +02:00
Holger Hans Peter Freyther d8026ec1b7 distcheck: Include the .version file in the package
Fixes on Ubuntu

make[1]: Entering directory '/home/builder/jenkins/workspace/libosmo-abis/label/linux_amd64_ubuntu_1504/libosmo-abis-0.3.2.5-7c93/_build/sub'
echo 0.3.2.5-7c93 > ../../.version-t && mv ../../.version-t ../../.version
/bin/bash: ../../.version-t: Permission denied
Makefile:891: recipe for target '../../.version' failed
make[1]: *** [../../.version] Error 1
2016-04-24 10:32:37 +02:00
Holger Hans Peter Freyther 7c9337b775 jenkins: Add the build script from jenkins here
This can be used to replicate a build issue more easily.
2016-04-13 18:52:43 -04:00
Neels Hofmeyr 0db1d43c0d ipa driver: make bind address vty configurable
Add VTY function to set the ipa bind address:
    e1_input
     ipa bind A.B.C.D

Add a priv pointer to struct e1inp_driver in order to communicate the bind
address parameter to ipaccess_line_update(). Add two "internal.h" functions to
get/set it in the ipa driver struct.

Add static ip_bind_addr() to use the IP address set from the VTY or, if NULL,
use "0.0.0.0". Apply in ipaccess_line_update().
2016-02-25 12:12:28 +01:00
Alexander Huemer 86fc3c8787 export lapd_tei_alloc(), used in libosmo-netif 2015-11-07 12:33:40 +01:00
Holger Hans Peter Freyther 3cef39b03c debian: Bump so version to link against new libosmovty2
Debian doesn't have reverse dependencies so we need to bump the
SO version to have libosmoabis and libosmotrau link against our
new version.
2015-11-03 09:42:24 +01:00
Holger Hans Peter Freyther 71bc9e2ac8 ortp: Guard the jitter stats with a version check
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-21 12:18:37 +02:00
Holger Hans Peter Freyther fe01908428 ortp: Export statistics for the bts or similar
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.
2015-09-21 10:55:12 +02:00
Harald Welte b37c5d48f0 configure.ac: Add subdir-objects 2015-08-15 10:50:53 +02:00
Holger Hans Peter Freyther 3a580f263a subchan: Remove unused const variable
nullbytes has never been used, I assume the code ended up
using memset instead of copying from nullbytes.

Fixes:
subchan_demux.c:47:22: warning: unused variable 'nullbytes' [-Wunused-const-variable]
static const uint8_t nullbytes[SYNC_HDR_BITS];
2015-03-22 09:25:19 +01:00
Holger Hans Peter Freyther 050d60a9a1 debian: Switch to multi-arch support 2015-03-14 20:01:48 +01:00
Holger Hans Peter Freyther 2f0dd0c019 New upstream release 2015-01-18 19:27:07 +01:00
Holger Hans Peter Freyther 9087859057 ipa: Add API to clear the tx queue
Jacob noticed that after a re-connect old messages would be
sent. This can be the wanted behavior but add a method that
allows a caller to clear the tx queue. The implementation has
not been verified and there is no existing unit test where
I could easily add this code to.
2015-01-18 17:52:08 +01:00
Holger Hans Peter Freyther adfa01f041 misdn: Close the file descriptor if the ioctl is failing
Fixes: Coverity CID#1040691
2014-12-26 18:13:55 +01:00