Commit Graph

2319 Commits

Author SHA1 Message Date
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
Holger Hans Peter Freyther 81c0e2582f sms: Provide some simple vty command for the state of the SMS queue 2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 17164061a6 sms: Begin sending SMS messages, handle failures
The sms queue will attempt to send one SMS per subscriber
to fill all the available slots. It will handle the case
where paging has not started, timed out or if there was
any kind of other failure. It is also retransmitting SMS
in case of failures.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 11b28f9c26 sms: Introduce a SMS queue that will be responsible for delivery
The SMSqueue will be responsible of sending to the user. It will
do so in a loop and will also try not to overload the BTS. This
means the throughput of SMS will be limited.
2010-12-26 09:40:03 +01:00
Holger Hans Peter Freyther 04144c1905 sms: Create signal data for SMS with more information
This is providing access to the paging result, the sms,
the transaction. This will allow the SMS queue to do
decisions based on the source of the failure.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther 0eb7666efa sms: Dispatch a failed signal in many of the MT-sms points
This attempts to dispatch a signal whenever a MT-sms is failing. In
some cases, e.g. with freeing the transaction, this will also happen
for MO-sms.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther 41c5aaf62c sms: Use the SMS in the signals where it makes sense.
The signal_data was inconsistent. Sometimes we passed the transaction
and sometimes we passed the sms. Change it to always pass the sms. The
S_SMS_SMMA is a bit special as it does not involve any SMS.
2010-12-26 09:40:02 +01:00
Holger Hans Peter Freyther dd715bd2ee sms: Fix a small typo. 2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther 73b878a85a db: Introduce a limit in delivery attempts for the SMS search
We do not want to attempt submitting SMS that has failed for
too many times. The failure could be due RF failure or due
a bug in the message handling.
2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther 812dad0ff7 db: Add method to load a SMS by id. 2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther e25445b864 subscr: Sync the database before sending the attached signal
If a signal handler accesses the database he will still see
the old lac. Make sure he is seeing the new one. Update the
subscriber from the database in case the query failed or other
things have changed.
2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther 3d76e44968 subscr: Print the lac of the subscriber. 2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther d3baf415b1 paging: Introduce a GSM_PAGING_BUSY event for a special timeout
Start counting the attempts of each paging request and call
the callback with the PAGING_BUSY type when the paging request
timed out but the subscriber was not paged at all. This can
only happen with a huge paging backlog.
In case the system has so many pending paging
2010-12-25 21:39:04 +01:00
Holger Hans Peter Freyther abd0cac0c5 subscr: Add a VTY command to update the subscriber from the database. 2010-12-24 21:40:48 +01:00
Holger Hans Peter Freyther c577ca1822 subscr: Add VTY command to purge subscribers that are held in memory
Call the subscr_purge_inactive function and mention how many
subscribers were removed from the RAM.
2010-12-24 21:40:48 +01:00
Holger Hans Peter Freyther ae9006aeed subscr: Introduce VTY option to keep subscribers in ram. 2010-12-24 21:40:48 +01:00
Holger Hans Peter Freyther f694d5f47a subscr: Introduce subscr_purge_inactive to free unused subscribers
Introduce a method that will remove all subscribers that have a
zero use count. This is useful if someone wants to purge subscribers
from memory or wants to disable the everything in RAM feature.
2010-12-24 21:40:47 +01:00
Holger Hans Peter Freyther daee5ca7c1 subscr: Make it possible to keep subscribers in RAM.
This is implemented by not freeing the subscriber when the
reference count becomes smaller than zero. We hope that this
will save many database accesses during the congres.
2010-12-24 21:40:47 +01:00
Harald Welte a29e43a26f BSC Call Control: Actually implement call statistics
The existing call realated statistics counters apparently were
never used.  This introduces a new set of counters, two for the
MO and MT case.
2010-12-24 16:07:40 +01:00
Harald Welte 75e2defc7f BSC VTY: Print some more of the already-generated statistics 2010-12-24 16:07:35 +01:00
Harald Welte eafe22ca72 SGSN / GMM: Only allow non-roaming IMSIs
As we do not yet use the HLR from the SGSN, we allow all MS to
attach to our GPRS network.  However, if this is running in a public
environment, it could cause service interruption to users of commercial
GPRS networks.

Thus, we now check if the first 5 digits of the IMSI match the MCC/MNC
of the cell that they want to register to.  Thus, any subscribers with
SIM cards from real operators will no longer be accepted.
2010-12-24 15:42:26 +01:00
Harald Welte 2cafc4b309 BSC API: Make 'Got data in non active state' message as LOGL_INFO
LOGL_ERROR will make this message shpw up in everey default log
config.  However, as it seems, this is commonly observed in case
a MS still sends a MS STATUS (in respons to the MM INFO) at the
end of a location area update.

It might be best to actually change the channel release procedure
to make sure we can still pass such 'late' data to the MSC until
the time the Layer2 has been completely released.
2010-12-24 15:42:22 +01:00
Harald Welte 3a3c277b70 RSL: Make "waiting for SAPI=%d to be released" LOGL_DEBUG 2010-12-24 15:42:17 +01:00
Harald Welte b29cea1d9c Fix some stupid typos resulting in compile errors. 2010-12-24 12:26:13 +01:00
Harald Welte 712ddbcd72 BSC VTY: Fix off-by-one / segfault in 'show bts NR' 2010-12-24 12:24:03 +01:00
Harald Welte 85bded8b50 BTS VTY: Order bts-trx-ts-lchan in 'show lchan' 2010-12-24 12:22:34 +01:00
Harald Welte cd103a9a5d BSC VTY: Print the current mode of a dynamic TCH/F / PDCH 2010-12-24 12:14:52 +01:00
Harald Welte 026b4cab36 BSC VTY: Change order of elements in 'show timeslot' command
It's not logical to first show TS, then TRX, then BTS.  It should
always be ordered from big to small (BTS, TRX, TS)
2010-12-24 12:12:10 +01:00
Harald Welte 127af34eea BSC VTY: Remove extraneous 'else' from write_ts_single()
This caused the E1 parameters not to be displayed in case the channel
was using frequency hopping.
2010-12-24 12:07:07 +01:00
Harald Welte 274d015cbb BSC VTY: Fix 'show timeslot' command if BTS and/or TRX are specified 2010-12-24 12:05:03 +01:00
Harald Welte f6bd340df6 GPRS/GMM: Correctly look up MM Context in RA Update
If a MS changes RA, the RA will arrive in the new cell using the old
TLLI (masked as foreign TLLI).  So we need to look-up the TLLI
in a special way, using the old RA as indicated in the 04.08 GMM
message.

There is still another bug remaining: As we somehow create a new LLC,
the sequence numbers of our responses start from 0 again, which is not
what the MS expects.  This needs to be fixed in a follow-up patch.
2010-12-23 23:38:02 +01:00
Harald Welte 082b01f18e More verbose logging of authentication internals 2010-12-23 23:37:49 +01:00
Harald Welte c9f499f7d3 IMM ASS REJ: Actually add t3122 parsing to vty code 2010-12-23 23:37:45 +01:00
Harald Welte 86dda08762 Authentication: use ENUM instead of magic numbers
This improves readability of the code...
2010-12-23 18:09:51 +01:00
Harald Welte 2862dcac58 Use 04.08 IMM ASS REJECT in case we run out of channels
If the user has a non-zero 'timer t3122' in the config file, we will
send an IMM ASS REJECT in case we run out of resources.
2010-12-23 14:41:50 +01:00
Harald Welte d0d2b0b605 Dynamic PDC: Add VTY comand 'bts N trx M timeslot O pdch [de]activate'
On a nanoBTS, this command can be used to manually switch a given 'dynamic
pdch/tch' timeslot from one mode into the other.

There are no safeguards that the timeslot is not in use at the given time.
2010-12-23 14:41:44 +01:00
Harald Welte 53cd7ac44c Dynamic PDCH: rsl_ipacc_pdch_activate() operates on a timeslot
... not on the lchan.
2010-12-23 14:41:40 +01:00
Holger Hans Peter Freyther d4e6872d6c gsm48: Release the LU procedure only after the TMSI REALL_COMPL
We send a LU Accept with the TMSI as the MI. According to the
spec the phone should store this new TMSI and send a TMSI
REALLOCATION COMPLETE to us. We will release the LU then and this
should trigger the release procedure.
2010-12-22 20:25:38 +01:00
Harald Welte 434bb3f39f MNCC: introduce mncc_upq_enqueue() wrapper around msgb_enqueue()
This wrapper will allow us to add queue related code at one single
location in the code as opposed to three locations.
2010-12-22 19:03:40 +01:00
Harald Welte 7ce5e259c9 mnccc.c: Add 2 line header describing what this file is all about 2010-12-22 19:03:40 +01:00
Holger Hans Peter Freyther f93e8fabd8 gsm48: Use NULL instead of 0 for pointers in C. 2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther 6003d6b928 rsl: Remove unimplemented/unused rsl_paging_cmd_subscr
RSL should not know the details of a GSM Subscriber anyway.
2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther 28dcbc5ee5 misc: Remove gsm_subscriber.h from the db.h file
Reduce the dependencies on the header files.
2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther c5faf66b82 misc: Reorder includes, move osmocore to the end 2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther 3547045c73 misc: Remove gsm_subscriber.h include to reduce dependencies. 2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther e2fee354cf misc: Include abis_rsl.h to remove some compiler warnings
This was introduced by a recent change to gsm_data.h to include
less header files. We really need to access the RSL information
here so it is fine to include the file.
2010-12-22 18:26:36 +01:00
Harald Welte c7782dec4a gsm48_tx_release_compl(): Don't use transaction after trans_free()
In commit 39e2eadc99 a bug was introduced
that used the 'trans' after trans_free() had already been called.

This became visible now when the openbsc+lcr combination was calling
an unknown/invalid telephone number in a MO call, resulting in
a segfault.
2010-12-21 19:33:19 +01:00
Holger Hans Peter Freyther d49fc5ae24 ts: Reduce the delay to 0 for OML and RSL
This is possible after not sending more than one OML command that
requires an extra ACK. For the RSL line we do not need any speed
limitation.
2010-12-21 13:53:42 +01:00
Holger Hans Peter Freyther d85642a1a7 ts Make the e1inp_ts delay configurable
Currently the nanoBTS bootstrap code requires a high delay
otherwise we are not bringing the device up properly. Changing
the init code turns out harder than it seems like. So this is
a workaround for that to allow a high speed RSL/OML connection
after the bringup.

The line driver can have a default TS delay. It is set to the
current default for the nanoBTS and the BS11. For the ipaccess
case we will set the delay lower for the RSL connection and
inside the ipaccess-config we can set it low right away to
have fast firmware flashing and such.
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther 6f615551a4 abis_nm: Band aid on OML initialisation by queuing messages
Instead of sending many messages we will queue the OML
messages and wait for the ACK/NACK before sending the
next message from the queue. We tag the msgb to remember
if we need to wait for an ack or not.

We keep the order of all messages, on ACKs and similiar
occassions we will drown the queue until we reach a message
that needs to be acked and then wait for that ack again.

Possible breakage can appear when we send an OML (e.g.
BS11 specific message) msg which does not need to be acked
through the abis_nm_sendmsg call. The fix will be to use
the _direct version of this method.

Re-Enable as it might have fixed something... who knows.

Conflicts:

	openbsc/include/openbsc/abis_nm.h
	openbsc/include/openbsc/gsm_data.h
	openbsc/src/abis_nm.c
	openbsc/src/gsm_data.c
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther 39e6ba09c2 oml: In case we get a NACK, drop the OML connection and hope for the best
Assume that a NACK is a onetime failure and that on the next
attempt it will work better. If that is not the case we might
even send a reboot to the BTS.
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther c7a1a1fd2e oml: Another band aid for reliable BTS init...
Sometimes the operative change for the NSE is getting nacked,
this might be due that we send it before we get the OPSTART ACK
for this object class. Send it from the CELL availability as
a workaround. This init code needs to be changed to make these
dependencies work more reliable.
2010-12-21 13:53:41 +01:00
Holger Hans Peter Freyther 2391b4c474 ho: On ho failure clear the subscriber connection
Forget about the ho_lchan inside the gsm_subscriber_connection
in case of a handover failure, also clear the gsm_subscriber_connection
pointer before the lchan is passed to the lchan_free routine.
2010-12-21 13:41:33 +01:00
Holger Hans Peter Freyther 90cdd28e6f ho: Make this allocation a child of the BSC talloc context
Do not use the NULL context for this allocation. It should hang
off the gsm_subscriber_connection but for now at least make it
the child of the BSC so it is showing up in the talloc report.
2010-12-21 13:41:33 +01:00
Harald Welte 63dbfc6a2b bsc_vty: Fix unknown 'use-dtx' config parser error
commit 5a3a61d88f introduces a DTX attribute
which is parsed as dtx-used, but written as use-dtx (and thus causes a parser
error).
2010-12-15 15:34:23 +01:00
Harald Welte f604bba026 osmo-bsc: Make it compile against paging_request_stop() api change
The additional msgb argument was introduced by Sylvain in
c7ff2572a7
2010-12-15 15:33:08 +01:00
Harald Welte ec073e9f5b bs11_config: more verbose output of ACK/NACK responses 2010-12-14 13:34:35 +01:00
Harald Welte 230cd6a720 bs11_config: fix help message about multi-drop (not 'port') 2010-12-14 13:28:43 +01:00
Harald Welte 5f5189e658 bs11_config: update copyright statement 2010-12-14 13:14:32 +01:00
Harald Welte f751a10018 bs11_config: show the BPORT0 / BPORT1 configuration in 'query'
This introduces abis_nm_bs11_get_bport_line_cfg() and a parser for the result.
2010-12-14 12:52:16 +01:00
Harald Welte 7e72fa0250 bs11_config: Add option to set BPORT1 in multi-drop mode 2010-12-14 12:35:59 +01:00
Dieter Spaar df30d40b98 Add mandatory routeing area IE to SUSPEND-NACK 2010-12-12 15:46:00 +01:00
Sylvain Munaut 8a31a3fcee paging: Dispatch the SS_PAGING signals at the MSC code level
This way the channel is fully ready for use.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:26 +01:00
Sylvain Munaut 5a86e06eb3 auth/ciph: Enable securing of channel directly after paging response
This protects MT services

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 23:04:26 +01:00
Sylvain Munaut 0fbfd1bb52 gsm_04_08: Make gsm48_secure_channel available globally
Can't declare it in gsm_04_08.h tough ... gsm_cbfn is defined in
gsm_data.h and trying to include that in gsm_04_08 just creates a
huge mess.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 567c8dc7c9 gsm_04_08: Use subscr_get_channel instead of directly paging_request
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut c7ff2572a7 paging: Give the msgb that caused paging_stop up to the paging callback
The handler might need to know some info of the paging response

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 1e24550d3d gsm_subscriber: Move the get_channel/put_channel logic in MSC part
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 67706df7c2 gsm_04_08: Don't set ciphering manually but call gsm0808_cipher_mode
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 20:36:34 +01:00
Sylvain Munaut e0b06b0293 bsc: Allow to configure Optional Cell Selection params from vty
The default values are those where the parameters are encoded
as '0' and they're not output in the config file if that case

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 20:23:34 +01:00
Holger Hans Peter Freyther fbceea4f0f bsc: Add a command to set the ussd_welcome_text
Make the USSD welcome text configurable.
2010-11-26 00:12:24 +01:00
Holger Hans Peter Freyther 414bc4a1f4 mid-call: Do not lose the first word of the message 2010-11-26 00:06:58 +01:00
Holger Hans Peter Freyther cf6f71aa7f mid-call: Make the mid-call behavior the default for switching things off
When switching the RF off we will always go through the grace
period, add a direct off mode to switch it off directly. Make
the query return a 'g' if we are in the process of switching
things over.
2010-11-26 00:06:15 +01:00
Holger Hans Peter Freyther 70c232f75a mid-call: Implement a timer to go from grace to off.
Start the timer... switch it off when we do the final
tranistion by a command.
2010-11-26 00:06:01 +01:00
Holger Hans Peter Freyther bb62b3f053 mid-call: Rename ussd-grace to mid-call 2010-11-26 00:03:32 +01:00
Holger Hans Peter Freyther 625b6e4dab mid-call: Introduce a timeout to switch from grace to rf off. 2010-11-26 00:02:12 +01:00
Holger Hans Peter Freyther d283db496f vty: For ipaccess we will dump if the OML connection is present 2010-11-26 00:00:22 +01:00
Holger Hans Peter Freyther dab8e27755 ipaccess: Fix dropping the OML/RSL connection.
Use the ipaccess_drop_oml and ipaccess_drop_rsl functions
instead of closing the socket and hoping this is picked up
somehow. This just leads to some weird hangs. And gdb was
not really helpful to say where it was coming from.
2010-11-15 20:30:38 +01:00
Holger Hans Peter Freyther b4e72f881c bsc: Implement queuing of messages to the MSC before the con is established 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 16e958dc68 bsc: Use the BSC Filter to stop a paging_request 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 9c838ae069 bsc: Implement paging by creating a dummy subscr for the paging
In the future we should avoid using a gsm_subscriber at all
and pass the imsi/tmsi to the paging function directly. For
now we can use the old model for paging and go through the
gsm_subscriber. This has the benefit of load balancing on
the BTS and such.
2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther b79c3c97a2 bsc: The ip.access rtp-payload has no useful meaning
Sending this as the RTP_PAYLOAD2 will produce a MDCX NACK
as we send the RTP_PAYLOAD in the CRCX. It does not seem to
be necessary to send anything != 0 for the RTP_PAYLOAD2.
2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 620c2e678a bsc: Add thr audio module to send the MDCX message to the BTS 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther dbc698aef0 bsc: Implement DTAP coming from the MSC and forward to the BSC API 2010-11-15 20:06:50 +01:00
Holger Hans Peter Freyther 50c579b8c5 bsc: Implement the assignment command to the point of calling into the BSC API 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther fae3c65938 bsc: Parse the cipher mode command and pass it to the BSC api. 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther f1f57a84c1 bsc: Parse the CLEAR COMMAND and close the lchan and ack that 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 863a55d44d bsc: Make bsc_queue_for_msc work on the osmo_bsc_sccp_con
The gsm_subscriber_connection can die before the SCCP connection
so we should work on the osmo_bsc_sccp_con.
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 890dfc58ed bsc: Work on paging and parsing other messages
The paging is not implemented due bad/missing API in the
BSC API, the rest are simple stubs to be merged from the
on-waves/bsc-master.
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 3485feb49b bsc: Add module for handling BSSAP input
The current implementation is a stub. The code from
bssap.c of on-waves/bsc-master will be migrated into
this new structure
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther cf256d678f bsc: Implement sending a SCCP CR with the complete layer3 data 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 933daaa016 bsc: Implement SCCP connection confirmed handling. 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther af4b5fb13e bsc: Implement clearing the SCCP connection 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 57d304871e bsc: Implement writing out UDT messages to a MSC Connection 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 00f4cc22c8 bsc: Implement closing the connections when the MSC goes missing
Refactor the closing code of the CC timeout to a new function,
also make sure that the SCCP Connection is forced closed before
we destruct the connection for real.
2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther ca5c022a32 bsc: Implement sending a message toward the MSC. 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther c97d9b4df1 bsc: Implement a CC timeout and the IT timeout, prepare the timers 2010-11-15 20:06:49 +01:00
Holger Hans Peter Freyther 7e9010892d bsc: Make open/close work on the sccp data 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther b8781d2cd5 bsc: Start to open a SCCP connection and prepare timers and such. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 9b17c769b9 bsc: Work a bit on opening the SCCP connection to the MSC.
Most of the code is still stubs but the structure is a lot
cleaner than the one in the on-waves/bsc-master branch.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 2a8675e49a bsc: Add a mobile country code setting for the backbone. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 52d42abdb7 bsc: Implement scanning and changing messages from the MSC
This will change the LAI of a LU accept message to the LAI
used for the on-air network. It will also detect when to
send a welcome ussd to the subscriber.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther a54732d19d bsc: Add a method to scan messages coming from the MSC. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther d65305f5b4 bsc: Look for location updating requests in messages
Introduce the SCCP connection data and remember that
we were seeing a location updating request from a
different LAC.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 5bb874d2f5 bsc: Add a hook where we can scan for LU and other messages. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther cc48fb8083 bsc: Call into the SCCP layer to create a new connection. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 46c5ab3624 bsc: Reduce duplication with a macro. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther e46f1d6cc4 bsc: Implement sending an assignment failure 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther c2b3270e93 bsc: Send a Clear Reques on RF Failures to the MSC. 2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther c8166f3a91 bsc: Implement sending a SAPI n Reject.
It is not clear that the link_id is setup correctly here.
2010-11-15 20:06:48 +01:00
Holger Hans Peter Freyther 58f2cf6494 bsc: Implement the DTAP callback and forward the data to the MSC 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther da488ae343 bsc: Implement sending the assignment complete to the network 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 2d2c910f2c bsc: Implement sending a Cipher Mode Complete message 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 4582586e24 bsc: Add a method that will queue the message on a MSC connection. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 7225fd18e0 bsc: Add some basic checks to see if a SCCP connection is established 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 1999cf11b9 bsc: Complain about unimplemented stuff. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 77cd95d5b5 bsc_api: Implement the assignment command for the BSC. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther f05750ca24 bsc_api: Rework the signal handler to be extendable 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther abf962b096 bsc_api: Clear lchan->conn on lchan_release
Set conn to NULL before starting the release procedure, remove
code to check for a lchan->conn as it can not happen. If there
are any memleaks we will notice them.
Detach the lchan->conn from the channel before detaching.
2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 8d216c7756 bsc_api: Clear the conn->lchan before calling subscr_con_free 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther a2e5cb8601 bsc_api: Clear the conn of the failed lchan to avoid a runtime warning 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther a2828fa4bc bsc_api: Set the lchan->conn to NULL in all of the cases 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 088dde8173 bsc_api: Send a channel modify when we already have a TCH. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 7e50c8140b bsc_api: Plug a theoretical window for the RLL callbacks
The timedout could come between lchan_release and the
S_CHALLOC_FREED signal. In the future we might want to
use the gsm0808_clear to stop the RLL timeouts and such.
2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 8d380dcadd bsc_api: Change submit dtap to allow to automatically use the SACH
For SAPI=3 on a TCH it might be nice to use the SACH to submit
the message. The api allows to automatically use the SACH if
a message like this is submitted.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 2603c1f545 bsc_api: Clarify the parameters of the assignment command 2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 4be7d41a50 bsc_api: Implement sending the cipher mode method
This will set the encryption algorithm, key and then
send the RR Cipher Mode message to the MS. The method
is also verifying the input.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 2f169d64dd bsc_api: Make the cipher_mode take the 'include imei sv' argument
The cipher mode command should enable encryption and send the
right RR message to the other side.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 45b575fd94 bsc_api: The rr_cause is optional, pass it as a pointer 2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 66dcd925c6 bsc_api: Nuke the clear complete from the API.
There is no place where it can be called. Whoever is calling
the gsm0808_clear method should generate the clear complete
as the result.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 46caa3048d bsc_api: Provide the link_id in the dtap callback. 2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther b094171c9f bsc_api: Add needed parameters to the assignment complete callback
Provide the chosen channel and more information in the assignment
complete method.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther e1996f013c bsc_api: The cipher mode is not a message on the air interface
The cipher mode reject will be send in case the BSC is not
able to support the requested cipher. So this reject can be
handled by however attempts to enable ciphering.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 6c199e7d99 bsc_api: Look into the msg and call the right API functions
For certain messages we will need to call other GSM0808 functions. To
keep the bsc_hack working we will try to send this through the normal
messages first and then fallback to dtap if no handler is registered.

The gsm_04_08.c code is not forced to handle the IPA activation
and channel modify ack anymore. This is done transparently by the
BSC API now.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther fce9307553 bsc_api: Change the cause to a uint8_t for now
The RR Cause can only be one byte. Change from uint16_t to uint8_t for that.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 05c68841a8 bsc_api: Fix a use after free error in the Clear Request path
The implementation of bsc_hack would call subscr_con_free before
the BSC API has had the chance to call gsm0808_clear to try to
release other channels. Fix that by adding a return value.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 85334f1309 paging: Move the paging data into the paging.h 2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther 8dfd241bc6 subscr: Add method to find an active subscriber
This is used by the paging code of the osmo_bsc. When we get
a paging response there should be an active subscriber with
the TMSI or IMSI and we can stop paging. There is no need to
allocate a new subscriber.
2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther d740b688dc subscr: Add the subscr_get_or_create from the on-waves/bsc-master branch
Create a subscriber based on a known IMSI, search the list of
active subscribers if there is already someone like this.
2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther 8cc59036e6 rsl: Allow to hardcode the RTP Payload
In case of a inflexible network it is better to hardcode
the rtp payload to a given type. E.g. when using AMR5.9 on
a TCH/F and TCH/H having the same payload is helpful. For
now this will be only used by the osmo-bsc.
2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther ecd94a4b45 misc: Introduce a --enable-coverage mode to build with gprof coverage
This adds a test coverage build. One can use gcov and lcov on the
resulting data afterwards to see which code paths were executed and
which were not.
2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther 0b369c582b e1_input: Fix compiler warning by using offsetof
Use the offsetof/__builtin_offsetof to determine the
offset of a variable inside a structure instead of going
via a NULL pointer and taking the address.

This fixes:
warning: variably modified ‘dummyhalen_offset’ at file scope
2010-11-09 23:11:29 +01:00
Holger Hans Peter Freyther 1406977e7e nat: Verify that the endpoint from the assignment command exists
Make sure that the MSC endpoint exists on the NAT, otherwise
we end up trying to free this endpoint when the SCCP connection
is taken down and will corrupt our memory. This issue started
to pop up as we have reduced the number of endpoints to 60
to allow transcoding on them.
2010-11-04 17:14:41 +01:00
Holger Hans Peter Freyther f3d1ae7072 bsc: Add simple SCCP binding code. 2010-11-03 16:40:03 +01:00
Holger Hans Peter Freyther 0425c38feb bsc: Fix crash when making a MSC connection.
Use the right types that are passed as void..
2010-11-03 14:46:56 +01:00
Holger Hans Peter Freyther 7bf66c5a6e bsc: Add the audio codec list command to list preferred codecs 2010-11-03 13:56:27 +01:00
Holger Hans Peter Freyther fe16622bf5 bsc: Add the rtp-base command to osmo-bsc 2010-11-03 13:56:26 +01:00
Holger Hans Peter Freyther 45f9e69ac5 bsc: Add the ip.access rtp-payload command known from bsc_msc_ip 2010-11-03 13:56:26 +01:00
Holger Hans Peter Freyther 4de1116356 bsc: Readd the core network code setting
This will instruct the BSC to patch messages and replace
the old network code with the new one.
2010-11-03 13:56:26 +01:00
Holger Hans Peter Freyther 5b848f37cf bsc: Fix the name of the local vty variable. 2010-11-03 13:11:14 +01:00
Holger Hans Peter Freyther 8b19dee437 mgcp: Send data from the network to the transcoder too
We now should be able to transcode in both directions.
2010-11-02 19:08:09 +01:00
Holger Hans Peter Freyther 5f2cd84281 mgcp: Use the calculated remote port from the mgcp_rtp_end 2010-11-02 19:08:09 +01:00
Holger Hans Peter Freyther 3f29cc8303 mgcp: Make the transcoding forwarding work for BTS/NET
Share the implementation for the transcoded packets and
forward them to the network and the bts.
2010-11-02 19:08:09 +01:00
Holger Hans Peter Freyther 386a940736 mgcp: Refactor the network binding routines
Create another wrapper function that takes most of
the arguments from the caller.
2010-11-02 19:08:09 +01:00
Holger Hans Peter Freyther bd7b3c5e45 mgcp: Introduce trans_bts and send BTS packets from this port
Introduce the trans_bts. Right now only a port is allocated
and the packets from the BTS are sent from this socket.
2010-11-02 19:08:09 +01:00
Holger Hans Peter Freyther e97155a2af mgcp: Keep the local_port like it was set on allocation
Do not reset statically allocated local_port. The port
might be different to the calculation of endpoint number
and base port. This might be the case for the coming remote
transcoding.
2010-11-02 19:06:13 +01:00
Holger Hans Peter Freyther 2126233590 mgcp: Rename transcoder_end to trans_net
Packets arriving for trans_net will be send out to the
networking. We will introduce a trans_bts in a second.
2010-11-01 21:15:55 +01:00
Holger Hans Peter Freyther 88b597e21c mgcp: Allow to disable the transcoder in a running system. 2010-11-01 21:15:55 +01:00
Holger Hans Peter Freyther b54048fe25 mgcp: Make transcoding a per Endpoint configuration
This allows to switch off transcoding on the fly, or only enable
it for certain vessels with known problems.
2010-11-01 21:15:55 +01:00
Holger Hans Peter Freyther fbca4ea117 mgcp: Fix the indetion of this code. it should use tabs 2010-11-01 21:15:55 +01:00
Holger Hans Peter Freyther 43eb1a3db0 nat: Send a clear command in case of connection releases.
This should help the BS+ to release RF channels earlier.
2010-10-29 17:05:28 +02:00
Holger Hans Peter Freyther d414c06fd9 nat: Fix a thinko in allowing '*' as a wildcard...
We need to match everything BUT the wildcard and then
do the normal strcmp...
2010-10-28 13:51:28 +02:00
Holger Hans Peter Freyther 732d9c19bf Merge branch 'zecke/number-rewrite' 2010-10-27 12:41:19 +02:00
Holger Hans Peter Freyther c4fd45ccf1 Merge branch 'zecke/ussd-side-channel' 2010-10-27 12:37:42 +02:00
Holger Hans Peter Freyther a8a50a87ea nat: Also send a Clear Command in case of the USSD Provider dies 2010-10-27 12:02:21 +02:00
Holger Hans Peter Freyther 54f5352e07 nat: Close SCCP connections when the USSD Provider is closed.
Send a RLSD down to the BSC in case the USSD Provider is gone. It
is not sending a Clear Command and ut depends if the BS+ will
like this kind of behavior. At least the data on the NAT will
be freed soon afterwards due the RLC message.
2010-10-27 11:01:55 +02:00
Holger Hans Peter Freyther 07dfc70276 nat: Make clear where the RLSD is send to
Add a _msc to the method as we will send a RLSD to the
MSC and will add a method to send it down to the BSC
as well.
2010-10-27 10:54:11 +02:00
Holger Hans Peter Freyther 643931db3d nat: Look at the number type to figure out if we want to rewrite it 2010-10-27 10:40:45 +02:00
Holger Hans Peter Freyther 1400310f05 nat: Explain that we do not want to have a + in the replacement rule 2010-10-27 10:40:44 +02:00
Holger Hans Peter Freyther 25adfceb3a nat: Add '*' as wildcard for the IMSI matching.
In case any rule has a '*' we will always match this
rule.
2010-10-27 10:40:44 +02:00
Holger Hans Peter Freyther 73bbf89245 nat: Implement rewriting, have a very basic test for that feature 2010-10-27 10:40:44 +02:00
Holger Hans Peter Freyther a914daf174 nat: Add hook for rewriting a setup message
Create a new function, hand the data to this function, take back
a possible modified msgb and invalidate parsed at this point.
2010-10-27 10:40:44 +02:00
Holger Hans Peter Freyther 76424392e0 nat: Add vty option for number rewriting
Parse a msg file in case we do have a list.
2010-10-27 10:40:43 +02:00
Holger Hans Peter Freyther 0586b0fa47 [vty] First set of fixes for the oml/rsl con dropping
The code had wrong documentation in the VTY, it crashed
when OML or RSL was not up yet. These issues are fixed
right now.
2010-10-26 09:44:21 +02:00
Holger Hans Peter Freyther 2484ceb2be [vty] Add ipa specific command to provoke failures to test OML/RSL reconnect
We need to simulate OML/RSL failure in an easy and fast way
and adding a command to do so seems like a good way to achieve
this. The command is a bit misplaced, in one way it is no config
and does not belong into the config node but then again it does
not belong into the VIEW_NODE either as it is manipulating content.

On this merge I have changed it to the ENABLE_NODE.
2010-10-26 09:40:13 +02:00
Holger Hans Peter Freyther 90bbccfca9 nat: Forward the data coming from the USSD module to the BSC. 2010-10-25 21:06:03 +02:00
Holger Hans Peter Freyther 4c401e7a1a nat: Forward extra state and the message to the USSD provider
Forward the SCCP state and the data to the USSD provider,
also mark the connection as local.
2010-10-25 21:06:03 +02:00
Holger Hans Peter Freyther c16c2dc5d3 nat: Implement accepting a USSD Provider connection, do authentication 2010-10-25 21:06:03 +02:00
Holger Hans Peter Freyther 64b12924bf nat: Replace the idiom for replacing a string with a function call
Remove a lot of code in favor of a new function that is freeing
the old string and copying the new one. I should have gotten the
context and the strings right.
2010-10-25 21:04:46 +02:00
Holger Hans Peter Freyther e393f273e7 nat: Keep a ussd token in the config
We will have the USSD provider connecting to us and we
will use the IPA protocol, including the auth mechanism.
2010-10-25 21:04:46 +02:00
Holger Hans Peter Freyther 3229f442f4 nat: Implement the matching of certain USSD messages
Have various checks, check if the IMSI should be handled,
if there is a USSD query set and then decode and compare
the value.
2010-10-25 21:04:46 +02:00
Holger Hans Peter Freyther c1578bc747 nat: Add an option to set the query string to match
Allow the query string to be set. The ussd matching code
will check for this string and then forward it to the bypass.
2010-10-25 21:04:46 +02:00
Holger Hans Peter Freyther c1cac1e31a nat: Make the imsi checking function public.
We will use this method in the USSD module to check if the
IMSI should be handled for USSD queries.
2010-10-25 21:04:45 +02:00
Holger Hans Peter Freyther d1effd835f nat: Provide a USSD access list to check for which to play HLR. 2010-10-25 21:04:45 +02:00
Holger Hans Peter Freyther 17870cf533 nat: Create a USSD module to filter out USSDs... 2010-10-25 21:04:45 +02:00
Holger Hans Peter Freyther 74dc303134 nat: Introduce a new connection type for Supplementary Services
If we have a CM Service Request we will look into the message
to see if it is a Supplementary Service Activation.
2010-10-25 21:04:44 +02:00
Holger Hans Peter Freyther a3967579f8 nat: Move the DTAP unpacking into a new method
DTAP unpacking will be used by the USSD checking code
2010-10-21 12:23:27 +02:00
Holger Hans Peter Freyther 749497eeb3 nat: Copy the IMSI, then free it or move the context to the connection
Extract the IMSI from the first message as well and safe it
in the connection structure. The problem is that we do not
have this structure at this point, so we will allocate the
imsi as child of the bsc_connection and then move/steal it.
2010-10-21 12:22:50 +02:00
Holger Hans Peter Freyther 8c78b480f9 nat: Store the IMSI inside the SCCP Connection data
Store the IMSI for the connections that we are tracking,
it will be freed when the normnal SCCP connection is freed.
2010-10-21 12:22:20 +02:00
Holger Hans Peter Freyther 1fd60631f7 nat: Change the order of the DENY/ALLOW rule for the BSC.
Currently it is not is not easily possible to disable
everyone and then only allow certain SIMs. By changing
the order we can do:
	access-list imsi-deny  only-something ^[0-9]*$
	access-list imsi-allow only-something ^123[0-9]*$

and still keep the usecase of only forbidding certain
SIMs on certain LACs. Adjust test case, test that the
other cases are still functional.
2010-10-19 20:55:33 +02:00
Holger Hans Peter Freyther a25d579ab9 nat: Convert the ip to host order to allow to bind to other ips 2010-10-19 17:48:13 +02:00
Holger Hans Peter Freyther 7e8da1379e nat: Add a method to add a proper message to the queue.
This will be used by the USSD module to forward the data
without creating another copy of the data.
2010-10-19 16:40:34 +02:00
Holger Hans Peter Freyther 3d38742d1c nat: Find a connection by the real ref 2010-10-19 16:40:17 +02:00
Holger Hans Peter Freyther f961de1108 nat: Use the make_sock routine to listen for incoming connections. 2010-10-19 16:40:04 +02:00
Holger Hans Peter Freyther a09b966cd4 nat: Use strncmp on the string in case it is not null terminated 2010-10-19 16:39:01 +02:00
Holger Hans Peter Freyther e383980a7e ipaccess: Make sure the unitid is null terminated
The nanoBTS is sending null terminated strings, make sure they
are really null terminated.
2010-10-14 22:05:52 +02:00
Holger Hans Peter Freyther d9e81d0fcf ipaccess: Verify that the data fits in the package.
There is something wrong with the code, the length is
here uint8_t but when we generate a IDGET we put it
as 16bit data.
2010-10-14 22:05:44 +02:00
Holger Hans Peter Freyther 949e0ba648 ipaccess: memset the tlv_parsed structure before parsing
Make sure the tlv_parsed structure is initialized properly,
otherwise we might detect a tag that should not be present.
2010-10-14 22:05:34 +02:00
Holger Hans Peter Freyther 69cfa179ef nat: Make the write_queue write callback a public function 2010-10-13 23:56:01 +02:00
Holger Hans Peter Freyther 4d44fc56e7 nat: Make the queue routine work on any write_queue 2010-10-13 23:55:52 +02:00
Holger Hans Peter Freyther 19c530c5e7 ipaccess: Put our extensions to the protocol into the same enum
Rename NAT_IPAC_PROTO_MGCP to IPAC_PROTO_MGCP and place it in
the enum. We need to be prepared to change this number if IPA
is ever going to use it for something else.
2010-10-13 23:55:32 +02:00
Holger Hans Peter Freyther 3e9a7f80bd misc: Replace the idiom for replacing a string with a function call
Remove a lot of code in favor of a new function that is freeing
the old string and copying the new one. I should have gotten the
context and the strings right.
2010-10-12 23:31:53 +02:00
Holger Hans Peter Freyther 9ecf678995 socket: Plug resource leak when the listen call is failing. 2010-10-12 23:29:16 +02:00
Holger Hans Peter Freyther 3cb287919e misc: Attempt to determine byte order in a cross-platform way
OSX does not provide an endian.h, use the other header files that
should define/include what we need. Also check that the byteorder
define is available.
2010-10-12 15:41:03 +02:00
Holger Hans Peter Freyther 88a5fa0a75 ussd: Catch up with libosmocore and pass the gsm48_hdr 2010-10-12 15:34:20 +02:00
Holger Hans Peter Freyther daa0fe7637 ussd: Move the code libosmocore, increase the version number.
Move the code to libosmocore, update the header file and the
version required in the configure.in.
2010-10-10 17:12:05 +02:00
Holger Hans Peter Freyther 0bd60f3317 nat: Allow a BSC to have multiple LACs
Make it possible that one BSC is serving multiple
cells. Introduce a list of lacs, add functions to
manipulate the lists. The current test cases for
paging by lac continue to work.
2010-10-08 22:21:46 +08:00
Holger Hans Peter Freyther fad0753b34 msc: Only unregister the fd if the fd value is valid.
This makes sure that someone can call bsc_msc_lost multiple times
even if there is no MSC connection. This makes sense as bsc_msc_lost
is public and be called from client code.
2010-10-07 06:07:57 +08:00
Holger Hans Peter Freyther d4eed5208f msc: Stop the connection timeout when we unregister the bfd
When we dropped the connection... stop the timer as we might
call bsc_unregister_fd twice...
2010-10-07 06:07:42 +08:00
Holger Hans Peter Freyther 85531cc60d misc: Once again go from "On Waves" to "On-Waves"..
Try to get the company name of our sponsor right...
2010-10-06 20:38:36 +08:00
Dieter Spaar d6613e05d7 [VTY] T3212 scaling is 6 minutes
The scaling of T3212 is in units of 6 minutes, not 10 minutes.
2010-10-05 21:10:55 +02:00
Holger Hans Peter Freyther 0c41b6933e nat: Possible crash fix, only filter non local connections
For local connections con_msc is not set and sending a RLSD
to the network would have ended up in a segfault.
2010-10-06 00:48:36 +08:00
Holger Hans Peter Freyther e8e41e611f nat: Work around trying to forward a msg to a msc that does not exist
Instead of segfaulting warn the user that the MSC Connection does
not exist...
2010-10-06 00:24:28 +08:00
Holger Hans Peter Freyther 0c35b5bd79 nat: Use the right access list for the stats (found by clang) 2010-10-06 00:18:20 +08:00
Holger Hans Peter Freyther 463dc62ae4 nat: Provide statistics about amount of different messages.
Provide simple statistics on how many LUs, Paging Responses
etc. we are seeing in the network.
2010-10-03 19:41:42 +08:00
Holger Hans Peter Freyther 12eb9b7bd9 gsm_04_80: Require libosmocore for creating USSD messages
Use the libosmocore to create USSD messages, increase the
minimum version of libosmocore, add header files, remove
the code.
2010-09-30 18:56:07 +08:00
Holger Hans Peter Freyther 841c2000d3 gsm0408: Reorder the includes, openbsc first, osmocore second 2010-09-30 18:56:06 +08:00
Holger Hans Peter Freyther c0714b85c3 gsm0480: Reorder the includes, openbsc first, osmocore second 2010-09-30 18:55:55 +08:00
Holger Hans Peter Freyther ee8849649b nat: Keep track of how many connections we reject
Keep track of how many connections we reject due the IMSI
filter itself or due not being able to parse the message.
2010-09-25 17:58:22 +08:00
Holger Hans Peter Freyther 520c1f12ef nat: Print the statistics of the access-list matches
Print the statistics for the rule matches via the vty.
2010-09-25 16:25:47 +08:00
Holger Hans Peter Freyther 2f1a984d4f nat: Add statistics to the access-list in the NAT
Count how many times we match a BSC or NAT deny. This will
give us the number of how often something should be filtered.
2010-09-25 16:15:23 +08:00
Holger Hans Peter Freyther 568b9682e0 nat: Fix the filter when searching for a identity response
The filter code will return < 0 for error, 0 for unknown
subscriber, 1 for subscriber checked. Use the same if construct
as for the CR message. This should fix passing LU when it
starts with a TMSI of a different network.
2010-09-24 04:52:38 +08:00
Holger Hans Peter Freyther cf1c8777a4 mgcp: Return 0 in case transcoding is disabled.
In case transcoding is disabled no error has happened, return
a zero. This is fixing starting the nat without transcoding.
2010-09-24 04:41:28 +08:00
Sylvain Munaut cd8e810302 auth: Fix AuthTupe re-use condition
It's not the key_seq of the last authtuple we must check, but
the one sent by the MS.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-21 19:04:07 +02:00
Sylvain Munaut 0230b34dc5 auth: Fix XOR algorithm
Thanks to the person on the ml that pointed this bug. Sorry I
don't remember who (it was a while ago and somehow didn't got
fixed at that time)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-21 19:03:09 +02:00
Holger Hans Peter Freyther 9aa8a9c5a7 mgcp: Count the packets that arrive on the transcoder 2010-09-20 02:51:30 +08:00
Holger Hans Peter Freyther 557b1ab15b mgcp: Remove code duplication for filling out the sockaddr_in
Share the send to transcoder sockaddr sending routines.
2010-09-20 02:51:30 +08:00
Holger Hans Peter Freyther f2eedff052 nat: Send a transcoder reset on start up.
The transcoder RESET is using the same extensions to reset all
endpoints on a remote site. This makes sure that all allocations
can be made in a properly configured network.
2010-09-20 02:51:30 +08:00
Holger Hans Peter Freyther b98ba72e0a mgcp: Make the base port of the transcoder configurable
The code assumes a static mapping from endpoint to RTP port,
be able to configure the start of such a mapping.
2010-09-20 02:51:30 +08:00
Holger Hans Peter Freyther 3b5e3c4d6f mgcp: Prepare the CRCX/MDCX/DLCX messages for the transcoder.
Send CRCX/MDCX/DLCX to the transcoder, fill out transcoder_end with
the interesting data and hope that it is going to work.
2010-09-20 02:51:30 +08:00
Holger Hans Peter Freyther 218f8564e1 mgcp: Forward data from the BTS-in to the transcoder
Bind a new port for the transcoder, forward data from the BTS
to the transcoder, and from the transcoder to the network. Leave
BTS-IN where it is, BTS-OUT can now be after the transcoding took
place. We send the data from the BTS RTP port.

This whole route will be guarded by the transcoder_ip and if it is
NULL (current default) it will not go through the transcoder.
2010-09-20 02:51:30 +08:00
Holger Hans Peter Freyther 54aaa0fbed mgcp: Add ports for the transcoder as well 2010-09-20 02:51:29 +08:00
Holger Hans Peter Freyther c5f9248c3f mgcp: Share the range parsing code for net/bts 2010-09-20 02:51:29 +08:00
Holger Hans Peter Freyther a2a10ebf03 mgcp: Add a transcoder-mgw command to store the address 2010-09-20 02:51:29 +08:00
Holger Hans Peter Freyther 985f5694c7 nat: Keep the audio name and default payload around
For all forwarded messages this will not be used, but it is of
use for the transcoding.
2010-09-20 02:51:29 +08:00