Commit Graph

2627 Commits

Author SHA1 Message Date
Harald Welte ec1921dfa3 Use shorter vty_app_info->name for all apps
... as this is now used as SYSLOG ident
2011-02-24 23:57:06 +01:00
Nico Golde b62b12398b sms: introduce new command to trigger the sending process for specific subscribers only 2011-02-24 14:48:57 +01:00
Holger Hans Peter Freyther 11762459e8 rf: Delay execution of commands
Delay executing RF commands up to a second. If many commands
arrive within a second then just execute the last command.
2011-02-24 14:40:23 +01:00
Holger Hans Peter Freyther 00c805f213 rf: Verify that the requested mode is entered and drop OML in error
Verify that the BTS is following our orders, if we think there was
an error we will drop the OML connection.
2011-02-24 14:40:11 +01:00
Holger Hans Peter Freyther 37ac420254 rf: Remember the last command requested on the RF CMD interface 2011-02-24 14:37:36 +01:00
Dieter Spaar 6a458eac2c oml: Parse probable cause and additional text in failure reports 2011-02-24 14:37:10 +01:00
Holger Hans Peter Freyther 6c79a68103 misc: Compile fixes due 4d54d0b883 2011-02-24 14:34:03 +01:00
Holger Hans Peter Freyther ca8f3b59c1 debian: Correct the path for the binaries. 2011-02-20 11:56:12 +01:00
Harald Welte 21bbda242e BSC: Fix empty neighbor list in case of manual SI/SI5 mode 2011-02-19 20:43:37 +01:00
Harald Welte 4d54d0b883 Fix various compiler warnings all over the code 2011-02-19 16:48:17 +01:00
Harald Welte 5ec26fe983 Install programs into $(prefix)/bin, not /sbin
At least in many configurations, there is no need to run any
of our programs as root.  Thus, we shouldn't install them in sbin.
2011-02-19 16:19:19 +09:00
Holger Hans Peter Freyther f358964fb2 bsc: Use msg->data and msg->len for the hexdump, pick a better name
Rename the method as we send everything to the MSC and not just
SCCP. Put alink into the function name. Also use msg->data and
msg->len in hexdump as this is what we are sending to the server.
2011-02-18 23:44:49 +01:00
Holger Hans Peter Freyther 91fa850791 nat: If the number starts with 00 turn it into a international number
Switch the type to international and skip the '00' of the phone
number. This should fix some issues with gateway MSCs.
2011-02-18 23:44:49 +01:00
Holger Hans Peter Freyther 4446b3bf34 nat: Add extra size check for the number and fail if it does not fit
If the replaced number is too long for the phone number we will
have to stop processing here.
2011-02-18 23:44:49 +01:00
Holger Hans Peter Freyther 6e1a676e21 bsc: core-mobile-country-code and core-mobile-network-code range is too small
Make both VTY commands have the same range as the normal MCC and
NCC command in the config file.
2011-02-18 23:44:49 +01:00
Harald Welte 8dcebd3e7f LOGGING: make sure to make the 'logging filter' compatible with vty log cfg
Recent libosmocore introdues a way how log targets can be configured from
the VTY.

This commit makes the 'log filter (imsi|nsvc|bvc)' compatible with it.
2011-02-18 21:10:05 +01:00
Harald Welte 64c07d213c Allow configuration of SI5 neighbor list != SI2 neighbor list
This introducecs the new VTY command "neighbor-list mode manual-si5"
in combination with "si5 neighbor-list (add|del) arfcn <0-1024>",
which allows you to (optionally) have neighbor channel lists that
differ in SI5 and in SI2.
2011-02-15 11:43:27 +01:00
Harald Welte b01bf33ad4 add example openbsc.cfg for RBS2308 with 4TRX 2011-02-14 16:45:06 +01:00
Harald Welte e925205c28 DAHDI: Automatically switch signalling slots to HDLC + FCS mode
This will now make signalling slots work anywhere, even if
/etc/dahdi/system.conf states the timeslot is a bchan.
2011-02-14 16:43:35 +01:00
Harald Welte da87154093 OM2000: Make sure the IS and CON lists are kept in order 2011-02-14 16:32:44 +01:00
Harald Welte ebec58e8ba DAHDI: usse lower-case name to parse correctly by vty code 2011-02-14 16:31:53 +01:00
Harald Welte 59eee42b05 OM2000/RBS2000: Make IS+CON configuration persistent in config file
This uses the new bts_model->config_write_bts() callbacks
2011-02-14 16:17:49 +01:00
Harald Welte face7edc62 VTY: Allow for per-BTS-model specific config file write functions
This way a BTS module can append config data to the TS, TRX and BTS
sections.
2011-02-14 16:15:21 +01:00
Harald Welte a0fe72de6f LAPD: keep sent/receive sequence numbers per SAPI, not just per TEI
If there are multiple SAPIs active on the same TEI, we need to keep
one set of sequence numbers for each SAPI, not just for the TEI.
2011-02-14 15:51:57 +01:00
Harald Welte fdb71949db OM2000: Handle various ACKs better, implement CON CONF REQ 2011-02-14 15:31:43 +01:00
Harald Welte d88a3878cc OM2000: Route outgoing NM message depending on MO
Depending on the MO we adress, select the proper OML link
2011-02-14 15:26:13 +01:00
Harald Welte 9c0958bf4c OM2000: Complete the VTY help message for OM2000 MO commands 2011-02-13 22:51:03 +01:00
Harald Welte a02085dab0 OM2000: Allow configuration of CON from VTY
However, we have no code that generates the OM2K CON List attribute.
2011-02-13 22:45:02 +01:00
Harald Welte a8e6a652ca OM2000: Allow VTY based configuration of IS connection groups 2011-02-13 22:13:28 +01:00
Harald Welte b7eebf8699 OM2000: Don't send START REQ in response to FAULT REP 2011-02-13 20:09:24 +01:00
Harald Welte c4989a8e5e INPUT: Disable the per-TRX OML Link for now
We need a way for the caller to specify which OML link (BTS or TRX) he wants.
2011-02-13 20:06:58 +01:00
Harald Welte 9f0866c2a3 RBS2000: Differentiate between BTS OML and TRX OML
We don't want to restart the CF on TRX OML link establishment...
2011-02-13 19:44:47 +01:00
Harald Welte bd3137c2dd INPUT: Include TEI + SAPI in E1 INPUT SIGNAL 2011-02-13 19:44:21 +01:00
Harald Welte 15ccc77f62 INPUT: Allow for a per-TRX OML link
So far, all BTS we have interfaced had one OML link per BTS, independent of the
number of TRX.  In Ericsson RBS 2000, there is an OML link for the DXU/IXU,
and one additional OML link for each TRX/TRU.
2011-02-13 19:36:18 +01:00
Harald Welte 82b03a1f2b RBS2000: fix compiler warning about unhandled enum in switch() 2011-02-13 19:35:39 +01:00
Harald Welte 0896b50197 OM2000: Configure the IS to route both TRX0 and TRX1 2011-02-13 15:49:27 +01:00
Harald Welte 909212fc87 LAPD: Make sure we don't re-start SABM timer for INACTIVE SAPs 2011-02-13 15:49:27 +01:00
Harald Welte c834b70d04 RBS2000: Generate per-TRX OML link 2011-02-13 15:49:27 +01:00
Harald Welte 174a51a761 DAHDI: Deliver ALARM/NOALARM as input signal to RBS2000 driver
... and re-start LAPD SABM as required
2011-02-13 15:49:27 +01:00
Harald Welte b3d70fd0bd OM2000: Make sure we ACK an ENABLE RESULT 2011-02-13 15:49:26 +01:00
Harald Welte dcf42e6cd2 RBS2000: Move SABM re-transmit logic into LAPD code
This means we now can support multiple LAPD links
2011-02-13 15:49:26 +01:00
Harald Welte 334c5ab2e6 RBS2000: Make sure we transmit SABM at 0.3 second intervals
This is apparently the right timing to increase the chance that the RBS detects
it quickly. (10..15 seconds)
2011-02-13 15:49:26 +01:00
Harald Welte b0ec9e3dae OM2000: Use om2k in VTY prompt 2011-02-13 15:49:26 +01:00
Harald Welte 8bcb1a0a99 OM2000: Add IS Conf Req 2011-02-13 15:49:26 +01:00
Harald Welte 0741ffe69f OM2000: Add enable/disable commands 2011-02-13 15:49:26 +01:00
Harald Welte 56ee6b8075 OM2000: Fix Negotiation parsing 2011-02-13 15:49:26 +01:00
Harald Welte 563d316106 OM2000: Implement proper parsing and response for Negotiation 2011-02-13 15:49:26 +01:00
Harald Welte 8024d8ff58 OM2000: Add support for sending the TEST REQUEST message 2011-02-13 15:49:25 +01:00
Harald Welte 8d4a472cc4 OML2000: Make sure we can properly exit the VTY node 2011-02-13 15:49:25 +01:00
Harald Welte 810e32394d OM2000: Make sure we can properly exit tye VTY node 2011-02-13 15:49:25 +01:00
Harald Welte 6fec79da18 OM2000: Add VTY commands for connect/disconnect and op_info 2011-02-13 15:49:25 +01:00
Harald Welte 51c8238024 OM2000: Add missing file from previous commit 2011-02-13 15:49:25 +01:00
Harald Welte e1d5eca916 OM2000: Introduce VTY commands to initiate OM2000 procedures 2011-02-13 15:49:25 +01:00
Harald Welte 7354107946 OM2000: Negotiation Resposne, send START on OML-up event 2011-02-13 15:49:25 +01:00
Harald Welte bc867d9a17 OM2000: Fix computation of length field in header, direct transmit of msgs 2011-02-13 15:49:24 +01:00
Harald Welte 9a311ec25e [RBS2000] Add initial code for Ericsson OM2000 O&M protocol
... and link it from the RBS2000 BTS support
2011-02-13 15:49:24 +01:00
Harald Welte b80e14e567 [RBS2000] Add FIXMEs in code that is a crude hack 2011-02-13 15:49:24 +01:00
Harald Welte 03cc8a810b [RBS2000] Actually activate the RBS2000 support
The previous patch introduces new code for the RBS2000 but didn't
actually activate/call it yet.

After this patch, you can see LAPD being established and OM2000 messages
will fall into abis_nm.c (which of course has no clue about them).
2011-02-13 15:49:24 +01:00
Harald Welte db44f6012d [RBS2000] Initial attempt at Ericsson RBS2000 support 2011-02-13 15:49:24 +01:00
Harald Welte 09cefee4db [OML] Allow each BTS model to specify the OML callback
This allows us to add BTS models that do not use the standard TS 12.21 OML
2011-02-13 15:49:09 +01:00
Harald Welte a4898a868b DAHDI: print debug hexdump of every signalling msg we send 2011-02-13 15:47:26 +01:00
Harald Welte 1a00d823b3 [LAPD] Add minimal support for TE-side LAPD 2011-02-13 15:46:48 +01:00
Harald Welte 00ee4b78db DAHDI: Register every FD in the select() exceptfd-set
This helps us to receive events even if we don't receive or transmit
anything on the line.
2011-02-13 15:46:08 +01:00
Harald Welte 44f04da379 DAHDI: Handle exceptions 2011-02-13 15:44:53 +01:00
Harald Welte 95aa5c4ae3 E1 INPUT: Fix PCAP file generation for non-mISDN case 2011-02-13 15:44:22 +01:00
Harald Welte f27d043032 E1 Input: Add new S_INP_LINE_INIT signal
This allows other code to listen ot a signal about a new line that
was just configured.
2011-02-11 16:49:41 +01:00
Harald Welte f338a03b0c [BSC] Move the BTS-type specific code from bcs_init.c to bts_*.c
bsc_init.c was a big mess even only for two supported BTS models,
so before adding more BTS types, this needs a cleanup.

All the BTS specific code from bsc_init.c has now moved into
bts_{siemens_bs11,ipaccess_nanobts}.c

This has required that input_event() and nm_state_event() get both
converted to proper libosmocore signals instead of referencing external
symbols.
2011-02-11 16:26:31 +01:00
Harald Welte f3956cbb20 [gb_proxy] vty: display the BVC BLOCKED status in 'show gbproxy' 2011-02-06 17:44:14 +01:00
Harald Welte fb9e06f310 [gb_proxy] make sure bssgp cell id is copied correctly
When we copy a msgb, we need to make sure the msgb_cb->bssgp_cell_id
pointer points to data in the new message, not in the old message.

Thanks to Dieter Spaar for spotting this.
2011-02-06 17:17:05 +01:00
Harald Welte c471d3d8a2 [gb proxy] treat BVCI=1 consistently like signalling
1 is reserved for point-to-multipoint data, i.e. not a point-to-point BVCI.
2011-02-06 17:13:12 +01:00
Harald Welte 5e106d7765 [gb_proxy] Convert a NS-BLOCK from BSS into BVC-RESET to SGSN
As we only have one NS-VC between gb_proxy and SGSN, we cannot
forward a NS-BLOCK from the BSS to the SGSN, as it would affect
all other BSS's, too.

Thus, we check if we have an unblocked PTP-BVC in the NSVC to the BSS,
and then issue a BVC-BLOCK towards the SGSN.

This should prevent any further PDU's from the SGSN to be sent to
this BSS.
2011-02-06 16:33:29 +01:00
Harald Welte 36f98d9c53 [gb_proxy] Track the state of blocked/unblocked BVC in the proxy
This allows us to reject any additional messages sent by the SGSN
after the BVC was blocked (+ acknowledged to be blocked)
2011-02-06 13:09:29 +01:00
Harald Welte b63c3639eb remove dead code 2011-02-05 22:17:24 +01:00
Harald Welte 62d460301b [DAHDI] cosmetic fixes 2011-02-05 20:26:27 +01:00
Harald Welte 4ee2eaf3c4 [DAHDI] make sure LAPD transmits with correct SAPI 2011-02-05 20:26:27 +01:00
Harald Welte 8fc66a0c4d [LAPD] fix bug in TEI manager rendering LAPD unusable 2011-02-05 20:26:27 +01:00
Harald Welte 1458ec6571 [DAHDI] remove unused variable 2011-02-05 20:26:27 +01:00
Harald Welte d38f10593a [LAPD] Support multiple instances of LAPD
We cannot afford static/global state, as we may have multiple E1
lines, each having its own LAPD instance.  Furthermore, we might
even have multiple LAPD instances on the same E1 line (think of
a multi-drop setup).

This also implements dynamic TEI allocation, i.e. no hardcoded
TEI list anymore.
2011-02-05 20:26:27 +01:00
Harald Welte 0ae575536a [LAPD] remove a number of unneeded assert() calls 2011-02-05 20:26:27 +01:00
Harald Welte 716d2a47b2 [LAPD] further code cleanup 2011-02-05 20:26:27 +01:00
Harald Welte 0abc11a0d0 [LAPD] use LOGP/DEBUGP instead of custom logging function 2011-02-05 20:26:26 +01:00
Harald Welte 50d369e1a9 [DAHDI] update to latest e1_input changes 2011-02-05 20:26:26 +01:00
Harald Welte ca17ef88f5 [DAHDI] build dahdi driver only if dahdi header is present 2011-02-05 20:26:26 +01:00
Harald Welte 1dd68c3d0f [DAHDI] integrate DAHDI driver into E1 Input layer 2011-02-05 20:26:26 +01:00
Harald Welte ba0db5b7f3 [dahdi] remove lots of dead code and references to mISDN 2011-02-05 20:26:26 +01:00
Harald Welte d273529a8d [dahdi] don't export private functions from lapd.c 2011-02-05 20:26:26 +01:00
Harald Welte e1de69af7e [dahdi] support multiple-include of lapd.h 2011-02-05 20:26:25 +01:00
Harald Welte 7e859bc17c [dahdi] Fix LAPD code comments (C-style) 2011-02-05 20:26:25 +01:00
Harald Welte 30fe64165b [dahdi] Fix lapd.c coding style 2011-02-05 20:26:25 +01:00
creslin287 cd8b86f124 Working audio data version 2011-02-05 20:26:25 +01:00
Matthew Fredrickson 69245a0496 Current LAPD with fixes for frames with P/F bit set 2011-02-05 20:26:25 +01:00
Matthew Fredrickson cc2bc35f2c Current version of mostly working dahdi driver 2011-02-05 20:26:25 +01:00
Matthew Fredrickson b1cb8eb7a6 Latest version of driver from other machine. 2011-02-05 20:26:25 +01:00
Matthew Fredrickson d105e2048a Add addtional copyright notices for changes 2011-02-05 20:26:24 +01:00
Matthew Fredrickson bc6649e942 Add lapd.c and lapd.h 2011-02-05 20:26:24 +01:00
Matthew Fredrickson b5ddc184ff Add dahdi.c 2011-02-05 20:26:24 +01:00
Harald Welte f933de97ba [E1] fix typo resulting in NM message being logged as RSL 2011-02-05 20:23:44 +01:00
Harald Welte 98c98547d0 [E1 INPUT] update E1 / BS-11 config files
Add the new 'e1_input' config section that is required
2011-02-05 15:58:03 +01:00
Harald Welte 07bb0daaff [E1 input] make sure config file with new E1 input config saves correctly 2011-02-05 15:57:42 +01:00
Harald Welte 889f16eac3 [E1 input] proper config error reporting 2011-02-05 15:43:15 +01:00
Harald Welte fefb52361a [E1 INPUT] remove debug printf's 2011-02-05 15:31:40 +01:00
Harald Welte 3016d9f299 [E1 INPUT] explicitly configure the E1 input driver for each line
This introduces a new 'e1_input' config node with a command to be
used like:
  e1_line 0 driver misdn

This allows us to have different input drivers in the future
2011-02-05 15:31:34 +01:00
Harald Welte 5455243306 [input] make mi_e1_line_update() a driver specific callback
This helps us to further disentangle the misdn driver and e1_input
in preparation of DAHDI support.
2011-02-05 15:31:31 +01:00
Holger Hans Peter Freyther a61c709ef0 mncc: Fix a crash in the call release code
When the remote subscriber has not responded yet we could
end up with a crash in the MNCC code. It was enough to dial
the number, then hang up and bsc_hack would end up with a
segfault due the list poisining of linux_list.
2011-01-27 15:05:45 +01:00
Holger Hans Peter Freyther 6e94d6d10d mgcp: Be able to parse RQNT messages and reply to them
We do not implement the request for notification at all but
we will tell the server that we have received something.
2011-01-25 23:33:54 +01:00
Holger Hans Peter Freyther 3fbd244187 bsc: Initialize the subscr to NULL in the default case
The paging response should always have a TMSI or IMSI
and we should be able to find the subscriber using that. If
no IMSI/TMSI is present and we would still accept the LU
we would access the uninitialized memory.
2011-01-16 20:31:59 +01:00
Holger Hans Peter Freyther b549ddfb04 mncc: Fix crash when memory allocation is failing 2011-01-16 20:31:59 +01:00
Holger Hans Peter Freyther 05bbec7227 bsc: Fix possible crash when the lchan->conn alloc failed
Another null pointer dereference found by clang.
2011-01-16 20:31:59 +01:00
Holger Hans Peter Freyther 91f587ed98 misc: Make clang --analyze happy with the source code
The compiler concludes that if (ts->type == type && ts->line && line
can be false as line is NULL and then we unconditionally access
it, make it happy by adding an extra NULL check.
2011-01-16 20:31:59 +01:00
Harald Welte 7bbaefb349 update gitignore 2011-01-14 14:38:42 +01:00
Harald Welte 64bb754b40 [RSL] Move RF CHAN REL ACK into its own function
... rather than handling it in the main switch() statement
2011-01-14 14:25:57 +01:00
Harald Welte aace9fc9b9 [SI] Make sure we set BS_AG_BLKS_RES !=0
This parameter indicates how many of the PCH+AGCH blocks are reserved
for the AGCH and thus not used for the PCH.  If we set it to 0,
we basically tell the BTS there is no AGCH - and thus it would be
impossible to send any IMMEDIATE ASSIGNMENTs.

Luckily the BS-11 and the nanoBTS don't seem to care.
2011-01-13 23:20:45 +01:00
Harald Welte 7a69cf0a98 [RSL] add missing hunk from commit 18b590de4a 2011-01-13 23:16:03 +01:00
Harald Welte 18b590de4a RSL: add code to generate SACCH INFO MODIFY command
SACCH INFO MODIFY is intended to modify the SACCH content for a single
logical channel (as opposed to the default SACCH FILLING)
2011-01-13 00:08:17 +01:00
Harald Welte 32c0962b10 [BSC] Allow manual override of neighbor cell list
So far, OpenBSC simply assumed that all BTS's configured in openbsc.cfg are
neighbors of each other.  While this is true for small site installations,
it is definitely not true in most real world cases.  We now have the
following new commands at the 'configure bts' level:

'neighbor-list mode (auto|manual)' for selecting the mode

'neighbor-list (add|del) arfcn <0-1024>'
	for adding/deleting ARFCN in manual mode
2011-01-11 23:48:52 +01:00
Holger Hans Peter Freyther 8e3f0e7185 silent sms: Fix the silent SMS feature once again
It got broken in the refactoring of 20474ad029.
2011-01-10 17:04:06 +01:00
Holger Hans Peter Freyther cdfcbee53b sms: Allow to specify the DCS for the SMS. 2011-01-10 15:34:09 +01:00
Holger Hans Peter Freyther c464491b0b sms: Move the sms_from_text to gsm_04_11
Move the SMS from text code from the VTY interface into the
gsm_04_11.c code next to the sms_alloc and sms_free.
2011-01-10 15:21:34 +01:00
Holger Hans Peter Freyther 368a0a73d4 ipa: Only use one IPA number for Osmo extensions
Instead of using more numbers from the proto range we will
use the 0xee and then have a mini header with our new proto
id in there. For a start rename the use types to _OLD.
2011-01-07 16:54:46 +01:00
Holger Hans Peter Freyther 45c2184c7e mgcp: Return with NULL if we fail the size check. 2011-01-07 11:36:54 +01:00
Holger Hans Peter Freyther f43f2fce82 mgcp: We want to count trunks starting from one. 2011-01-07 11:34:50 +01:00
Holger Hans Peter Freyther 9f239a2a0f mgcp: Parse a Digital Trunk endpoint name. 2011-01-06 19:35:10 +01:00
Holger Hans Peter Freyther 6adac17a10 mgcp: Include a MGCP Response String in the response
Switch to a \r\n at the end of the query. Both \n and \r\n
are valid according to the spec but this makes us match
responses of other equipment.
2011-01-06 19:35:10 +01:00
Holger Hans Peter Freyther 49b3ed2226 subscr: Stop stopping paging requests behind the back of subscr
The transaction layer was stopping paging requests that might or
might not have been owned by the transaction. This makes the subscr
code get stuck delivering requests. This code is mostly a band aid
and just makes sure that we will kick the queue if it is needed.
2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther 182c81f04e subscr: Remember if we need to call subscr_put_channel at the end.
Remember if this channel got opened due a paging response and in
that case when we close it down we will call subscr_put_channel
that will try to page the subscriber again. This highlights the
lack of a good subscriber management in the MSC code.
2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther 90c0aff174 paging: Handle the possible OOM message as well. 2011-01-06 14:52:53 +01:00
Holger Hans Peter Freyther 52ffb922c4 sms: Improve the logging of the paging callback. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 451eb29e37 subscr: Add a vty option to kick the queue. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 763b42a92a subscr: Dump the pending requests to help with debugging state. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 68c3bf6de8 subscr: Store the state of a subscr request for inspection. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther c02b12086c subscr: Fix subscr leaks in the KI code. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther fc857414ae subscr: Make it possible to clear pending requests for a subscriber 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther ebdd3cbd89 subscr: Show the number of pending requests on this subscriber. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther ffccb77df0 subscr: Stop all paging requests if one is failing.
If one paging request is timing out the others will timeout soon
as well. With the current code the next timeout would expire the
next request in the queue. We will now stop all paging requests
and then issue a next paging request. So for both paging success
and failure we will now stop all the other requests.

This is mostly a workaround, one should count on how many
BTSes we are paging and wait for all failures before we remove
the item from the queue.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther f72b3d51fc subscr: Kick the queue in case of a paging timeout
Kick the queue in case the paging was timing out. No one is going
to call subscr_put_channel for us so we will do it on the subscriber.

There is also another problem with multiple BTS in the LAC and paging
timeout. We will need to remember how many BTSes we have paged.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther c29043ea24 msc: Attempt to fix a bug with 'stuck' SMS due RF failure on auth
If we have a RF failure between the paging response and the auth
success we will not inform the subscriber layer of the failed paging
and instead just 'drop' the SMS. In case we have not completed the
auth and close the channel we will now send an auth failure.
2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 701076e9d3 sms: Add new SMS requests to the end of the list. 2011-01-06 14:52:52 +01:00
Holger Hans Peter Freyther 96e9f08101 sms: Argh... reset the pending after we have cleared the queue. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 79eff7eeff sms: Fix crash by saving the gsm_network
The conn might be released during the loop and then conn->bts
is a null pointer and we end up crashing. Store the gsm_network
in a local variable and access this one.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 583e9aef33 sms: Show the amount of failures and the SMS we want to send.
Improve the debugging possibilities and print the failed attempts
and the sms that was attempted to be delivered. this should help
with debugging the code.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther dc53af6721 sms: Fix the log message and end with a new newline. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 725966d9b4 subscr: Make the subscr_put_channel work with the subscr
The active channel might or might not be gone when the transaction
has been released. Instead of passing an invalid subscriber conn
we will pass the subscr that is ref-counted and guranteed to be
valid at this point. subscr_put_channel could search the connections
for an active connection if that is ever needed.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 8e3eb584a8 mncc: Do not print the BTS at all as it might not be present
In contrast to the previous believe we may not have a conn here
as we are still paging for the sub. Instead of printing the BTS
print the lac where we think the subscriber is located.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther b56a6bbc55 mncc: bts can be NULL, attempt to find the bts from the transaction
Follow trans->conn->lchan to the BTS instead of using the BTS that
is guranteed to be NULL in the codepath we have entered here. The
trans->conn should still be there, and the lchan should be valid as
well as we have reordered the clear statements.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 50c5ff7b94 mncc: Do not use bts->nr as it might be NULL. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther ebd50a6fd2 bsc: Clear the hand-over in case the new_lchan is failing
When the new_lchan for handover is failing we should stop the
handover operation. This is fixing a crash that we get a timeout
on the lchan and have no conn set to it. Introduce a flag to
the bsc_clear_handover to not free the lchan. In case the ho_lchan
is failing we do not want to call lchan_release as it would
reset the state.
2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther f1ba09b2e6 misc: Remove unused variable from the function. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 1cc7184bc9 misc: Fix compiler warning about incompatible pointers 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther 02d45c00f5 misc: Fix warning about the cast. 2011-01-06 14:52:51 +01:00
Holger Hans Peter Freyther f4152d1025 misc: Remove unused variable from the db. 2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 54146271b6 misc: Forward declare the struct gsm_bts_trx_ts to avoid warning. 2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 913bc032b9 mncc: Move the cc_tx_to_mncc code into the libbsc.a
The trau_mux likes to call cc_tx_to_mncc for each received
frame from the E1 link. Using a signal for each audio frame
is messy as well. The best thing I could think of is to put
this into the BSC to deref the pointer. The other option would
be to include the gsm_data.h in the mncc.h header and have
the method as inline.
2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 59234a3eb2 mncc: Switch the header file from u_int to uint
Include stdint.h to have the C99 data types.
2011-01-06 14:52:50 +01:00
Holger Hans Peter Freyther 6c4d2443b4 rtp: Move the RTP Proxy code out of RSL into the BSC/MSC domain
Instead of creating the sockets in the RSL code we will do this
in the CRCX_ACK, MDCX_ACK, DLCX_IND signal handler of gsm_04_08.
Introduce a handover signal so we can repatch the RTP sockets in
the gsm_04_08 as well.
2011-01-06 14:31:16 +01:00
Harald Welte 04d362f79d fix spelling mistake in log message 2011-01-01 17:28:55 +01:00
Harald Welte 6349b7f15e re-order the sequence of events in bsc_api:handle_release()
This should make sure conn->lchan is valid throughout the release
cause, especially make trau_mux_unmap() happy that conn->lchan
still exists.
2011-01-01 17:28:49 +01:00
Harald Welte 624e89d3f7 [db] Fix double-quoting in libdbi backend 2011-01-01 17:28:43 +01:00
Harald Welte b854b29e32 MNCC: avoid segfault in DEBUGP due to non-existing conn->lchan 2011-01-01 17:28:38 +01:00
Harald Welte f0901f0067 [SGSN] Fix processing of RA Update Request regarding TLLI
In case we get a RA UPD REQ on a new cell (both served by the same
SGSN), the LLC stack should not allocate a ne LLE/LLME, as the latter
would reset the V(u)sent / V(u)recv to zero and make the MS discard
our responses.

Instead, whenever the LLC stack sees a foreign TLLI, it should always
convert it to the local TLLI before doing any lookup for a LLE/LLME.
2011-01-01 17:28:29 +01:00
Harald Welte 91c59c8cb5 MNCC: fix copy+paste mistake in log message and change it to DEBUG 2011-01-01 17:23:43 +01:00
Harald Welte eb76c7a93f mncc_sock: Fix potential segfault in case MNCC app dies
We create a loop by not setting trans->callref = 0 before calling
trans_free(), as the latter would again send a MNCC_REL_IND up
the stack.

Also: Fix memory leak in case we try to read from mncc_sock
but socket is just gone.
2011-01-01 17:23:43 +01:00
Harald Welte 0d6f930785 mncc_sock: Use proper logging directives and levels, don't printf. 2011-01-01 17:23:43 +01:00
Harald Welte 02d9966053 MNCC: Introduce bsc_hack argument '-m' for enabling MNCC socket 2011-01-01 17:23:42 +01:00
Harald Welte ea057d9350 mncc_sock: Add new 'mncc handler' function
This adds mncc_sock_from_cc() as a handler function for CC messages
to be passed to the MNCC interface.  If there is no MNCC socket
registered, we immediately release any CC related messages.

Together with flushing all established CC transaction at MNCC socket
close time, this ensures that all resources are released and no
new resources can be established until the MNCC applicaiton has
re-attached.
2011-01-01 17:23:42 +01:00
Harald Welte 29b64e9708 MNCC: pass the actual 'struct msgb' down the mncc_recv() callback
this is required as we no longer have a dequeue-handler that can take
care of free()ing the message after passing it to the MNCC handler.
2011-01-01 17:23:42 +01:00
Harald Welte 04dc88fb9d GSM 04.08 / MNCC interface: verbuse logging of incoming MNCC primitives 2011-01-01 17:23:42 +01:00
Harald Welte 371efe5955 mncc_sock: Clear all calls if MNCC application (LCR) disconnects 2011-01-01 17:23:42 +01:00
Harald Welte 49a2ddeec0 mncc_sock: Add an assert() in case our queue peek trick goes wrong 2011-01-01 17:23:42 +01:00
Harald Welte e8e432dd59 MNCC: remove 'upqueue'
The MNCC messages now again get directly handled by the net->mncc_recv()
callback.  If the callee wants to put them in a queue, it' his business
to do that.
2011-01-01 17:23:42 +01:00
Harald Welte fea236e27c MNCC: move cc_tx_to_mncc() from gsm_data.h into mncc.c 2011-01-01 17:23:41 +01:00
Harald Welte 31bbbf4e52 MNCC socket: Export MNCC interface via unix domain socket
Using this code we will soon be able to use LCR or other MNCC
applications via a unix domain socket.

The code is not actually used yet after this patch.
2011-01-01 17:23:41 +01:00
Harald Welte 76556376c3 MNCC: rename mncc_send() to mncc_tx_to_cc()
This name clearly indicates: MNCC api transmits to Call Control,
i.e. down from the L4/application into the L3 04.08 code.
2011-01-01 17:23:41 +01:00
Harald Welte 3e6376d20d MNCC: split into generic mncc.c and mncc_builtin.c
The built-in code to handle call switching inside OpenBSC is
now in mncc_builtin.c, whereas some core/utility functions remain
in mncc.c
2011-01-01 17:23:41 +01:00
Harald Welte 081e14d071 MNCC: make get_call_ref() function static 2011-01-01 17:23:41 +01:00
Harald Welte e6da14fde4 MNCC: clarify naming / rename mncc_recv() to int_mncc_recv()
the int_ perfix (internal) symbolizes that this is the internal
MNCC handler code, receiving messages from the MNCC interface point.
2011-01-01 17:23:41 +01:00
Harald Welte 54209c2dce MNCC: rename mncc_upq_enqueue() to cc_tx_to_mncc()
The new function name clearly indicates: The Call Control
(TS 04.08, msc-side in OpenBSC) wants to transmit something to the
MNCC interface.
2011-01-01 17:23:41 +01:00
Harald Welte 9af6ddfcec License change: We are now AGPLv3+ instead of GPLv2+
The reason for this is quite simple: We want to make sure anyone
running a customized version of OpenBSC to operate a network will
have to release all custom modifiations to the source code.
2011-01-01 15:39:34 +01:00
Holger Hans Peter Freyther 08eebd59b7 lchan: Every SS_LCHAN signal now sends a struct lchan_sig_data
The SS_LCHAN signals now always include the lchan_sig_data. For
the measurement report it will optionally include the measurement
report as well. Attempt to update all handlers of this signal as well
2010-12-27 13:32:20 +01:00
Holger Hans Peter Freyther 9ae7b29e3a bsc: Some S_LCHAN signals don't provide an lchan
Check the signal and only continue if it is any of the
signals we want to handle. In the case of measurement
reports we would cast some random code to a lchan.
2010-12-27 12:30:12 +01:00
Holger Hans Peter Freyther 59f787a4c1 auth: Release the security operation after we sent out a message
The release might release the lchan we want to send the response
on. Reorder the code to first send the message and then give up
the security operation which might release the lchan.
2010-12-27 10:58:55 +01:00
Holger Hans Peter Freyther 8ce8d3a00d bsc: Avoid crashing when no lchan is present in the subscriber connection
If someone wants to send a message but we have no lchan anymore
we will now complain, delete the message and return.
2010-12-27 10:58:55 +01:00
Sylvain Munaut cfcf7e84bd gsm_04_08_utils: Fix Channel Request mode for e0/e0 and neci=1
According to the specs (GSM 04.08 Table 9.9), the only possibility
if neci=1 and this cause is used is "Originating call and TCH/F is
needed"

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-27 00:59:23 +01:00
Holger Hans Peter Freyther f64a20f2e8 db: Quote the IMEI string before passing it into the database. 2010-12-26 21:19:29 +01:00
Holger Hans Peter Freyther 9d3e2ec698 ho: Access the network after we are known to have an entry. 2010-12-26 21:19:29 +01:00
Holger Hans Peter Freyther c839667324 ho: Set the conn to NULL before calling lchan_release
In case we fail to activate the lchan set the connection to
NULL before calling the lchan release function.
2010-12-26 21:19:28 +01:00
Harald Welte 019d0167b6 [db] Properly quote name and extension for SQL access 2010-12-26 19:20:15 +01:00
Harald Welte c728eeaf9b SGSN: Avoid duplicate MM contexts in case MS and SGSN disagree on P-TMSI 2010-12-26 19:20:07 +01:00
Harald Welte a9b473a3c2 SGSN: Implement network-initiated PDP CTX DEACT when GGSN restarts
If the GGSN restarts, its restart counter will increase.  We can
detect that and accordingly release/delete all PDP contexts for
that GGSN.
2010-12-26 19:20:03 +01:00
Harald Welte 3357add225 SGSN: some more comments 2010-12-26 19:19:56 +01:00
Holger Hans Peter Freyther 5479fc80d5 sms: Make sure that this loop is broken from time to time. 2010-12-26 09:40:49 +01:00
Holger Hans Peter Freyther 203845730f sms: Rewrite the queue to find SMS harder.
With the old code it was possible that we first saw SMS that
we have already in the queue. In that case we had free slots
available but have not filled them. With his new loop we try
harder to find SMS we can send, it attempts (and should work)
to detect a loop to break the loop before finding SMS to deliver.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther f7e2389eb6 sms: Move the finding of the next SMS to handle to a new method
Prepare changing the loop to fill all the available slots. Set
the last subscriber based on the SMS query.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther a37e3bc39a sms: Change the default values for the sms_queue
Increase the number of SMS we will try to send at a time and
decrease the failures we handle before going to the next item. With
the default timeout we will attempt to page the subscriber for 60
seconds and we can increase the queue speed by going to the next
item faster.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther a3a659ba5c sms: Workaround a bug in the db layer and update the data
The sync with the database might fail. Reread the updated
subscriber after we have written it. The source of this
failure is unknown.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther 445e615d03 sms: Always go through the database and the smsqueue to send messages
This is also fixing a memory and subscriber leak. Make sure to
always release the gsm_sms structure.
2010-12-26 09:40:48 +01:00
Holger Hans Peter Freyther 994dcbb201 sms: Allow setting amount of failures through the vty. 2010-12-26 09:40:30 +01:00
Holger Hans Peter Freyther 7e59c83d66 sms: Make the amount of failures configurable as well. 2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 4dcc5e5f8a sms: Add vty command to clear the pending message 2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 3c6f6c25a6 sms: Make the max_pending tunable via a vty runtime setting
Make it possible to change the max pending via the vty. This
can be useful to play with the performance of the queue.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 7a0e166fb0 sms: Add vty command to trigger running the queue.
Allow to manually trigger running the queue. This can be useful
if SMS were manually added to the database or such.
2010-12-26 09:40:03 +01:00