Commit Graph

4510 Commits

Author SHA1 Message Date
Jacob Erlbeck a52ac66e52 mgcp: Add tests for payload types in MGCP messages
These tests mainly check whether the SDP parsing works properly by
looking at the payload type detected.

Sponsored-by: On-Waves ehf
2013-12-05 10:27:32 +01:00
Jacob Erlbeck 2bee7f96ff mgcp: Add new for_each_line macro that also returns empty lines
This patch add the for_each_line macro based on a strline_r()
function (similar to strtok_r()), that is also part of this patch.
This strline_r() function is tolerant with respect to line endings,
it supports CR-only, CRLF, and LF-only and any combinations thereof
(note that a CRLF is always detected as a single line break).

Similar to for_each_non_empty_line (the former for_each_line) where
the 'save' pointer needed to be initialised by a call to strtok_r(),
the new for_each_line macro expects, that the 'save' pointer has been
initialised by a call to strline_r(). Also note, that
for_each_line/strline_r and for_each_non_empty_line/strtok_r may use
the 'save' pointer differently, so calls to them can not be mixed.

Sponsored-by: On-Waves ehf
2013-12-05 10:27:32 +01:00
Jacob Erlbeck a01bd60851 mgcp: Rename for_each_line to for_each_non_empty_line
The implementation of for_each_line is based on strtok() and skips
any sequence of CR and LF. Thus empty lines are never detected. There
exists code which tests for an empty line to detect the beginning of
the SDP part which is dead code currently (the parser works
nevertheless due to other reasons). So the semantics of this macro
have been misunderstood at least once.

This patch renames the macro to reflect the semantics more precisely.

Sponsored-by: On-Waves ehf
2013-12-05 10:27:32 +01:00
Harald Welte 19d8742820 osmo-nitb: don't print 'bac_hack' in usage/help output 2013-11-27 01:28:21 +01:00
Jacob Erlbeck 72c309021a mgcp/rtp: Fix timestamp offset when patching RTP packets
The current implementation increments the seqno but does not increment
the RTP timestamp, leading to two identical timestamps following one
after the other.

This patch fixes this by adding the computed tsdelta when the offset
is calulated. In the unlikely case, that a tsdelta hasn't been
computed yet when the SSRC changes, a tsdelta is computed based on
the RTP rate and a RTP packet duration of 20ms (one speech frame per
channel and packet). If the RTP rate is not known, a rate of 8000 is
assumed.

Note that this approach presumes, that the per RTP packet duration
(in samples) is the same for the last two packets of the stream being
replaced (the first one).

Sponsored-by: On-Waves ehf
2013-11-25 18:30:50 +01:00
Jacob Erlbeck d62419b574 mgcp/rtp: Add test case for RTP timestamp patching and stats
This patch adds a test case to check, whether RTP timestamps are
generated properly after SSRC changes and whether the error counters
work properly.

Sponsored-by: On-Waves ehf
2013-11-25 18:13:35 +01:00
Jacob Erlbeck 50079a1843 mgcp/rtp: Add counter for invalid RTP timestamp deltas
This patch modifies the patch_and_count() function to check for RTP
timestamp inconsistencies. It basically checks, whether dTS/dSeqNo
remains constant. If this fails, the corresponding counter is
incremented. There are four counter for this: Incoming and outgoing,
each for streams from the BTS and the net.

Note that this approach presumes, that the per RTP packet duration
(in samples) remains the same throughout the entire stream. Changing
the number of speech frames per channel and packet will be detected
as error.

In addition, the VTY command 'show mgcp' is extended by an optional
'stats' to show the counter values, too.

Ticket: OW#964
Sponsored-by: On-Waves ehf
2013-11-25 18:07:21 +01:00
Holger Hans Peter Freyther ec37bb2956 bsc: Add a VTY command to show the paging group for a BSC/IMSI 2013-11-22 16:00:00 +01:00
Jacob Erlbeck d9e4039516 rtp: Fixed size check in padded RTP packets
This patch fixes a corner case (padding 1, payload size incl padding
0) which is not being detected correctly.

Sponsored-by: On-Waves ehf
2013-11-21 20:00:55 +01:00
Holger Hans Peter Freyther 33b9641025 bsc: Use the right string for the notification 2013-11-15 16:47:59 +01:00
Holger Hans Peter Freyther 92ce02e644 rtp: Take the parameter from the arguments
$ gst rtp_replay.st -a FILE
2013-11-14 09:45:51 +01:00
Holger Hans Peter Freyther 558bdb4330 ipa: Explain that one needs to get the IP address of the BTS as argument 2013-11-11 14:30:09 +01:00
Holger Hans Peter Freyther 49976f4c1e shared: Introduce/Add procedure pending to the MO
GSM 12.21 specifies that "No elementary procedure shall be
initiated to an object instance which has not yet replied to
a previously initiated elementary procedure with a response,
an ACK or a NACK within a layer 3 time-out. The layer 3
timeout for ACK, NACK and responses shall have a default value
of 10 seconds."

We are using this flag in the BTS to enforce/safe-guard
this situation.
2013-11-05 16:06:17 +01:00
Holger Hans Peter Freyther 82e644b572 gbproxy: The "[stats]" option was not documented, document it
Documentation error (missing docs):
<command id='show gbproxy [stats]'>
        <param name='[stats]' doc='(null)' />
2013-11-03 17:34:17 +01:00
Jacob Erlbeck aff2d62b8c bsc/ussd: Rename bsc_send_ussd_notification()
Rename this function to bsc_send_ussd_no_srv() since it's a rather
specialised function and not a generic USSD notification function.

Sponsored-by: On-Waves ehf
2013-11-01 17:12:41 +01:00
Jacob Erlbeck b1250312ba bsc/ussd: Send faked CM Service Accept before sending USSD
The MS do not show the USSD messages yet. This patch modifies the
implementation to insert a CM Service Accept to finish the
establishment of the MM connection according to 3GPP TS 04.10/3.2.1
before the USSD notification is sent.

This fix has been tested with a Blackberry phone that has shown
an ussd_grace_txt after rf_locked has been set to '1'. Without this
patch, that message wasn't shown. The phone has sent a CC Setup
and other messages before processing the channel release message sent
by the BSC, but these messages have not been forwarded to the MSC (as
expected).

Ticket: OW#957
Sponsored-by: On-Waves ehf
2013-11-01 17:12:39 +01:00
Jacob Erlbeck 24d3b91d46 bsc: Move gsm48_tx_mm_serv_ack/rej to gsm_04_08_utils.c
These functions are currently located in libmsc/gsm_04_08.c together
with other symbols that (transitively) depend on many external
symbols (and thus libraries) that aren't otherwise needed by e.g.
osmo-bsc.

Since gsm48_tx_mm_serv_ack() will be needed by osmo-bsc, these
functions are moved to avoid the dependency on gsm_04_08.o.

Sponsored-by: On-Waves ehf
2013-11-01 17:12:37 +01:00
Holger Hans Peter Freyther 28e183f385 Revert "bsc/ussd: Send faked CM Service Accept before sending USSD"
This reverts commit 61bd965b04.

No, we should not link to dbi.. and these libraries..
2013-10-31 13:35:28 +01:00
Jacob Erlbeck 61bd965b04 bsc/ussd: Send faked CM Service Accept before sending USSD
The MS do not show the USSD messages yet. This patch modifies the
implementation to insert a CM Service Accept before the ussdNotify
to finish the establishment of the MM connection according to
3GPP TS 04.10/3.2.1.

This fix has been tested with a Blackberry phone that has shown
an ussd_grace_txt after rf_locked has been set to '1'. Without this
patch, that message wasn't shown. The phone has sent a CC Setup
and other messages before processing the channel release message sent
by the BSC, but these messages have not been forwarded to the MSC (as
expected).

Ticket: OW#957
Sponsored-by: On-Waves ehf
2013-10-31 13:29:51 +01:00
Jacob Erlbeck 6e919dbb65 vty: Enable the end/exit test for libosmocore nodes
This patch replaces the calls to ignoredCheckForEndAndExit by calls
to checkForEndAndExit to test the libosmocore nodes, too. The former
method is removed.

Sponsored-by: On-Waves ehf
2013-10-30 15:19:02 +01:00
Jacob Erlbeck 36722e13da vty: Use vty_install_default() instead of bsc_install_default()
Remove ournode_exit_cmd, ournode_end_cmd, and bsc_install_default()
since this functionality is provided by the current libosmocore.

Replace calls to bsc_install_default() by call to
vty_install_default() with the following semantic patch:

    @rule1@
    expression N;
    @@
    - bsc_install_default(N);
    + vty_install_default(N);

Ticket: OW#952
Sponsored-by: On-Waves ehf
2013-10-30 15:19:00 +01:00
Holger Hans Peter Freyther fc7a75f5df bts: Add a flag to remember the kind of activation/release
When the PCU is activating a channel we don't want to tell the
BSC using RSL. Add a flag so we can keep track of who asked for
the activation/release of the channel.
2013-10-25 18:58:30 +02:00
Jacob Erlbeck 64cb924634 gbproxy: Fix handling of NSEI changes
The gbproxy looses NSEI changes on BVC_RESET and then tries to send
later messages to the wrong (not longer existing) destination.

This patch fixes this by updating the peer's nsei field on BVC_RESET.

Ticket: OW#874
Sponsored-by: On-Waves ehf
2013-10-24 18:02:38 +02:00
Jacob Erlbeck 72b401f33d gbproxy: Add test for NSEI and NSVCI changes
This checks the behavior of the gbproxy when the BSS peer changes the
NSEI and the NSVCI. It also tests BVC_RESET and other UNITDATA
messages after these changes between BSS and SGSN and vice versa (via
the gbproxy).

Ticket: OW#874
Sponsored-by: On-Waves ehf
2013-10-24 18:02:36 +02:00
Jacob Erlbeck 4211d79cd1 gbproxy/vty: Enhance delete-gbproxy-peer command
This adds the option to delete all BVC peers and/or NS_VC with a
given NSEI with a single command. Static (configured) NS-VC are not
affected. In addition, all connections for this NSEI that can be
deleted by this command can be listed without deleting them by
appending 'dry-run' to the command.

Sponsored-by: On-Waves ehf
2013-10-24 18:02:33 +02:00
Holger Hans Peter Freyther 90267a961c gbproxy: Add a command to delete peers from the GBProxy
This just deletes the peer entry based on NSEI and BVCI. The NS-VC
are not touched.
2013-10-24 08:22:45 +02:00
Jacob Erlbeck 02ca7783ab gbproxy: Fix rate counter group leak in peer_free()
This also frees the counter group pointed to by peer->ctrg when the
peer gets freed.

Sponsored-by: On-Waves ehf
2013-10-24 08:22:45 +02:00
Jacob Erlbeck 6d23371805 gbproxy: Add basic VTY tests
This checks for the ns and gbproxy config nodes and show commands.

Sponsored-by: On-Waves ehf
2013-10-24 08:21:29 +02:00
Jacob Erlbeck 7587727445 vty: Fix whitespace in test script
Expands leading tabs and removes trailing whitespace.

Sponsored-by: On-Waves ehf
2013-10-24 08:21:22 +02:00
Jacob Erlbeck f0f63a4113 gbproxy: Reject SGSN UNITDATA messages with an invalid BVCI
Currently such messages lead to a creation of a new peer with the
SGSN's NSEI, which results in echoing the message back to the SGSN.

This patch modifies this by sending a STATUS response (invalid BVCI)
instead back to the SGSN.

Sponsored-by: On-Waves ehf
2013-10-19 12:10:24 +02:00
Jacob Erlbeck da890c7733 gbproxy: Test invalid BVCI from SGSN
This adds a test with a UNITDATA SGSN message that is addressed to an
invalid (unknown) BVCI. The test shows, that the message is echoed to
the SGSN.

Sponsored-by: On-Waves ehf
2013-10-19 12:10:21 +02:00
Jacob Erlbeck bc555742aa gbproxy: Add global and per peer counters
This adds counters that are incremented when errors are detected.
It also modifies the VTY command 'show gbproxy' so that
'show gbproxy stats' shows the counters.

Sponsored-by: On-Waves ehf
2013-10-19 12:10:19 +02:00
Jacob Erlbeck c5085f9d3d gbproxy: Fix warning and log message
Add the unused attribute to peer_free() that isn't used currently.
Change 'RAC' to 'NSEI' in the log message, since the latter has been
examined before the log message is generated.

Sponsored-by: On-Waves ehf
2013-10-19 12:10:16 +02:00
Jacob Erlbeck 2082afa76e gbproxy: Extended test program to simulate SGSN, too
This adds a simulation of the SGSN side of the Gbproxy. The VC is set
up correctly and several combinations of BSSGP messages are sent.

Sponsored-by: On-Waves ehf
2013-10-19 12:10:13 +02:00
Jacob Erlbeck e75fec60d0 gbproxy: Replace NS-VC references by NSEI
Currently in most places in gb_proxy.c a reference to a NS-VC object
is used where the peer is meant instead. The patch changes this by
using the NSEI instead in these cases.

Sponsored-by: On-Waves ehf
2013-10-15 15:19:29 +02:00
Jacob Erlbeck 51a869c80c gbproxy: Add test program to test gbproxy message handling
This program tests the gbproxy implementation by passing NS messages
to a modified gbproxy that dumps the resulting messages, signals, and
state.

It focusses on testing abnormal situations like port changes.

Ticket: OW#874
Sponsored-by: On-Waves ehf
2013-10-15 15:10:22 +02:00
Alexander Huemer 475f513aea ussd: Fix test for RELEASE COMPLETE
A correcsponding change in libosmocore sets text[0] to '\0'.
The test for 0xFF could never have been true.
2013-10-15 13:29:25 +02:00
Holger Hans Peter Freyther 8c90f47b09 misc: Require libosmocore 0.6.4 and libosmogb 0.6.4 2013-10-15 13:29:25 +02:00
Holger Hans Peter Freyther 7634ec1de1 db: Remove the struct gsm_network from the database layer
The database code should not know about the network. Move the
setting of the network pointer into the subscriber layer.
2013-10-13 13:44:54 +02:00
Alexander Chemeris 0c48fc7c62 abis: Consistent usage of LOGP/DEBUGP for "RSL CONNECT NACK" 2013-10-08 11:29:44 +02:00
Holger Hans Peter Freyther caa98d51b6 osmo-bts: Kill the different ROLE_BSC as e1inp_sign_link is used now 2013-10-06 15:52:14 +02:00
Alexander Chemeris bd6d40f1fb nitb: Add "subscriber create" VTY command.
It may be useful in production, but it's really required for
VTY testing of subscriber related commands.
2013-10-05 10:27:47 +02:00
Alexander Chemeris 4ad593c8f6 sms: Possiqble meamleak fix gsm340_rx_tpdu()
Slight clean up of the code in gsm340_rx_tpdu() and a fix for
an unlikely, but possible memory leak there.
2013-10-04 08:18:32 +02:00
Alexander Chemeris a3d41c9124 Fix typo in console output: "PEROIDOC" -> "PERIODIC". 2013-10-04 08:18:14 +02:00
Alexander Chemeris 8c16928beb Fix typo ',' -> ';' at the end of a line.
Funny, this is a correct C expression and doesn't change execution, thus it
stayed unnoticed for quite a while.
2013-10-04 08:18:01 +02:00
Alexander Chemeris 86d46c5c7a Fix copy-paste error in console output in db_test. 2013-10-04 08:17:52 +02:00
Jacob Erlbeck cc391b8880 bsc: Add control command to set timezone
This adds a per BTS control command 'timezone' which expects a value
of the format '<hours>,<mins>,<dst>' or 'off' to set the value of
bts->tz. It has the same functionality like the existing VTY command
'timezone' in network/bts.

Sponsored-by: On-Waves ehf
Ticket: OW#978
2013-10-01 17:25:44 +02:00
Holger Hans Peter Freyther 55e34a3325 smpp: Fix the make distcheck for smpp
DISTCHECK_CONFIGURE_FLAGS="--enable-smpp" make distcheck
2013-09-19 11:08:43 +02:00
Holger Hans Peter Freyther cb78612689 nat: Fix make distcheck for the nat
The jenkins runs make distcheck in the default configuration and
not with the nat enabled.

DISTCHECK_CONFIGURE_FLAGS="--enable-nat" make distcheck
2013-09-19 11:01:14 +02:00
Jacob Erlbeck 946d1415c2 bsc/mminfo: Patch timezone and DST in MM Info messages
This adds in-place patching of the time information in the
MM INFORMATION message. The timezone in the 'Local time zone' and
the 'Universal time and local time zone' information elements
and the offset in the 'Network Daylight Saving Time' information
element are optionally set.

The new values are determined by the 'timezone' vty command in the
config_net_bts node. That command is extended by an optional
DST offset parameter.

Tests are provided for the vty part and for the plain
bsc_scan_msc_msg() function.

Sponsored-by: On-Waves ehf
Ticket: OW#978
2013-09-19 10:57:13 +02:00