Commit Graph

35 Commits

Author SHA1 Message Date
Max 8db12e4263 Add extra debug output with channel mode and type
This provides helpful information for debugging internal MNCC handler.
2016-04-22 15:53:51 +02:00
Neels Hofmeyr 531734a547 04.08: apply new bitmask functions, fix bitmask use
Replace hardcoded protocol discriminator and message type bitmasks with
function calls recently introduced in libosmocore.

Note that the release 98 bitmasks slightly differ from the release 99 bitmasks.
This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on
libosmocore whether 98 or 99 bitmasks are used.

In some places, use of the bitmask was erratic. Fix these implicitly by
employing the bitmask functions:

 * silent_call.c: silent_call_reroute(): add missing bitmask for MM.
 * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages.
 * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM
   messages.
 * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages.
 * bsc_ussd.c: no bitmask is applicable for the message types used here.
 * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc.

In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected
message types.
2016-03-15 14:15:00 +01:00
Holger Hans Peter Freyther 7a77d0155f amr: Attempt to unbreak the AMR support in the BSC
The signature of mr_config and the BSC implementation didn't
match and the compiler was warning about it:

osmo_bsc_api.c:530:2: warning: initialization from incompatible pointer type
 .mr_config = bsc_mr_config,
 ^
osmo_bsc_api.c:530:2: warning: (near initialization for ‘bsc_handler.mr_config’)

Change the mr_config again and provide an implementation
that will set the ms and bts data structure. It would be
better to put the size outside of the IE but I am not going
to change it right now. It would also be nice to either move
the AMR setting into the "nitb" structure or have the msc
data be used _after_ the bts settings. This needs to be
cleaned up in the next step.

Manually verified by placing a MO call and checking that
both the channel mode modify and the mode modify request
contain the multi rate config with the rate mr config
(length two bytes, version 1, icmi==1, no start mode being
set).
2015-10-02 15:30:29 +02:00
Holger Hans Peter Freyther 615ed46a6a amr: Instead of putting ms/bts into the same struct.. use it twice
This way a lot of if/else can just be killed by the caller deciding
which of the two instances to use.

I have copied both branches to new files, replace bts for ms in one
of them and ran diff on it. There is no difference.
2015-10-02 15:30:29 +02:00
Andreas Eversberg 732665269e Add full AMR multirate IE support with VTY config for MS and BTS side 2015-09-22 16:46:27 +02:00
Harald Welte 7b1d25a11e Fix most compiler warnings with gcc-4.9.2 2015-01-01 12:32:03 +01:00
Holger Hans Peter Freyther 93dfa24f42 bsc: Add a ctrl command to send a ussdNotify for a call
Send a non-call related SS message for an active call indentified
by the CIC of that call. As an ugly hack the order of the SS
release and the invocation are changed. That was necessary for the
E71 on a TCH. The time between notify and release was just too short.
The right would be to wait for the returnResultLast but this would
involve keeping more local state. Let's see how far we get here. It
might be necessary to change the order in the other call sites as
well.
2014-08-08 21:17:36 +02:00
Andreas Eversberg 723a751e5f dyn PDCH: Cleanup of rsl_chan_activate_lchan() and users
Timing advance is stored inside lchan structure, so it is removed from
arguments. This is useful, if other actions are required prior calling
rsl_chan_activate_lchan. (like deactivating PDCH first)

The "shifted TA value" that is required by BS11 is now calculated inside
rsl_chan_activate_lchan and not by each user.

[Rebased by Holger. So some hunks were skipped as the patch
depended on Jolly's HO code]
2014-08-04 08:59:16 +02:00
Andreas Eversberg dcf38e1c96 Add function to update TRAU muxer after assignment or handover
E1 based BTS use TRAU muxer to decode TRAU frames. After changing
channel from one timeslot to another (due to handover or assignment),
the TRAU muxer must be updated. The call reference of the call is
disconnected from the old channel and connected to the new channel.
2014-01-27 14:39:06 +01:00
Holger Hans Peter Freyther 5ecbc93656 misc: Fix compilation warnings
bsc_api.c:417:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat]
bsc_api.c: In function ‘handle_ass_fail’:
bsc_api.c:458:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat]

db.c: In function ‘db_sync_subscriber’:
db.c:785:3: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘time_t’ [-Wformat]

osmo_msc.c: In function ‘msc_release_connection’:
osmo_msc.c:145:20: warning: unused variable ‘trans’ [-Wunused-variable]

smpp_smsc.c: In function ‘link_accept_cb’:
smpp_smsc.c:891:24: warning: assignment from incompatible pointer type [enabled by default]

smpp_smsc.c:271:1: warning: ‘esme_by_system_id’ defined but not used [-Wunused-function]

smpp_openbsc.c: In function ‘smpp_openbsc_init’:
smpp_openbsc.c:545:2: warning: implicit declaration of function ‘smpp_vty_init’ [-Wimplicit-function-declaration]

osmo_bsc_ctrl.c: In function ‘verify_bts_loc’:
osmo_bsc_ctrl.c:340:19: warning: variable ‘height’ set but not used [-Wunused-but-set-variable

smpp_mirror.c: In function ‘main’:
smpp_mirror.c:297:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
2013-07-27 20:03:08 +02:00
Holger Hans Peter Freyther 25aa749f10 audio: Make the BSC handle the new mr_config request of the BSC API
Handle the mr_config request and set the AMR multirate config for
the given MSC. Initialize the mr_config with the AMR5.9 default we
have been using until now.
2013-01-07 16:10:31 +01:00
Holger Hans Peter Freyther d66777f9cf rsl: Call the release function with the enum name and not the number
Done with the semantic patch:
@rule1@
expression E;
expression F;
@@
- lchan_release(E, F, 1);
+ lchan_release(E, F, RSL_REL_LOCAL_END);

@rule2@
expression E;
expression F;
@@
- lchan_release(E, F, 0);
+ lchan_release(E, F, RSL_REL_NORMAL);
2012-12-23 20:18:18 +01: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
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 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
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 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 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
Holger Hans Peter Freyther 40aac3f7f6 bsc: Assume assignment_complete/assignment_fail is set
The osmo-nitb application sometimes crashes because the BSC API
is doing an assignment underneath which is not handled by the code,
add dumy handlers to not crash, the right thing to do is to change
MNCC to have an assignment that can succeed/fail.

The keyword to look for is MNCC_LCHAN_MODIFY and mncc_sock should
wait for an ack/nack but right now the call just continues.
2011-12-27 12:55:44 +01:00
Harald Welte b70bd52c2a bsc_api: Add some more comments to the code 2011-09-13 00:02:09 +01: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
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
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
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 28d9ccbca0 libbsc: Don't free secondary lchan if it is NULL. 2011-08-10 13:40:39 +02:00
Pablo Neira Ayuso bbc5b99a6b src: use namespace prefix osmo_signal*
Summary of changes:

s/signal_cbfn/osmo_signal_cbfn/g
s/register_signal_handler/osmo_signal_register_handler/g
s/unregister_signal_handler/osmo_signal_unregister_handler/g
s/dispatch_signal/osmo_signal_dispatch/g
2011-05-06 12:12:31 +02:00
Pablo Neira Ayuso bf540cb7c3 src: use namespace prefix osmo_timer* for timer functions
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-06 12:11:06 +02:00
Holger Hans Peter Freyther c42ad8b686 misc: Move from u_int to uint types of stdint.h
This was done with sed on the files.
2011-04-18 17:31:39 +02:00
Pablo Neira Ayuso 136f453dd2 src: use new library libosmogsm and new path to headers in libosmocore
libosmogsm is a new library that is distributed in the libosmocore.
Now, openbsc depends on it. This patch gets openbsc with this
change.

This patch also rewrites all include path to the new
osmocom/[gsm|core]

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:17:56 +01:00
Harald Welte 89579b4317 prefix sub-directories containing libraries with 'lib'
... and make sure tests work again after restructuring
2011-03-04 13:23:09 +01:00