Commit Graph

3247 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 2e8e659586 mgcp: Remember the initial sequence number of the stream
This information is required for calculating the packet loss at the
end of a phone call.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther 952f752ffa mgcp: Count the received octets as of the MGCP specification
Count the received octets. This is encouraged by the MGCP specification.
Use a 32bit counter that is good enough for more than 12 hours of a EFR
call. This limit is good enough for the current configuration.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther 2a60a11c48 mgcp: Remove the lost_no from the mgcp statistics
The RFC 3435 specifies a different formula for calculating the lost
packages. It involves the number of received packages and the delta
of the sequence number.
2012-11-12 10:42:05 +01:00
Holger Hans Peter Freyther de1674ab02 bts: Really drop the BTS in case of an OML NACK
The previous code didn't work as expected. The trx and dst pointer
are located in an union and in the case of the Abis code the dst
is used to point to the signalling link timeslot and not the TRX.

The is_ipaccess_bts always returned false because the dst was casted
to a trx while it was no trx.

This fix was tested with the nack_test/NACKTest.st of the test repo.
2012-11-11 18:33:17 +01:00
Holger Hans Peter Freyther 75172124e7 sms: Re-order the include files after the separationf OpenBSC and osmocore 2012-11-11 18:33:09 +01:00
Holger Hans Peter Freyther 3dfe8a1705 nat: sizeof char * != sizeof char[], make the code work on 64bit systems
The test cases were failing on 64bit systems because the sizeof
code operated on the pointer size which is 8 and longer than the
size that was intended to be used for comparing it.
2012-11-07 13:35:14 +01:00
Holger Hans Peter Freyther e2f34d588c nat: Inject a a=fmtp:%d to force the right AMR code
This assumes that AMR is used and/or the mode-set is ignored for other
codecs by the remote end.
2012-11-07 13:34:43 +01:00
Holger Hans Peter Freyther e600eed7fa debian: Move debian directory to ease building packages
This is required to have git-buildpackage be able to create tarballs
from the git repository and was done by Jan in the debian branch as
well.
2012-11-06 23:01:43 +01:00
Holger Hans Peter Freyther 6b55f603e3 sms_queue: It is a bad idea to detach a subscriber on failed delivery
It is a bad idea to detach a subscriber. The subscriber will not
be reachable until the next periodic updating cycle. In case we have
too many failed deliveries we will need to reduce the period for the
LU and implement a subscriber purging task.

This is a preparation for the 29C3 and a problem Jolly experience with
his type writer system.
2012-11-02 17:23:05 +01:00
Holger Hans Peter Freyther 7456891439 mgcp: Fix the log message. This is inside the MDCX printing routine 2012-10-30 11:22:21 +01:00
Holger Hans Peter Freyther cb3c2c95bf nat: Make MGCP helper routine static as it is internal to the MGCP code 2012-10-29 19:41:51 +01:00
Holger Hans Peter Freyther 07fc097fc4 nat: Document the high level goal of the MGCP/NAT routines
Provide some high level documentation that might help to understand
what this code is supposed to be doing.
2012-10-29 19:41:37 +01:00
Tobias Engel aff20717e4 Set byte order defines when compiled on OSX
Byte order defines have a DARWIN prefix on OSX so the values openbsc
expects are set from their Darwin counterparts when compiled on OSX.
2012-10-27 10:09:21 +02:00
Holger Hans Peter Freyther 511f9c3e4a si: Partially implement the range encoding for the SI.
I saw the old copy of the "Appendix J" code too late and I have
discovered some quirks and I am more familar with my implementation.
Most noticable 'w' only needs to be as big as the input arfcn but
requires the 'w' to be initialized. The power_of_2 implementation
differs as well (mine matches the output of wirehsark).

The f0 could be chosen in a better way but right now picking
the lower bound is the easiest. It is not clear if to use
modulo if the range is chosen in the middle. This can be improved
in the future. Right now I have no bit fiddling for range128, 256
and 1024 as I was running out of time.
2012-10-22 15:23:58 +02:00
Pablo Neira Ayuso d49eb74732 libbsc: fix message leaks on several error paths
This patch fixes several leak of msgbs in uncommon error paths.

Add break at the end of default to make Holger and Peter happy ;-)
2012-10-18 19:04:40 +02:00
Andreas Eversberg 2ee7ecddeb Allow setting of Control Channel Description parameters via VTY 2012-10-18 12:01:32 +02:00
Holger Hans Peter Freyther 94c2b0578b bsc: Do not print "SI 18" but SI2ter when the SI generation fails 2012-10-09 11:54:00 +02:00
Harald Welte c15d0ac8dd SI13: Set alpha value to a safer default of 0 instead of 10
alpha=0 (the new value) doesn't reduce MS transmission power during GPRS
as much as we did with alpha=10.  This is to optimize for coverage and
to keep GPRS working at all cost, and not care about MS battery life
time or uplink interference in surrounding cells.

FIXME: This should be made configurable via the VTY and the normal
default (unless configured otherwise by vty/config file) should be '6'.
2012-10-08 21:22:08 +02:00
Harald Welte d9173c3fce bsc_init: Don't drop all BTSs because a single BTS had an error 2012-10-08 21:17:51 +02:00
Holger Hans Peter Freyther 8936d00587 tests: Remove the debug/logging test as it is in libosmocore now 2012-10-04 10:55:58 +02:00
Andreas Eversberg becc89a98e Fix: T3192 and T3193 must be similar
In order to keep mobile at PACCH as long as possible the timer T3192 is
set to 1500ms. This reduces the probablity of long lasting assignment
process on CCCH for subsequent downlink TBFs.
2012-09-29 20:29:16 +02:00
Holger Hans Peter Freyther 778695d0b4 mgcp: Add the disable color option to the mgcp binary 2012-09-20 16:06:56 +02:00
Holger Hans Peter Freyther 221ff66327 systemd: Add service units for the BSC, NITB and MGCP
Add simple systemd service units.
2012-09-20 16:06:56 +02:00
Harald Welte bf0a7c97be nncc_builtin: send CHAN MODE MODIFY after CALL PROCEEDING
This is specified in fifugre 7.10c of 3GPP TS 04.08.
2012-09-19 11:47:49 +02:00
Holger Hans Peter Freyther 34203bd487 abis_nm: Provide a reason when an invalid channel configuration is used
Provide a human readable reason the channel combination is not allowed.
2012-09-17 17:24:49 +02:00
Holger Hans Peter Freyther 9ceea68ba9 abis_nm: Log an error when the channel combination can not be set. 2012-09-17 14:21:53 +02:00
Holger Hans Peter Freyther 31b245b91a bsc: Add vty code for allowing emergency 2012-09-11 18:01:52 +02:00
Holger Hans Peter Freyther cbaa880ae8 bsc: Add vty function for the MSC type 2012-09-11 18:01:52 +02:00
Holger Hans Peter Freyther 18fa70aa3a bsc: Look for CM Service Requests with emergency cause
Look for emergency calls and send them to a MSC that can
handle them properly.
2012-09-11 18:01:52 +02:00
Holger Hans Peter Freyther 210565ed8c bsc: Introduce a local MSC type and forbid it from being selected 2012-09-11 18:01:52 +02:00
Holger Hans Peter Freyther c11889f3dd Merge branch 'feature/multiple-msc-connections' 2012-09-11 18:00:59 +02:00
Holger Hans Peter Freyther f67d9a9bed bsc: Attempt to respond to paging to the MSC that paged
Inspect the message and see if it is a paging response,
then try to find the MSC that has paged this subscriber
and select this as the target MSC, also move the MSC to
the back of the list for 'load balancing'.
2012-09-11 17:48:01 +02:00
Holger Hans Peter Freyther 644b0bf3da bsc: Hand the msc_connection to the UDT handling, pass it to paging
Pass the osmo_msc_data to the paging sub system, change the code
to pass the osmo_msc_data instead of network + bsc_msc_conn.
2012-09-11 17:47:42 +02:00
Holger Hans Peter Freyther 076af1c54b bsc: Move the finding of a MSC into the filter code
For responding to paging on the right link we will need to
figure out if the msg is a paging response.
2012-09-11 17:47:30 +02:00
Holger Hans Peter Freyther 354c87cdfc bsc: Select a MSC in a round-robin fashion
Select a MSC, add it to the back of the list after we have
selected it.
2012-09-11 17:47:08 +02:00
Holger Hans Peter Freyther 8b902d74cf bsc: Allow to configure more than one MSC in the VTY 2012-09-11 17:47:01 +02:00
Holger Hans Peter Freyther 8c176cc6ab msc: Only kill connections belonging to the given MSC
When a MSC connection drops, only kill the connections that
belong to the given MSC and not all other connections.
2012-09-11 17:46:54 +02:00
Holger Hans Peter Freyther ffd6856249 gbproxy: Address two unaligned memory access warnings
The lines 461 and 303 were producing unaligned memory access as
the BVCI was not aligned properly. Introduce a tlvp_val16_unal to
read 16bit from the data, use memcpy to the stack to make sure
that it is working in the aligned and unaligned case.
2012-09-11 16:23:31 +02:00
Daniel Willmann 7a7c2f8567 osmo-bsc: Command bts_connection_status with TRAPS 2012-09-11 16:20:46 +02:00
Daniel Willmann 806d6549f8 osmo-bsc: Introduce command msc_connection_status and send TRAPs for it 2012-09-11 16:20:46 +02:00
Daniel Willmann 6dc6910b79 nat: Change the ctrl command path
The commands net.<netid>.bsc.<bscid>.* are now forwarded to the
appropriate osmo-bsc. <netid> for now is just 0. <bscid> is not the LAC
anymore (since that could be ambiguous), but instead the number as
configured in bsc-nat.cfg
2012-09-11 16:20:46 +02:00
Daniel Willmann 6088f149b5 libctrl, osmo-bsc: Get rid of net prefix
net is now implicit in the root node
2012-09-11 16:20:46 +02:00
Daniel Willmann 65924a5fe8 osmo-bsc: Include rf statistics in the location-state TRAP as well
The first fields are still the location up to the height.
The next field is "operational" if any of the trx are operational,
otherwise "inoperational"
The second to last field contains "locked" if all of the trx are in the
admin state, otherwise "unlocked".
The last field represents the rf policy currently in effect. It is one
of (on|off|grace|unknown).

<tstamp>,<valid>,<lat>,<lon>,<height>,<oper>,<admin>,<policy>
2012-09-11 16:20:45 +02:00
Daniel Willmann 11620111f4 osmo-bsc: Prepare to send more than just the location in the TRAP 2012-09-11 16:20:45 +02:00
Daniel Willmann d08ad7d6d9 ctrl: Use strtol instead of atoi to detect conversion errors 2012-09-11 16:20:45 +02:00
Daniel Willmann ebe22375a6 ctrl: Improve error messages in ctrl_cmd_handle 2012-09-11 16:20:45 +02:00
Daniel Willmann 7aa4f0a263 ctrl: Change the paths to bts.%i. instead of bts%i 2012-09-11 16:20:45 +02:00
Holger Hans Peter Freyther fa0ec157af ctrl: Do not allow to set the RF Lock for a single trx
The ip.access nanoBTS has issues if the admin changes are called
too often in too little time. This will lead to a situation where
the site manager will fail to start properly. Remove the TRX code
as the RF Control class does not support setting this per TRX.
2012-09-11 16:20:45 +02:00
Daniel Willmann a5352a0174 osmo-bsc: Change variable name to better reflect current/last location 2012-09-11 16:20:37 +02:00
Daniel Willmann 47b5b3eeb2 gsm_data: Include a structure for the geographical location in gsm_bts 2012-09-11 15:22:00 +02:00
Daniel Willmann 5e95f45af0 ctrl: Improve error handling if controlif setup fails 2012-09-11 15:20:55 +02:00
Daniel Willmann 5ff06af6f5 osmo-bsc: Put the control commands in osmo_bsc_ctrl.c 2012-09-11 14:53:51 +02:00
Daniel Willmann d5eb431c47 osmo-bsc: Only send a TRAP if the location changes 2012-09-11 14:46:48 +02:00
Daniel Willmann adcde9f8f5 osmo-bsc: Add support for traps to the location command 2012-09-11 14:43:27 +02:00
Daniel Willmann 47824541f0 osmo-bsc: Allow location tstamp to be zero if fix is invalid 2012-09-11 13:10:38 +02:00
Daniel Willmann ad2946ce03 osmo-nitb: Update control interface API in osmo-nitb 2012-09-11 13:10:18 +02:00
Daniel Willmann d79da3baac nat: Add support for traps to the nat 2012-09-11 13:09:03 +02:00
Daniel Willmann 721f0325b5 libctrl: Add function ctrl_cmd_send_to_all
Sends a command to all ctrl connections except the one it originated
from.
2012-09-11 13:08:48 +02:00
Daniel Willmann 114a010c33 libctrl: Add trap helper function 2012-09-11 13:05:30 +02:00
Daniel Willmann 6fc4a98fc5 libctrl: Change controlif_setup so it returns the ctrl handle
nat: Catch up with controlif_setup API change
We now save a control handle reference in the nat
osmo-bsc: Catch up with controlif_setup API change
We now save a control handle reference in the gsm network
2012-09-11 12:52:23 +02:00
Daniel Willmann f3b31eb349 libctrl: Keep track of connections in struct ctrl_handle 2012-09-11 12:43:40 +02:00
Holger Hans Peter Freyther 4dd84ff7c2 bts_hsl_femtocell.c: Use PRIx64 to printf the uint64_t
bts_hsl_femtocell.c: In function ‘hsl_sign_link_up’:
bts_hsl_femtocell.c:206:3: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint64_t’ [-Wformat]
bts_hsl_femtocell.c:210:2: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘uint64_t’ [-Wformat]
2012-09-11 12:41:23 +02:00
Holger Hans Peter Freyther 8c3d0695e4 mgcp_network.c: Address compiler warning on return
When adding the "omit RTCP" the method started to return with
a proper return statement.

mgcp_network.c: In function ‘send_to’:
mgcp_network.c:233:1: warning: control reaches end of non-void function [-Wreturn-type]
2012-09-11 12:41:23 +02:00
Holger Hans Peter Freyther d98136d25c bsc_init: Initialize rc on all paths to address a compiler warning
bsc_init.c:203:6: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
bsc_init.c:101:6: note: ‘rc’ was declared here
2012-09-11 12:41:23 +02:00
Holger Hans Peter Freyther a5050b14c9 misc: Address compiler warning on unused variables
abis_nm.c: In function ‘abis_nm_get_attr’:
abis_nm.c:1380:11: warning: unused variable ‘cur’ [-Wunused-variable]

abis_nm.c: In function ‘ipac_parse_bcch_info’:
abis_nm.c:2588:11: warning: variable ‘len’ set but not used [-Wunused-but-set-variable]

bts_nokia_site.c:1310:6: warning: variable ‘constructed’ set but not used [-Wunused-but-set-variable]
bts_nokia_site.c: At top level:
bts_nokia_site.c:1364:12: warning: ‘dump_elements’ defined but not used [-Wunused-function]

gsm_04_08.c: In function ‘mm_rx_loc_upd_req’:
gsm_04_08.c:521:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]

osmo_msc.c: In function ‘msc_ciph_m_compl’:
osmo_msc.c:122:7: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]

bts_hsl_femtocell.c: In function ‘hslfemto_bootstrap_om’:
bts_hsl_femtocell.c:101:11: warning: variable ‘cur’ set but not used [-Wunused-but-set-variable]

bts_hsl_femtocell.c: In function ‘hsl_drop_oml’:
bts_hsl_femtocell.c:232:21: warning: variable ‘line’ set but not used [-Wunused-but-set-variable]

handover_logic.c: In function ‘ho_chan_activ_ack’:
handover_logic.c:197:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
2012-09-11 12:41:23 +02:00
Holger Hans Peter Freyther 86f240aded gsm_data: Address compiler warning of unhandled switch
gcc does not really know the _NR_OF_ELEMENTS_IN_ENUM approach, add
the _NUM_GSM_BTS_TYPE to the handled cases.

gsm_data.c: In function ‘gsm_set_bts_type’:
gsm_data.c:349:2: warning: enumeration value ‘_NUM_GSM_BTS_TYPE’ not handled in switch [-Wswitch]
2012-09-11 12:41:22 +02:00
Harald Welte 79c34ffb4f OM2000: don't silently send CON/IS/TF configuration request 2012-09-07 20:15:50 +02:00
Harald Welte 4c889a5c49 RBS2000: Don't sent IS configuration if we want to config TF 2012-09-07 20:14:47 +02:00
Harald Welte 0818f31144 OM2000: make sure to route messages to IXU/DXU over BTS oml link
Messages to CF and other core objects need to go to the BTS (IXU/DXU)
OML link, not to the OML link of the primary TRX!
2012-09-07 19:10:47 +02:00
Harald Welte 240a828ffd OM2000: don't signal operational state for a unknown MO
This case happens if the BTS signals operational state for a TRXC which
is not configured as TRX in the openbsc.cfg
2012-09-07 19:10:47 +02:00
Holger Hans Peter Freyther 037065deee contrib: Add some SQL statements to remove old subscribers 2012-09-07 19:09:10 +02:00
Harald Welte e422798866 RSL: Add basic support for CSD transparent mode
We now have a lchan->csd_mode member that determines if RSL should
activate the channel in CSD transparent services or not.  The previous
code always assumed CSD is non-transparent.

(This requires libosmocore >= eed26116c96f03c6128fac3dead9054714af6cab)
2012-08-29 16:33:54 +02:00
Harald Welte bb53e3577a reimplement chan_compat_with_mode() to take care of CSD 2012-08-29 16:33:54 +02:00
Harald Welte 9fc70f365a bsc_api: Invert logic of chan_compat_with_mode()
A function called this  way should return 1 if it is compatible, so
something like "if (!chan_compat_with_mode())" will check if it is not
compatible.
2012-08-29 16:33:53 +02:00
Eric Butler 6fcac63cc0 Add init script to osmocom-sgsn package. 2012-08-26 20:09:55 +02:00
Eric Butler b561459dd6 osmocom-nitb debian package improvements.
* Don't enable MNCC sock by default.
* Create important directories.
* Fix init script 'stop' command.
2012-08-26 20:09:55 +02:00
Eric Butler 6e7d137e79 Start osmocom-nitb with HLR path and RTP proxy enabled (debian package). 2012-08-26 20:09:55 +02:00
Eric Butler 3d610e63cc Fix init script. 2012-08-26 20:09:55 +02:00
Eric Butler dd68fcaeee Fix libdbi package dependency 2012-08-26 20:09:55 +02:00
Eric Butler 010c9551ff Use package version since git info won't be available. 2012-08-26 20:09:54 +02:00
Eric Butler a73ca05db6 Update debian package. 2012-08-26 20:09:54 +02:00
Harald Welte 570ce24deb VTY: improve VTY prompt and make sure exit/end works everywhere
Some nodes below 'config' didn't have ournode_exit / ournode_end,
and thus were not able to properly perform this function.  exit should
always only go back one level, while end drops us back to ENABLE_NODE.

The prompt now represents the nesting level, and there's one consistent
space after the final prompt character (typically #).
2012-08-17 13:16:10 +02:00
Harald Welte e555c2b545 VTY: dynamically create BTS "type" command syntax 2012-08-17 13:02:12 +02:00
Harald Welte 57e0724ed4 BSC VTY: use numeric ranges for bts/trx/timeslot numbers
This effectively limits the number of BTSs to 256, but I think that's
acceptable for now.  Unfortuantely there's no decent way to dynamically
update the valid number range depending on how many BTSs are actually
configured in the system :/
2012-08-17 12:50:14 +02:00
Harald Welte 4ab9d7c012 dynamically generate a proper VTY reference for phys_chan_config
this uses vty_cmd_string_from_valstr() from _very_ recent libosmocore,
so you have to update the library, sorry.
2012-08-17 12:42:06 +02:00
Harald Welte 13fe21939c ... and more VTY help fixes 2012-08-17 09:57:25 +02:00
Harald Welte d13e0cd6db Some more VTY documentation / help fixes 2012-08-17 09:52:03 +02:00
Harald Welte cfaabbb21e complete the VTY help messages so we don't get "null" in the manual 2012-08-16 23:23:50 +02:00
Harald Welte fe568f235f abis_nm: Add function abis_nm_get_attr() to get attributes from BTS 2012-08-14 19:15:57 +02:00
Holger Hans Peter Freyther df49a983e2 docs: Do not remove too much from of the dumped online help
Use the len of the end and not the filename.
2012-08-14 00:14:36 +02:00
Holger Hans Peter Freyther b7b6cf5695 doc: Document a shortcoming of the current OML code
The BTS has 10s to respond to a command but we do not run any
timer. So it is possible that the BTS gets stuck in the process
of the bring up.
2012-08-06 12:41:45 +02:00
Holger Hans Peter Freyther f42e908cea contrib: Create a script that opens a SIP session before
Use the Smalltalk SIP implementation to create a call
and once the call has been established start the replay
using the commoncode. No patching of RTP occurs yet.
2012-08-05 16:10:32 +02:00
Holger Hans Peter Freyther 602559fd9f contrib: Move the shared code into a new file 2012-08-05 09:27:20 +02:00
Holger Hans Peter Freyther 4552d8061a contrib: Make the RTPReplay a a class so it can be shared 2012-08-05 09:25:25 +02:00
Holger Hans Peter Freyther 59043d8c94 typo: Mandantory -> Mandatory.. a common typo of mine 2012-08-03 11:05:29 +02:00
Holger Hans Peter Freyther 9b5db287c6 gb: suspend_ref was changed to a plain uint8_t, update the code
Require a 0.5.2+ libosmogb due the change of the suspend_ref type.
2012-08-03 10:08:32 +02:00
Holger Hans Peter Freyther 1a6b83c919 nat: Document all parameters of the VTY commands 2012-07-28 16:14:04 +02:00
Holger Hans Peter Freyther bc6a54dadc mgcp: Make sure "no rtcp-omit" is fully documented
One command missed the NO_STR in the documentation, share the
main text across all commands.
2012-07-28 15:46:45 +02:00
Holger Hans Peter Freyther d028807658 misc: Introduce a script tha generates the VTY reference
Update/Move/Create example configuration files for NiTB, BSC,
MGCP, NAT and the GbProxy. Create a script that starts, generates
the vty reference and terminates the application.
2012-07-28 15:30:09 +02:00
Holger Hans Peter Freyther 64c17fa598 libbsc: Add documentation to MM INFO, LAC, TSC, CI 2012-07-21 00:28:05 +02:00
Holger Hans Peter Freyther 3217fa2412 nitb: Document missing parameters, reword documentation, combine param
Change "pending send" to "pending-send" as there is no other pending
command right now, add missing documentation for parameters.
2012-07-21 00:01:01 +02:00
Harald Welte 70f9205cd9 MSC 04.08: RRLP messages are DRR, not DNM ! 2012-07-16 13:22:19 +02:00
Harald Welte ae1d010220 BSC API: Don't treat a RRLP message as NOTICE event
While generally we should log troly unknown RR messages, we can simply
pass along RRLP messages (which aren't unknown!)

In real networks, the RRLP would probably not end up at the MSC, but
well, sometimes we don't care what real/classic networks do.
2012-07-16 13:20:53 +02:00
Harald Welte fdf453c0a9 SGSN: Code to help debug / fix sgsn crash in cb_data_ind()
A crash was obsserved in cb_data_ind() when mm is dereferenced.

This patch adds some safeguards that try to prevent the library handle
back-pointer to the pdp_ctx to be NULL, and print a stack backtrace in
case we are free() ing the sgsn-side pdp_ctx while there's still a
library handle attached.
2012-07-14 12:18:28 +02:00
Harald Welte 7b022eed2d add some comments regarding the free() / release of pdp contextx
It might be that we're deleting structures instead of properly cleaning
up the attached libgtp handles...
2012-07-14 12:17:42 +02:00
Harald Welte 45f9171175 move BTS-specific timezone override into sub-structure
Group all three structure members involved in bts-specific timezone
handling into a sub-structure.
2012-07-12 01:14:28 +02:00
Harald Welte 25cf824edc handover: Not finding a HO record on CHAN ACT NACK is not an error
... it might well a completely non-ho-related establishment
2012-07-12 01:14:28 +02:00
Holger Hans Peter Freyther 153b13b02e msc: Attempt to release the lchan immediately on IMSI Detach
The Nokia E71 sends a "IMSI Detach" this msc code does not immediately
send the "RR Channel Release", the E71 is impatient and sends a DISC,
the "RELEASE INDICATION" is handled by starting the channel release
procedure. OpenBSC sends a "RR Channel Release" which will never be
answered, during the early release there is no timer and the lchan will
be in "RELEASE REQUESTED" forever.

This commit removes the anchor operation and checks if the channel can
be released immediately. Regarding the channel release handling there
is already a branch that needs to be tested.
2012-07-10 08:57:41 +02:00
Harald Welte 8c00496e42 GPRS LLC: fix segfault when transmitting downlink unit-data without mmctx 2012-07-04 21:53:12 +02:00
Harald Welte ad66a2d150 BSC VTY: Allow encryption to be set to A5/3
We are currently not checking if the BTS actually suports that cipher,
and we particularly don't have any hack for ip.access which apparently
seems to re-use the RSL algorithm identifier for A5/2.
2012-07-04 21:39:27 +02:00
Harald Welte f383aa11a5 BSC: introduce new "sysmobts" BTS model
so far, osmo-bts/sysmobts used to be entered as "sysmobts" type in the
configuration file.  However, there are some differences in the
protocol/behaviour and we should reflect that by a new BTS plugin (with
lots of code reuse from the nanobts driver).
2012-07-02 20:13:08 +02:00
Harald Welte 0c1bd61bb3 pre-fix measurement reports with subscriber identity
... otherwise it's impossible to distinguish them from each other.
2012-07-02 20:13:02 +02:00
Harald Welte 019f913ca3 gsm_data_shared: add structure for decoded parameters of RLC config
this is primarily needed on the BTS side, but we should also use it on
the BSC side and make the parameters VTY-configurable.
2012-06-28 09:03:07 +02:00
Harald Welte c95175fb88 ipaccess: some more comments on timer values 2012-06-28 09:03:00 +02:00
Harald Welte edcba4e307 use new external libosmogb (part of libosmocore.git)
This removes the libgb (GPRS NS/BSSGP) code from the openbsc.git
repository and uses the new version from libosmocore.git instead.
2012-06-17 23:34:34 +08:00
Harald Welte d24566ac6e libgb: separate header files related to spec and implementation
like in libosmogsm, we separate between header files that are just
reflecting information in the respective specs, and header files that
related to our specific implementation.
2012-06-17 13:12:51 +08:00
Harald Welte ce95b27b68 libgb: make sure all BSSGP functions have bssgp_ prefix
We change the minority of functions employing the gprs_bssgp_ prefix to
match with the majority without gprs_ in front.
2012-06-17 13:05:48 +08:00
Harald Welte 11461a6457 libgb/gprs: don't use log_info from libcommon anymore 2012-06-17 12:58:46 +08:00
Harald Welte e6599ee180 libgb: prefix all NS related functions with gprs_ 2012-06-17 12:38:07 +08:00
Harald Welte b1fd9022eb libgb: don't call directly into GMM / LLC layer
Instead of direct function calls to individual functions, we now
generate primitives (osmo_prim) and send them to one
application-provided function "bssgp_prim_cb()"
2012-06-17 12:17:22 +08:00
Harald Welte faa70ff2c6 libgb: remove dependency of BSSGP to include sgsn/gmm internal structs 2012-06-17 09:31:16 +08:00
Harald Welte 0d5e8e0b56 update .gitignore 2012-06-17 09:05:43 +08:00
Harald Welte 68d85d5610 libgb: Remove dependency to openbsc/debug.h 2012-06-16 17:53:38 +08:00
Harald Welte fdd8b3b40d libgb: remove dependencies to openbsc/vty.h and openbsc/gsm_data.h
Rather than using openbsc internal data/functions, we now use only
internal and libosmocore-provided ones.
2012-06-16 16:59:50 +08:00
Harald Welte a6a20b4ff6 libgb: Use library SS_L_NS instead lf local SS_NS
which removes some further dependencies of libgb to openbsc internal
code and data.
2012-06-16 16:40:42 +08:00
Harald Welte 8645e101da libgb: move GPRS specific msgb CB definitions to separate header 2012-06-16 16:09:52 +08:00
Harald Welte ea34a4e3a7 split libgb into a separate library for outside use
This also removes the dependency to osmo_sock() inside libcommon and
replaces it with osmo_sock_* from libosmocore
2012-06-16 15:14:00 +08:00
Harald Welte 704cb8680b gsm_data_shared: add handover related bits for osmo-bts 2012-06-16 15:02:13 +08:00
Harald Welte 67161f27d1 Allow VTY-based configuration of T3105
This timer will only be forwarded to BS11 and Ericsson Abis so far,
not to Nokia and ip.access BTS yet.
2012-06-03 16:58:18 +02:00
Harald Welte 66d360661a update year in copyright string 2012-06-03 16:58:09 +02:00
Harald Welte f25b55ec71 abis_rsl_rcvmsg(): Fix msgb memory leak in error path
Thanks to Andreas Eversberg for spotting this one.
2012-05-31 20:22:34 +02:00
Harald Welte c513ded578 vty / cfg_bts_tsc: TSC range is 0..7, not 0..255 2012-05-31 10:57:40 +02:00
Holger Hans Peter Freyther 3fab3fdd24 rtp: Add a smalltalk script that can replay the state file. 2012-05-18 18:54:11 +02:00
Holger Hans Peter Freyther bea9a1206b rtp: Add lua script to split a trace by SSRC/streams
This can be used to replay RTP streams with more or less the
same timing as the original one.
2012-05-18 10:48:02 +02:00
Holger Hans Peter Freyther 2c9ea91317 nitb: Enable the external RF Control interface for the nitb application
Add argument handling for the nitb application and create the RF
ctrl interface for being able to control the TRX using an external
socket.
2012-05-17 09:38:24 +02:00
Holger Hans Peter Freyther 41a93dc2f0 bsc: Move the osmo_bsc_rf file into the libbsc code and rename
The nitb will provide the RF interface as well.
2012-05-17 09:37:22 +02:00
Holger Hans Peter Freyther a8090d54d6 mgcp: Make it possible to drop RTCP packets coming from the BTS/Net
The ip.access nanoBTS appears to send quite broken NTP timestamps in
the RTCP messages might confuse equipment that uses the sender report
of the BTS. Make it easy to experiment by adding an option to drop RTCP.
2012-05-11 13:09:30 +02:00
Holger Hans Peter Freyther c50e04a409 bsc vty: Provide a show mscs command to show the state of each MSC 2012-05-11 12:41:13 +02:00
Sylvain Munaut 5e80cc4adc libmsc/db: Fix max value of ainfo->a3a8_ki_len in db_get_authinfo_for_subscr
Thanks to Robert Ingr for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-05-07 22:09:15 +02:00
Harald Welte fda74ee055 RSL add debug statements when sending RSL EST REQ and RSL REL REQ. 2012-04-26 19:43:36 +02:00
Harald Welte 6e8dcf304c bsc_api: Fix wrong order of log category and level arguments 2012-04-26 19:35:58 +02:00
Harald Welte 0e9311df40 bsc_api: log RR STATUS from MS as NOTICE, not DEBUG level 2012-04-26 19:35:27 +02:00
Harald Welte 46cb8514a5 add loopback flag to lchan (for osmo-bts) 2012-04-19 23:14:28 +02:00
Holger Hans Peter Freyther afa0ad1723 lchan: Fix the name of the SACCH in the variable names
Call the channel by the right name.
2012-04-18 18:58:36 +02:00
Holger Hans Peter Freyther cc7b22a53b bsc_api: Send RR Release and de-activate the SACCH on error
In case the connection should not be created/accepted release
the channel by sending a RR Release and de-activating the
SACCH. Phones should deal better with that behavior.
2012-04-17 21:54:24 +02:00
Holger Hans Peter Freyther ec2542627e mgcp: Catch up with the renaming of the MGCP GW binary 2012-04-13 18:06:26 +02:00
Holger Hans Peter Freyther a5dcdd9a9a bsc: Allow to run a mixed TCH/H, TCH/F configuration
In case the call handling starts on a TCH/H switch to a TCH/F
if fullrate is requested. Add a method that is used to determine
if the mode and current channel are compatible with each other.
2012-04-11 20:15:54 +02:00
Harald Welte 5d52c97cff add 'ciph_state' member to BTS-side lchan definition 2012-04-08 20:23:28 +02:00
Harald Welte 9c3dc90d16 introduce HAVE_TM_GMTOFF_IN_TM
Not all architectures have the tm.tm_gmtoff member.  This fixes cygwin
builds.
2012-04-08 16:59:24 +02:00
Harald Welte a334c296e0 make sure we still build on systems that don't have IPPROTO_GRE 2012-04-08 15:56:00 +02:00
Holger Hans Peter Freyther 09db1a44bc nat: Add another test case for TP-SRR clearing and number rewrite 2012-03-26 16:22:08 +02:00
Holger Hans Peter Freyther 2f2be578cb misc: Use other size modifiers to fix compiler warnings
control_if.c:521:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat]
osmo_bsc_bssap.c:473:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat]
mgcp_main.c:162:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformatt]
2012-03-16 12:18:39 +01:00
Holger Hans Peter Freyther 20fea24515 bsc: Prepare to have multiple MSC connections
We now have a list of MSCs but in the code we will
try to access the MSC with the nr 0.
2012-03-16 11:56:21 +01:00
Holger Hans Peter Freyther 44e5dad3e2 bsc: Use the right connection for outgoing packets
This is needed for simple UDT messages where we do not have
a SCCP connection.
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther abd668a68d bsc: Move more things to use osmo_msc_data* directly 2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther f936fb4086 bsc: Move the bsc_filter to use the osmo_bsc_sccp_con 2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther 4cdb050d13 bsc: Move away from ->bsc.msc to use the selected MSC
For multiple MSCs we should only have one place where the MSC
is selected and the rest will extract it from somewhere.
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther f31a4a4810 bsc: Stop using net->bsc->msc and get the right msc from somewhere else 2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther 8ec4952557 bsc: Create a osmo_bsc_data and embed osmo_msc_data
We want to have multiple MSCs but we also have some data
that is only present on a per BSC basis. Right now the
MSC data is not allocated with talloc, so we have some
change in the talloc contexts.
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther 4d31900e2d bsc: Address warnings about implicit declarations
osmo_bsc_main.c: In function ‘main’:
osmo_bsc_main.c:398:2: warning: implicit declaration of function ‘bts_init’ [-Wimplicit-function-declaration]
osmo_bsc_main.c:399:2: warning: implicit declaration of function ‘libosmo_abis_init’ [-Wimplicit-function-declaration]
osmo_bsc_main.c:418:2: warning: implicit declaration of function ‘bsc_bootstrap_network’ [-Wimplicit-function-declaration]
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther dc3389f9c8 bsc: Fix compiler warning about wrong return and unused variable
osmo_bsc_api.c: In function ‘bsc_cm_update’:
osmo_bsc_api.c:195:2: warning: ‘return’ with a value, in function returning void [enabled by default]
osmo_bsc_api.c:193:28: warning: unused variable ‘sccp’ [-Wunused-variable]
2012-03-16 11:56:10 +01:00
Harald Welte ae1997248c mgcp: implement a more tolerant parser based on strtok_r()
Instead of building complex manual byte-wise parsers, we simply use two
strtok_r loops:  one iterating over all the lines, the next one
iterating over the invididual space-separated elements in the first line.

The benefit is that we now accept \r, \n or \r\n, or any multiple of
them as line ending.  This works around incompliant MGCP implementations
like that of Zynetix MSC.

Addition: mgcp_analyze_header returns 0 when all out parameters have
been set.

Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16 10:24:18 +01:00
Harald Welte 6b36b90f75 mgcp: make sure all command line options are documented
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16 10:21:34 +01:00
Harald Welte ec7683f3b0 mgcp: consistently name bsc_mgcp osmo-bsc_mgcp
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16 10:21:34 +01:00
Holger Hans Peter Freyther d77023b1c2 mgcp_test: Add wrong messages as input and check what happens
Test parsing some invalid messages and see if we start to crash.
2012-03-16 10:21:29 +01:00
Holger Hans Peter Freyther 5563e6c268 mgcp_test: Rename method as it now operates on an array of messages
This code was cleaned up, catch up and rename the method.
2012-03-16 10:06:39 +01:00
Holger Hans Peter Freyther 3e60348b3b misc: Deal with smatch warnings about the bitfields
Use unsigned ints for the bitfield.
2012-03-02 14:14:33 +01:00
Holger Hans Peter Freyther a8ddb08e05 misc: Use msgb_free for freeing the messages 2012-03-01 20:30:32 +01:00
Andreas Eversberg c50543b18a Improved generation of SYSTEM INFORMATIONs 2* and 5* for neighbour bands
In addition to SI 2 and SI 5, the SI 2ter and 2bis is generated, if
neighbour cells in other bands exist. Also it is indicated in the rest
octets of SI3, that SI 2ter is used. If no neighbour cell in a different
band exists, the SI 2ter and SI 5ter is omitted.

A special case is P-GSM range (channels 1-124). To be compatible with
older phones, SI 2bis and SI 5bis is used. If the BCCH lays inside the
P-GSM band, only neighbour cells of the P-GSM range are included in
SI 2 and SI 5. If neighbour cells exist in the same band (900), but lay
outside the P-GSM range, the SI 2bis and SI 5bis is used to extend the
list of neighbour cells. The extension is also indicated in SI 2 and
SI 5. If the BCCH lays inside the P-GSM range, but no neighbour cell
exists in the same band outside the P-GSM range, the SI 2bis ans SI 5bis
are omitted.
2012-03-01 08:29:56 +01:00
Tobias Engel c33d7d71cb Make sure USSD code only responds *#100# for retrieving own number
strstr() was used with wrong argument order, causing it to always match,
and causing an invalid response to a variety of different SS and USSD
requests.

This has apparently caused havoc among a number of HTC phones which
issue SS requests without user interaction upon boot, and then trip over
our inappropriate response.
2012-02-24 22:23:17 +01:00
Harald Welte 2935034b5e fix generation of frequency list (E-GSM vs. P-GSM 900) 2012-02-17 15:59:25 +01:00
Holger Hans Peter Freyther c8ddf73c8f bts_ipaccess_nanobts.c: Remove unused variable.
This must have been obsoleted by the move to libosmo-abis.

GCC warning:
bts_ipaccess_nanobts.c: In function ‘ipaccess_drop_oml’:
bts_ipaccess_nanobts.c:509:21: warning: variable ‘line’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:31:05 +01:00
Holger Hans Peter Freyther 863dc9bc84 abis_rsl.c: Remove unused variable net.
The old BSC code had code to override the payload type, this has
been removed, remove the variable accessing it.

GCC warning:
abis_rsl.c: In function ‘ipa_rtp_pt_for_lchan’:
abis_rsl.c:1590:22: warning: unused variable ‘net’ [-Wunused-variable]
2012-02-03 20:29:00 +01:00
Holger Hans Peter Freyther 54fa2c7eab abis_rsl: The rach information was not used, introduce a signal
Introduce a SS_CCCH for the paging and the rach load. The paging
code could now start using the signal.

GCC warning:
abis_rsl.c: In function ‘rsl_rx_ccch_load’:
abis_rsl.c:1371:11: warning: variable ‘rach_access_count’ set but not used [-Wunused-but-set-variable]
abis_rsl.c:1370:11: warning: variable ‘rach_busy_count’ set but not used [-Wunused-but-set-variable]
abis_rsl.c:1369:11: warning: variable ‘rach_slot_count’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:26:25 +01:00
Holger Hans Peter Freyther c6d0a17100 abis_rsl.c: Remove unused variable ts_number
GCC warning:
abis_rsl.c: In function ‘rsl_rx_chan_rqd’:
abis_rsl.c:1245:10: warning: variable ‘ts_number’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:10:13 +01:00
Holger Hans Peter Freyther 06b04f851b abis_om2000.c: Remove unused variable to_trx_oml.
GCC warning:
abis_om2000.c: In function ‘abis_om2k_sendmsg’:
abis_om2000.c:804:6: warning: unused variable ‘to_trx_oml’ [-Wunused-variable]
2012-02-03 20:03:06 +01:00
Holger Hans Peter Freyther 37e6523c0f vty: Remove two unimplemented OML functions
attribute get|set <0-255> (.HEX) was never implemented and the
output about the unused attributes clutter the build output, remove
them.

GCC warning:
abis_nm_vty.c: In function ‘oml_attrib_get’:
abis_nm_vty.c:141:25: warning: unused variable ‘oms’ [-Wunused-variable]
abis_nm_vty.c: In function ‘oml_attrib_set’:
abis_nm_vty.c:152:25: warning: unused variable ‘oms’ [-Wunused-variable]
2012-02-03 20:03:02 +01:00
Holger Hans Peter Freyther dae5307a57 misc: abis_nm.c Use the result of ret.
Use LOGP(DNM, LOGL_ERROR, ...); for errors in the
abis_nm_rx_sw_act_req method.

GCC warning:
abis_nm.c: In function ‘abis_nm_rx_sw_act_req’:
abis_nm.c:412:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:03:00 +01:00
Holger Hans Peter Freyther f02bb200c5 misc: gsm_data.c address compiler warning
Assume nothing special needs to be done for the Nokia
*site hardware.

GCC warning:
gsm_data.c: In function ‘gsm_set_bts_type’:
gsm_data.c:342:2: warning: enumeration value ‘GSM_BTS_TYPE_NOKIA_SITE’ not handled in switch [-Wswitch]
2012-02-03 20:02:54 +01:00
Harald Welte 1fe73a19cd ARFCNs are in the range of 0..1023, not 0..1024
I'm sure I read somewhere that it actually was 0..1024, as I kept
wondering how stupid it was to use 10bit+1.  However, that source
was incorrect, as GSM TS 05.05 quite clearly states 0..1023
2012-01-29 13:24:12 +01:00
Harald Welte 94b499c9bd mgcp: add missing prototypes for send_mgcp_reset_* 2012-01-27 00:46:49 +01:00
Harald Welte 78b5586e25 osmo-bsc: Remove hard-coded check for codec preferecne in ASS CMD
When we get an assignment command from the MSC, we no longer have to
check statically for certain codecs, as we have a vty-configured list of
codecs that is checked just below.
2012-01-27 00:43:06 +01:00
Harald Welte 6a85705d51 MGCP: Add VTY commands to reset (RSIP) one or all endpoints 2012-01-27 00:41:39 +01:00
Harald Welte 50f93a4acd bsc_mgcp: optionally connect the MGCP socket to the MGW
This allows the use of the existing "call-agent ip A.B.C.D" command in
libmgcp in order to set a default destination address of the call agent.

This is required as a pre-condition for certain call agents (like the
zynetix MSC) that require a RSIP from the BSC to the MSC as the initial
MGCP message.
2012-01-27 00:38:59 +01:00
Harald Welte 27fa7901bb MGCP: Add CRCX test cases
The second test case (CRCX_ZYN) fails as the message is not compliant
with the spec.  However, our parer should be more tolerant, just in
case...
2012-01-27 00:37:23 +01:00
Harald Welte f74da14c01 further generalize mgcp testing code
use a data-structure driven approach
2012-01-27 00:36:56 +01:00
Harald Welte 8819d8289d mgcp_test: remove duplicate code 2012-01-27 00:00:44 +01:00
Harald Welte cf149eebb6 Move the bulk of RR processing from MSC into BSC
RR Messages like STATUS, GPRS SUSPEND, HANDOVER COMPLETE/FAIL, ...
should be processed on the BSC side of things, not on the MSC side.

This is among other things required in preparation of intra-BSC
hand-over support in osmo-bsc.
2012-01-23 16:40:24 +01:00
Harald Welte 95e862cab4 Move processing of CLASSMARK CHANGE behind bsc_api
This prevents osmo-bsc from sending RR messages to the MSC and rather
process them inside the BSC and turn them into BSSAP CM UPDATE.
2012-01-23 10:28:35 +01:00
Harald Welte d55cef9b07 osmo-bsc: correctly parse the TMSI in BSSAP paging from MSC
the TMSI is a uint32_t big-endian value and not a gsm 04.08 mobile
identity like the IMSI.
2012-01-20 17:21:36 +01:00
Holger Hans Peter Freyther 7d60bdb2c2 nat: Add VTY command for the TP-DA rewriting. 2012-01-18 20:40:01 +01:00
Holger Hans Peter Freyther 2718845967 nat: Fix the no sms-clear-tp-srr command 2012-01-18 20:34:08 +01:00
Holger Hans Peter Freyther 47b144b002 nat: Internationalize the TP-DA if it starts with a 00
Internationalize the number like we do it for Call Control. Update
the test result to match this new behavior.
2012-01-18 20:15:29 +01:00
Holger Hans Peter Freyther 8e60f629e2 nat: Prepare to rewrite the TP-DA number of a SMS submit.
Introduce number rewriting of SMS-SUBMIT. Introduce a new list,
move code around to help with finding a new number, somehow the
number encoding for TP-DA is borked, 03.40 references 04.11 but
the length appears to be strlen(number) without taken the type
field into account.
2012-01-18 20:14:58 +01:00
Holger Hans Peter Freyther be53012f9c nat: Print the sizes and the offending data in case of a failure 2012-01-18 17:20:23 +01:00
Holger Hans Peter Freyther 0354a80357 rsl: This is provided by libosmo-abis, remove it here 2012-01-17 16:14:23 +01:00
Holger Hans Peter Freyther 445d00543a mgcp: Fix warning about unused variable
mgcp_network.c:335:22: warning: variable ‘cfg’ set but not used [-Wunused-but-set-variable]
2012-01-17 16:00:08 +01:00
Holger Hans Peter Freyther 9592c45e34 mgcp: Provide documentation for the method, check sscanf return 2012-01-17 15:58:48 +01:00
Holger Hans Peter Freyther 523a99d3a6 bts: Convert the rsl_link to be a struct ipabis_link 2012-01-17 15:52:45 +01:00
Holger Hans Peter Freyther f95f2733e6 lchan: Close a possible still open RTP Socket
In case of a reset (loss of the BTS) close down all remaining
RTP Proxy sockets. In case of a lchan_free shout if the rtp
proxy is still open. I would prefer if the proxy code sits inside
the gsm subscriber connection.
2012-01-17 15:30:24 +01:00