Commit Graph

1096 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 851ace9f33 Merge branch 'master' into on-waves/bsc-master
Conflicts:
	openbsc/include/openbsc/Makefile.am
	openbsc/src/Makefile.am
2009-11-20 18:01:37 +01:00
Holger Hans Peter Freyther 7466351026 [misc] Fix the make distcheck
Mention the two new header files, do not list isdnsync twice
2009-11-20 17:58:52 +01:00
Holger Hans Peter Freyther d1dd069b48 [configure] Add onwaves to the version tag 2009-11-20 17:43:40 +01:00
Holger Hans Peter Freyther 401db32ca2 HACK patch the network code..
Report to the MSC with the right code and patch
it on the air...
2009-11-20 17:41:05 +01:00
Holger Hans Peter Freyther 17e03d21d2 [vty] Add option to disable RF on a given TRX.
- Make sure that on runtime the Radio Carrier can be
  locked and unlocked. The vty code calls into the
  Abis NM to lock/unlock the channel and the state is
  stored there.

- Make sure that on start the Radio Carries remains
  offline and we are not starting it. On start the
  radio carrier is either locked or unlocked. This means
  the RSL will not connect until the RF is unlocked. It
  will connect then. To see RSL bringup failures one
  needs to parse the RSL nack message.
2009-11-20 17:40:50 +01:00
Holger Hans Peter Freyther 26a9bff201 [bsc_init] Activate the RC and the RSL link from the Software Activated Callback
On cold start the RSL link will not be brought up. Wait for the
Software to be Activated before starting the RSL link. This is
working reliable on the BTS I have tested with.
2009-11-20 17:40:39 +01:00
Holger Hans Peter Freyther 80fb260a60 [lchan] Release the channel ones its' usecount drops to zero
Remove the timer handling from the LCHAN and release the
channel ones the use count is dropping to zero.

Change code that was sending/using the lchan after the
release and change the send data method to warn in case
the lchan is used after it has been freed.
2009-11-20 17:40:28 +01:00
Holger Hans Peter Freyther 55a0716da7 [bssap] Open a traffic channel for the paging any reason
In the case the MS is requesting a channel with the
paging any channel reason, use a TCH. This allows us
to keep using very early assignment and the SDCCHs are
kept free for location updating requests.
2009-11-20 17:40:00 +01:00
Holger Hans Peter Freyther c88fb75616 [rsl] Speculative crash fix in the RSL rcv message
The theory is that the BTS is almost dead and sends out
a incomplete message and we crash with that. I have not
been able to completely verify that.
2009-11-20 17:38:47 +01:00
Holger Hans Peter Freyther d55a4dc326 Merge branch 'on-waves/gsm0808' into on-waves/bsc-master 2009-11-20 17:38:02 +01:00
Holger Hans Peter Freyther a4e6f2e6e1 [bssap] Support multiple multiplexers in the assignment command
When more than one trunk group is allocated to the BSC the
MSC will start to assign channels from the different multiplexer.

We will map them the following way onto MGCP endpoints

Multiplex 0:
   0	->	1
   1	->      signalling
   2	->	2
   ..	->	..
   16	->	signalling (might be 15)
   30	->	30

Multiplex 1:
   0	->	31
   2	->	32
...

Multiplex 3:
..
2009-11-20 17:35:47 +01:00
Holger Hans Peter Freyther 7f71d99cc3 [bsc] Add a rtp base port to the BSC config too
Stop having a global variable... keep it in the
gsm network or the mgcp
2009-11-20 17:35:47 +01:00
Holger Hans Peter Freyther b92167cf80 [vty] Write out BSC specific network parameters too 2009-11-20 17:35:47 +01:00
Holger Hans Peter Freyther 4b6a6dbe7e [bssap] Cope with weird channel mapping on the network side
The timeslot of the network maps the following way
	0	->	1
	1	->	n/a
	2	->	2
	...	->      ...
	31	->	31
2009-11-20 17:35:47 +01:00
Holger Hans Peter Freyther 763e8c7766 [ipacc] Add a way to override the rtp payload for MDCX 2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 823ff16088 [bsc] Send the SCCP IT message in a given interval
Send the message every 60 seconds on every SCCP
connection. The 60 seconds were taken from a protocol
trace obtained on the network.
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 6f93c6a1e0 [bsc] Unref the lchan when the MSC is closing the SCCP connection
Currently we are not sending the Inactivity Test message so the
MSC will close the specific sccp connection but we would keep the
lchan open and then end up with resource issues.

Change the code to close the lchan before closing the SCCP connection..
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther f97e48b0de [bssap] Send multirate config for HR AMR with 5.9k
Send a hardcoded multirate config when usin the
AMR codec. This should be more configurable in
the future.
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 761600b0fd [bsc] Add a test_mode function that can be used to inject packages
This method can be called from the main method to inject
a test message into a "fake" network with sccp connection.
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 8549462bc6 [bssap] Attempt to allow selecting the speech mode from config
It is possible to specify a list of possible speech codecs
and we will try to match the assignment command with the
one from the config file. This is not tested yet and we have
one problem. We assume we can modify the channel to hold
the speech value... this will require more work.
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 436e5c6308 [vty] Add configuration for the preferred speech version
Add network configuration option to specify which audio
codecs are supported by the BTS. This allows the BSC to
pick the audio codec in the GSM0808 Assignment Request.
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther f8b9d844c1 [bssap] Pick the A5/0 vs A5/1 setting from the gsm_network
Follow the configuration of the gsm network. If the Cipher
Mode Request does not allow our preferred format we will
reject it. Otherwise send the cipher mode command to the
mobile station. This code is mostly untested.
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 58ec07d580 [bsc] Add BSC specific config option... currently and empty show is implemented
In the future this should give a list of SCCP connections
and their allocated radio resources/users...
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 71465c21f4 [bssap] Implement generating a classmark update message
Generate a classmark update message from a given payload
this might need to be changed to get the version2 and
version3 parameters
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther 16d0a833f8 [bssmap] Fix the chosen encryption in assignment complete
Send the RSL value... it is the right value
2009-11-20 17:35:46 +01:00
Holger Hans Peter Freyther ea72b62cac [bssmap] Unconditionally include the chosen encryption in cipher mode complete 2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 49a84ec6e9 [bssmap] Assignment handling fixes and improvements
- Fix the generation of the assignment failure message
- Parse the permitted indicator of the assignment request message
2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 42c636b6c8 [bssap] Fix generation of the failure message 2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther a0a55f555e [bssap] Only start establish when the link is not yet established
This is fixing a bug when we try to submit a SMS from the MS to
the network. We send the RLS ESTABLISH REQUEST but as the MS
already established this SAPI we waited for the timeout and failed..
2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 23ed00e410 [bssap] Improve log messages... 2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 3fe910b9f1 [bssap] First go at implementing channel assignment... 2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 097bdeb77d [bssap] First go at implementing ASSIGNMENT REQUEST 2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 1b85de02e0 [bssap] Add a "#warning" that cipher mode is not properly handled 2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther 2281d1835f [bssap] Start to queue messages to the BTS and to the MSC
For the MSC we need to queue GSM04.08 messages until the
SCCP connection is  confirmed to be open and then can send
the stored messages. The queue is limited to 10 messages
at which point new ones will be dropped. Currently the
only messages we get are measurement indication messages
but it is better to be safe than sorry.

The SCCP messages are sent as soon as the connection
is considered established and then no queueing happens
any more. While replacing sccp_connection_write calls
various memory leaks has been fixed.

For the MS we might have received a DTAP and need to do
an operation that requires a roundtrip and want to send
wait until this has happened. The two scenerios are sending
a SMS to the phone that requires to do something special
for the different SAPI. Currently it is assumed that
only one SAPI=0 -> SAPI=3 change happen during the connection.

For the first SAPI != 0 we will send the rll_ request
and then wait for the timeout or confirmation. In case
of timeout a SAPI "n" reject is sent and in case of
success the queue is getting emptied.
2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther fb4433a129 [bssap] Implement SAPI "N" Reject message
This message will be needed when no RLL connection
on a different SAPI can be established or we don't
want to establish it.
2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther d954dcf9e1 [bsc_msc_ip] This is a BSC that connects to real MSC via IP
This is a BSC to be used by on-waves.com to connect to a real
MSC using SCCP over IP.

The following messages and features are currently implemented:
    - IPA identity ack's
    - COMPLETE LAYER3 INFORMATION
    - DTAP
    - PAGING COMMAND
    - CLEAR COMPLETE/CLEAR REQUEST
    - CIPHER MODE COMMAND/ REJECT /COMPLETE

It comes with a tool to create the enum's from the spec and
a very simple test server to do the handshaking.
2009-11-20 17:35:45 +01:00
Holger Hans Peter Freyther adb8bcea5f [contrib] Add a utility to convert an IE page to an enum
This script is parsing the values, converting the bits into
a number and replacing the text... This should help to go from
spec to code more quickly... next thing would be this for the
structs used...
2009-11-20 17:29:33 +01:00
Holger Hans Peter Freyther b9b8c6dbb6 Merge branch 'on-waves/mgcp' 2009-11-20 14:12:12 +01:00
Holger Hans Peter Freyther 4ec389e58f [mgcp] Make the number of endpoints configurable...
Allow to configure the number of endpoints at start. Currently
this will not be changed at runtime but one needs to save the
config and restart the system.
2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 8ea4b5688a [mgcp] The nanoBTS is not binding a RTCP port
Do not guess the RTCP port as it might be the RTP port
of another connection.
2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 39e94ebbd2 [mgcp] The initialisation is done inside CRCX, remove here 2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 48ecad48c7 [mgcp] Do not forward or find the BTS if the endpoint is unused
Forget where the bts and network is located on DLCX and CRCX otherwise
we would have forwarded BTS data to the wrong endpoint and would have
not tried to discover the BTS again.

In the case of early bind we might get data from the BTS before
the CRCX and after DLCX... just ignore it then
2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 17e791666d [mgcp] Add a show command for the mgcp... 2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 5fddf475d5 [mgcp] Fix writing the configuration file 2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 338fa562c0 [mgcp] Add telnet interface for mgcp. 2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 1cf9cf3eeb [mgcp] MGCP... update config file to use AMR 2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther 138b7ecd5e [mgcp] Add option to route audio back to both ends
This is a simple echo functionality in the MGCP... it
will send the audio back to the network|bts..
2009-11-20 14:05:17 +01:00
Holger Hans Peter Freyther f67945f004 [mgcp] Add a simple mgcp gateway used for the BSC
The python script is a simple call-agent driving the
client. Currently it is sending a AuditEndpoint message
and is printing the result.

The bsc_mgcp.c is a standalone process that will implement
a MGCP Gateway for the MSC. On call handling the Call-Agent
will ask the Gateway to "CreateConnection" and then this
gateway needs to communicate with OpenBSC.

Currently CreateConnection,ModifiyConnection,DeleteConnection
and Endpoint auditing is implemented.

[mgcp] Send RSIP on start and on first receive of any message

Ignore the first request and send a RSIP. We do that because
we might tunnel UDP through some other things and have no direct
way to connect to the call-agent.
Also the transaction is not checked and we ignore the response
from the call-agent, actually we print the '200 ' or any other
value as unhandled...

[mgcp] Print the MGCP command next to the response code

This allows to see which commands were sent by the server

mgcp: Terminate it with a new line

[mgcp] Make number of endpoints static...

For now this is fixed to the number of endpoints as of the GSM
specification...

[mgcp] The endpoint names seem to be base 16... use strtoul to parse

Use strtoul to parse the base 16 number from the mgw string.

[mgcp] Log the endpoints as hex numbers...

[mgcp] Only send the RSIP on the first incoming message..

Remove call_agent option (also remove the number from the getopt
call).

[mgcp] Start couting at 1 for the mgcp

[mgcp] Slight attempt to improve the grammar of the strings

[mgcp] Share validation routines between DLCX and MDCX

[mgcp] Remove help for dead config options

[mgcp] Specify a different IN addr in the SDP records

In case of NAT traversal be able to listen on a given
interface (like 127.0.0.1) but claim to receive data
at the beginning of the tunnel.

[mgcp] Fix the static copy of the SDP file

WIP verify out factoring broken..

[mgcp] Introduce VTY to the mgcp for config file parsing...

Parse the MGCP config file via the VTY framework.

[mgcp] Handle SDP parameters through VTY..

Currently the payload type, name and rate can be specified
in the config file.

[mgcp] Add an option to bind all rtp ports early

This can be useful for testing and in deployment to make sure
no runtime resource limit can be hit.

[mgcp] Add some API doc comment

[mgcp] Convert the packets of the example server to ascii

This will allow to easily patch the call id... to run the
server in a loop and make it work with the mediagateway

[mgcp] Assign CI_UNUSED... to be more obvious...

[mgcp] Use DEBUG and not DEBUGPC and specially not printf

Improve the logging a bit in the mgcp

[mgcp] Change the fake server to change the call id

This assume the call-agent will just increment the id
as well.... this is true for our implementation

[mgcp] Generate the transaction id dynamically..

This way wireshark will be more happy about it...

[mgcp] Recognize responses from the network..

This is just recognizing the response code and
then is doing nothing with it. Also change the
script to generate response messages...

[mgcp] Improve debug messages for CRCX/MDCX..

Log on which ports the media gateway is listening
and where the other (server) gateway is located
2009-11-20 14:05:04 +01:00
Holger Hans Peter Freyther b1b0bc2ace Merge branch 'on-waves/sccp' 2009-11-20 13:14:54 +01:00
Holger Hans Peter Freyther 3b9516e0d8 [sccp] Implement sending the Inactivity Test on a connection..
Currently this will send a dummy inactivity test message,
there is currently no parsing or API to receive the messages.

The sequencing and credit entries are empty as sequencing
is currently not used at all.

The test is currently limited to send the message and see
if the application is crashing or not.
2009-11-20 13:09:15 +01:00