Commit Graph

3766 Commits

Author SHA1 Message Date
Harald Welte 135a6bd3c6 gsm_data_shared: add some fields for voice support of sysmo-bts 2011-09-04 13:53:26 +02:00
Harald Welte ab386e6120 Add VTY command to specify default speech codec
In order to have the MNCC application reliably decide on the codec type,
it needs to know if we are running on a TCH/F or TCH/H.  Thus, we pass
lchan_mode as a new parameter to the 'struct gsm_mncc'
2011-09-03 18:23:20 +02:00
Dieter Spaar 6b353778c4 bsc_api: Make sure to use correct MS Power on ASSIGNMENT CMD
When gsm48_send_rr_ass_cmd() is being called to send the ASSIGNMENT
COMMAND, we need to use the propwer lchan->ms_power setting, not
some fixed magic "0x3" number.

Without this patch, every MS would transmit at a very high output power
fullowing an assignment command - more than what was set in the config
file with "ms max power"
2011-09-03 14:11:24 +02:00
Holger Hans Peter Freyther cab0d7bedc bsc: Fix a crash in case we get a NACK from the BTS for a new channel
In case of a nack the secondary_lchan will be NULLed but then the T10
timeout will attempt to release the channel and we will try to release
a NULL pointer.

Daniel witnessed this crash at the camp and added the NULL check at:
28d9ccbca0, it is also the proper fix
given the _NAK handling.
2011-08-30 19:13:22 +02:00
Harald Welte b4d913d336 BTS support: nokia/ericcson - use e1inp_ts->lapd
the lapd member has moved from the .driver.dahdi.lapd to the more
generic lapd location inside 'struct e1inp_ts'
2011-08-26 19:14:55 +02:00
Harald Welte 0eae6136e2 add missing #include line to gsm_data_shared.h
gsm_data_shared.h references structures defined in abis/e1_input.h
2011-08-24 13:52:07 +02:00
Harald Welte f7a2b19771 Revert "we don't have openbsc/ipaccess.h anymore"
This reverts commit 8697e43bb2.
2011-08-23 16:00:22 +02:00
Harald Welte 90dc4679e1 add missing ipaccess.h to Makefile.am 2011-08-23 16:00:21 +02:00
Harald Welte bc56b0b771 add control_cmd.h to Makefile.am 2011-08-23 16:00:21 +02:00
Daniel Willmann a90eb0066a osmo-bsc: Use NM_OPSTATE_* to check for operational attributes 2011-08-22 23:46:01 +02:00
Holger Hans Peter Freyther 05ac9e365c libctrl: Add a function to create the cmd 2011-08-22 23:45:57 +02:00
Daniel Willmann 9cc771bd3d libctrl: Don't overwrite error reply if the verify function sets one 2011-08-22 23:45:56 +02:00
Daniel Willmann 5763093285 libctrl: Mark the cmd set/get/verify functions static 2011-08-22 23:45:56 +02:00
Daniel Willmann bc076ae53b libctrl: Bind control interface to localhost 2011-08-22 23:45:56 +02:00
Holger Hans Peter Freyther 4ad44249c3 libctrl: Use DCTRL as logging destination in libctrl 2011-08-22 23:45:56 +02:00
Daniel Willmann e54db171ee nat: Fix error in get_next_free_bsc_id
The new function now mimcis the behaviour of
assign_src_local_reference from bsc_sccp.c
2011-08-22 23:45:56 +02:00
Daniel Willmann 7c3298af9e contrib/bsc_control.py: Patch by Holger to handle connection resets 2011-08-22 23:45:56 +02:00
Holger Hans Peter Freyther 80c37bd806 bsc: Fix crash that can occur on RF Failure
When we got a clear request we did not clear the internal
association between the gsm_subscriber_connection and the SCCP
part. When we got a DTAP message before the CLEAR COMMAND we
will end up in a crash as the ->bts pointer of the connection
has been cleared.

 #0  bsc_scan_msc_msg (conn=0xde178, msg=<value optimized out>) at osmo_bsc_filter.c:258
 #1  0x000112c8 in bsc_handle_dt1 (conn=0xdebd8, msg=0xd1f58, len=<value optimized out>) at osmo_bsc_bssap.c:507
 #2  0x00010208 in msc_outgoing_sccp_data (conn=<value optimized out>, msg=0xdfacc, len=858696) at osmo_bsc_sccp.c:73
 #3  0x0003c110 in sccp_system_incoming (msgb=0xd1f58) at sccp.c:1064
2011-08-22 18:26:48 +02:00
Holger Hans Peter Freyther 594b322a4e audio: Move the setting of MultiRateConfig to one place
Move it to one place so it is more easy to make changes to
that.
2011-08-22 18:24:07 +02:00
Holger Hans Peter Freyther ed999b29bc audio: From RTP point of view we can use one payload for HR/FR AMR
Remove the separation of half-rate and full-rate AMR. The used rate
can be found inside the AMR payload. The signalling of what kind of
traffic channel is used can be done with the GSM 08.08 Chosen
Channel IE in the Assignment Complete message.

This way I can use a fixed payload type in the MGCP GateWay but
have a mixed TCH/F and TCH/H config. E.g. use TCH/F FR3 for some
subscribers when connected to MSC A but use AMR5.9 on a TCH/F for
MSC B when all TCH/Hs are gone.
2011-08-22 18:23:50 +02:00
Holger Hans Peter Freyther 128892f55f audio: Remove the hardcoding of the RTP Payload
The MGCP config must be correct and use 99 for RTP AMR.
2011-08-22 18:22:44 +02:00
Holger Hans Peter Freyther 3488c3ddc4 mgcp: Make CRCX deal better with UDP retransmissions
When the CRCX 200 is lost on the way to the CallAgent we will
get another CRCX (retransmission) which was answered with a 400.

Change the code to extract the CallID, Mode and the optional
LocalOptions first. Then check if the endp is allocated with the
same call identifier, in that case return the current session
information.
2011-08-22 18:22:15 +02:00
Holger Hans Peter Freyther c7e49d35ea mgcp: FreeSWITCH requiresn us to provide the o= and t= param
The SDP file for FreeSWITCH should contain o= (Origin) and the
t= (Timing) for the session. The data of the Origin should be
globally unique but this is not the case yet. We will need to
store the (NTP) time of the creation of the endpoint.
2011-08-22 18:21:56 +02:00
Holger Hans Peter Freyther 06c9da6c22 misc: Move the bsc_parse_reg to libcommom and name it gsm_parse_reg
Move the regexp parsing code from the NAT to libcommon as it will
be used by the NAT and BSC code. This also adds the #include <regex.h>
include to gsm_data. This header should be split up.
2011-08-22 18:21:33 +02:00
Harald Welte 8697e43bb2 we don't have openbsc/ipaccess.h anymore 2011-08-20 18:10:18 +02:00
Pablo Neira Ayuso ed5cacb240 src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.

The main changes are:

- The directory libabis/ has been removed as it now lives in
  libosmo-abis.

- new configuration file format for nanoBTS and HSL femto, we
  need to define the virtual e1_line and attach it to the OML
  link.

- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
  BS11 and rbs2000) now use the new libosmo-abis framework.

- use r232 input driver available in libosmo-abis for bs11_config.

- use ipa_msg_recv instead of old ipaccess_read_msg function.

- delete definition of gsm_e1_subslot and input_signal_data.
  These structures now lives in libosmo-abis.

Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.

This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:

- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node

This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-19 22:38:35 +02:00
Pablo Neira Ayuso 7abecfcfc9 src: use new msg->dst pointer instead of deprecated msg->trx
This patch modifies openBSC code to use msg->dst which stores the
pointer to the signalling link structure instead of the pointer to
the transceiver structure.

This patch prepares the introduction of libosmo-abis.
2011-08-19 22:38:33 +02:00
Harald Welte c45a8045a6 bssgp: make comments more explicit, include 'Rx' in received messages 2011-08-19 16:45:19 +02:00
Harald Welte 7fad70c198 Merge branch 'master' of git.osmocom.org:openbsc 2011-08-19 16:44:00 +02:00
Holger Hans Peter Freyther 013ae46ef6 bsc: Crash fix for the osmo-nitb/MNCC code
It is possible that MNCC sends a MNCC_LCHAN_MODIFY and
wants a channel mode that is not possible on the current
lchan, in that case a new channel is assigned. We now crash
as the osmo-nitb is not having an assignment complete handler,
add a NULL check.
2011-08-13 22:53:53 +02:00
Daniel Willmann fc462dd59e libbsc: Log if a channel is freed with lchan->state != LCHAN_S_NONE
I'm not sure if that is an abnormal condition or not, but it seems
that lchan state and type have to be none for the lchan to be
considered idle.
2011-08-11 17:21:24 +02:00
Daniel Willmann 6fc6a12c07 libbsc: Cosmetic fix for the channel activate NACK log message 2011-08-11 17:21:24 +02:00
Daniel Willmann 7ddc318687 libbsc: Release the RF channel if BTS thinks it's still in use
The Nokia metrosite BTS seem to keep the channels open indefinitely.
If osmo-nitb is restarted while one of the channel was still active
and tries to activate that channel again the bts would return a
CHANNEL ACTIVATE NACK with "Radio channel already activated". This
accumulated over the restarts so soon enough no more channels were
available.

This patch sends a release request to the bts so the channel
becomes available again.
2011-08-11 17:21:24 +02:00
Daniel Willmann 513da17732 libbsc: Call lchan_free in the timeout callbacks
This makes sure that the lchans can be used again. (state and type
are set to NONE)
2011-08-11 17:21:24 +02:00
Jan Luebbe 563d99d3c3 libbsc: Only skip lchans with state AND type set to NONE in show lchan
The function lchan_alloc only considers lchans to be available if both
the type and state are NONE. So change show lchan to list all lchans
 that are not considered available.
2011-08-11 17:21:24 +02:00
Peter Stuge 46f799b224 MNCC: Never send zero-length msgb packets to the socket
This will cause the remote end to read 0 bytes, which is interpreted as
if we cleanly closed the socket, making the remote end close their side
of the socket, which would lead to us closing our side of the socket,
so we should never send such a packet.
2011-08-11 17:21:24 +02:00
Harald Welte e8bd9e885d RSL: add timer for lchan activation/deactivation without BTS response
The timer callback will simply reset the lchan state to NONE in order
to prevent channels getting stuck in 'activation requested' or
'deactivation requested' states.
2011-08-11 17:21:23 +02:00
Harald Welte 5da9b52d06 DAHDI: Actually increment e1_input related rate counters 2011-08-11 13:00:12 +02:00
Harald Welte c21aa18e35 E1 Input: better names for rate counters 2011-08-11 13:00:07 +02:00
Harald Welte 0000ca5885 E1 Input: Add rate counters for events related to E1 lines 2011-08-11 12:59:57 +02:00
Harald Welte 986926ebde E1 Input: Move 'show e1_*' command to e1_input_vty.c 2011-08-11 12:59:54 +02:00
Harald Welte 4da5592c46 E1 Input: Add VTY command to specify the name of a Line
So far, there was no way to set the line->name field at all.
2011-08-11 12:59:50 +02:00
Daniel Willmann 28d9ccbca0 libbsc: Don't free secondary lchan if it is NULL. 2011-08-10 13:40:39 +02:00
Pablo Neira Ayuso f7dc7614c2 trau: fix wrong message size for GSM_TCHF_FRAME passed to MNCC
During the GSM deployment in the CCC Camp, Daniel Willmann
noticed that the LCR and the MNCC were closing the local
connection over unix sockets communication quite so often.

After some debugging, Peter Stuge noticed that openBSC was
closing the connection since write was returning 0.

Then, I suggested that it could be a malformed message with
zero length. By skipping empty messages, Peter confirmed that
the connection between the LCR and the MNCC was not closing
anymore. However, there was no voice in the calls that went
over MNCC.

After some more debugging I found that we were not building
GSM_TCHF_FRAME over MNCC appropriately in the TRAU multiplexer
code, since we forgot to msgb_put() the message.
2011-08-10 13:40:35 +02:00
Pablo Neira Ayuso 2962c20f73 NOKIA: Resend SABM on unknown TEI from LAPD 2011-08-10 10:51:02 +02:00
Pablo Neira Ayuso cd98656315 LAPD: Propagate lapd_receive() errors to the E1 driver
Scenario: BTS are configured and working, then the BSC stops working
for some reason (crash or administrative stop).

If the BSC comes back to life, LAPD among other things does not know
about the previous existing TEIs. Instead of ignoring these frames,
we notify the driver that we are seeing frames with unknown TEIs, so
it can try to recover, e.g. by resending the SABM message.
2011-08-10 10:51:02 +02:00
Harald Welte 1045697c34 Fix MNCC for the NOKIA BTS type
(thanks to Gus Bourg)
2011-08-10 10:51:02 +02:00
Harald Welte 44d26113bc NOKIA: use 'struct value_string' whenever possible 2011-08-10 10:51:02 +02:00
Harald Welte 3c3003f703 NOKIA: use 'value_string' for severity and bts_type 2011-08-10 10:51:02 +02:00
Harald Welte c8755af8a5 NOKIA: Move more static variables into 'struct gsm_bts' 2011-08-10 10:51:01 +02:00