Commit Graph

184 Commits

Author SHA1 Message Date
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 ff5fa4e455 [debug] Add a debug area for the MGCP code of On Waves 2009-11-20 13:07:02 +01:00
Holger Hans Peter Freyther 32201c50a5 [debug] Add a debug area for MSC 2009-11-20 13:06:44 +01:00
Holger Hans Peter Freyther ed0a47b9c5 [debug] Add a debug area for SCCP 2009-11-20 13:06:28 +01:00
Holger Hans Peter Freyther ea52802762 [lchan] RSL and RR need the multirate config, place it in the lchan
Both GSM 04.08 RR and GSM 08.58 RSL need the multirate config
in the channel modify. Place the config in the lchan, change
the gsm48 methods to not take the argument, change the RSL
implementation to make use of it with the right IE.

The other code should use the t(l)v_put routines as well but
were left untouched for now.
2009-11-19 11:42:03 +01:00
Holger Hans Peter Freyther 231163d365 [ipa] Change names of RTP methods to follow MGCP naming
IPA is naming these functions CRCX, MDCX, DLCX to follow
the naming of the MediaGatewayControlProtocol. Change the
code to go from BIND to CRCX (create connection) and from
CONNECT to MDCX (modify connection).

Connect indicates that it is only possible to call it once
while it is possible to call it more than once to modify
the audio parmaters and such. So the IPA terminology is
making a bit more sense here (now that we know it).
2009-11-19 09:40:03 +01:00
Holger Hans Peter Freyther 25f30ba00a misc: Add routine to generate backtrace from within the application
E.g. to analyze the subscr_get/subscr_put behavior one can place
the generate_backtrace into the functions, recompile and then filter
the output with contrib/bt.py to get the function name, file and line.
2009-11-19 09:40:03 +01:00
Holger Hans Peter Freyther a6bcc74716 [gsm48] When picking AMR we need to supply the multirate config
On channel mode modify and assignment command when using
the a multirate code the multirate configuration must be
present in the packet.
Add a parameter and add a warning when using it in a
broken way.
2009-11-17 18:20:17 +01:00
Holger Hans Peter Freyther 135a7c65cd [neci] Separate handling of chan requested for paging any
Allow to handle the channel requested differently based
on the NECI value for the "paging any" case. This will allow
to open a TCH/H, TCH/F depending on the neci mode.
2009-11-17 18:19:25 +01:00
Holger Hans Peter Freyther f7d752f7ac [si] Make it possible to set the NECI value...
Allow to configure the NECI value... and change code
that is relying on the NECI value.
2009-11-17 09:46:33 +01:00
Holger Hans Peter Freyther e723eac5a3 [telnet] Remove unused variables from the telnet interface
These became unused when the interface was switched to
use the vty module. It is about time to remove these.
2009-11-17 09:46:33 +01:00
Harald Welte b54d950ac1 silent call: add header file for function prototypes 2009-11-17 06:00:23 +01:00
Harald Welte a148233b5e Add "silent call" feature to OpenBSC
This allows the administrator to use the vty interface to issue a silent
call to a given subscriber by using
	"subscriber extension XXXX silent call start"
and stopping that silent call with
	"subscriber extension XXXX silent call stop"
2009-11-14 10:08:40 +01:00
Harald Welte aff237d739 [OML] fix bugs in BCCH info parser for ip.access 2009-11-13 14:41:52 +01:00
Harald Welte b40a38ff46 [ip.access] Parse cell global ID as part of BCCH info 2009-11-13 11:56:05 +01:00
Harald Welte 0f255857d4 ip.access: Introduce parser function for BCCH Info test result 2009-11-12 14:48:42 +01:00
Harald Welte ccda96517c move 'struct value_string' and 'get_value_string()' to gsm_data 2009-11-12 22:28:18 +09:00
Harald Welte d409be7fae change some identifiers from u_int64_t to unsigned long long
makes printf much easier on 64bit platforms...
2009-11-07 00:06:19 +09:00
Harald Welte 9aa6fd90ca Merge remote branch 'origin/master' 2009-10-30 09:18:31 +01:00
Sylvain Munaut d7d1c99a53 ip.access: Header has a 16bit length in network byte order
This is confirmed by looking at the source of their dissector.
The length can go up to 273 bytes apparently (again, according
to the source of their dissector).
2009-10-29 16:33:59 +01:00
Holger Hans Peter Freyther 5ba6f48092 [lchan] Keep track which SAPIs has been established with the BTS
Keep track of which SAPIs have been established either by the
BTS (from the MS) or by us. This can be used by the on-waves
BSC code to figure out if a new request should be made.
2009-10-29 04:20:21 +01:00
Holger Hans Peter Freyther 251aa918da misc: Make bitfields unsigned int...
There is no use to have a signed bit in bitfields..
2009-10-27 10:42:28 +01:00
Holger Hans Peter Freyther 100fe56930 misc: Fix make distcheck and welcome the two new header files to OpenBSC 2009-10-27 10:14:04 +01:00
Holger Hans Peter Freyther f520e6439a [gsm48] Handle the RR CHAN MODIFY ACK in the gsm04_08_utils
Move the handling code to the gsm_04_08_utils.c and add a
note that the method value needs to be checked.
2009-10-27 04:52:30 +01:00
Holger Hans Peter Freyther ff3f260e4f [gsm48] Move RR CHANNEL MODIFY to gsm_04_08_utils.c
Be able to send RR CHANNEL MODIFY from the BSC/MSC code
as well. Move the method that knows about the IPAccess RTP
and issues the "bind" to the utils tool
2009-10-27 04:52:29 +01:00
Holger Hans Peter Freyther e81a6109f9 [gsm48] Add generation of ASSIGNMENT COMMAND to the 0408 utils
Add code to generate an assignment command for a given lchan. It
is expected that the lchan is modified already and the mode will
be picked up from their. Currently only the mandantory items
are supported.
2009-10-27 04:52:29 +01:00
Mike Haben 2449b37dfe [USSD] various USSD improvements
- Improved handling of extension-number string (as per review)
- Guard against a buffer-overflow if mobile sends a too-long USSD
- declare some function-parameters const
- fix gsm_ts_name function to display the right BTS number (bts->nr rather than bts->bts_nr)
2009-10-26 20:39:26 +01:00
Mike Haben dc329a6cdb [USSD] eliminate static global variables
This patch removes the need of static global variables and introduces a new,
caller-allocated 'struct ussd_request' that needs to be passed to the various
functions.
2009-10-26 20:39:26 +01:00
Harald Welte 6eafe9137c Add USDD code from Mike Haben
This is the initial checkin of the USSD code from Mike Haben.  I didn't
put it in the main branch as I think it still needs some cleanup.
2009-10-26 20:39:25 +01:00
Sylvain Munaut eb429b7b44 [TLV] Split the parser into 'parse loop' and 'parse single value'
This is needed when you need to manually parse TLV blocks
that don't follow the logic supported by tlv_parse but you
still want to rely on working code and not fiddle with details.
2009-10-26 20:19:59 +01:00
Harald Welte 9c880c9a9b [GPRS] Add RSL function for ip.access PDCH activation
If we have a dynamic TCH/F / PDCH channel configuration, then
we can either ACTIVATE CHANNEL it for a TCH/F, or we need to send
this vendor-specific PDCH ACTIVATE command to use it as a PDCH.

As opposed to a fixed configuration, this allows an intelligent
BSC channel allocator to use otherwise idle channels as PDCH
as long as no more TCH's are needed.
2009-10-24 10:29:22 +02:00
Harald Welte a1499d00a5 [GPRS] introudce PDCH and PDCH/TCH physical channels
GPRS needs PDCH (Packet Data Channels), and we need support in
our data model as well as OML and RSL for it
2009-10-24 10:25:50 +02:00
Harald Welte daef521ea5 [OML] Add support for ip.access SET ATTRIBUTE message
Since TS 12.21 implements only SET ATTRIBUTE for some object classes,
ip.access had to extend it to be able to set attributes on arbitrary
objects.  We now introduce a function implementing that message.
2009-10-24 10:20:41 +02:00
Harald Welte 55dd443ac2 [GPRS] add data structures for OML of NSE,CELL,NSVCE
Supporting GPRS means we have a number of additional OML objects to
deal with.  We need to extend our gsm_bts structure to at least
include the nm_state for each of those objects.
2009-10-24 10:19:14 +02:00
Harald Welte 73310c3c83 [TLV] extend TLV parser with support for TvLV
Tag-variableLength-Value is an encoding scheme used in the GPRS NS
and BSSGP protocols, where the length value can be 8 or 16 bits,
depending on actual demand.
2009-10-24 10:04:02 +02:00
Holger Hans Peter Freyther 0e7b0732f6 Include e1_input.h for the e1inp_line 2009-10-22 15:48:59 +02:00
Holger Hans Peter Freyther 8b77a34131 [rrlp] Fix compiler warnings
The apdu is static const u_int8_t. Change the signature to
have a const in there to make the compiler happy, include
chan_alloc.h for lchan methods.
2009-10-22 15:42:19 +02:00
Holger Hans Peter Freyther 65fb0fda9d Forward declare methods to fix compiler warnings
Put the used method in the header files or use extern
in the case of a vty method used by token_auth
2009-10-22 15:39:37 +02:00
Harald Welte 17ddc50338 Merge remote branch 'origin/master' 2009-10-21 20:24:09 +02:00
Holger Hans Peter Freyther 02c28a0fa8 [debug] Use gcc attribute to enable printf checking
Inform the compiler that the same rules as printf apply
to the debugp method. This will check if the arguments
match the format string.
2009-10-21 16:38:19 +02:00
Holger Hans Peter Freyther cbbd49807f [msgb] Add msgb_reset to reset an existing msgb* to the initial state
The reset is useful if one msgb is supposed to be used over and
over again and is avoiding to use msgb_free,msgb_alloc in the
application code.
2009-10-21 16:38:13 +02:00
Harald Welte 8406ec2437 [nanoBTS] move nanoBTS initialization completely into state event handler 2009-10-20 17:31:00 +02:00
Harald Welte 746d6091d9 [abis_nm] introduce and use abis_nm_ipaccess_rsl_connect() 2009-10-19 22:11:11 +02:00
Harald Welte 53f4b10b21 add ipaccess specific attribute set message
Partially apply 9ba65525eaa06a1768aaf35bdee98afcf8026e0a to get
rid of a compile problem. The other part of the mentioned commit
is still in the gprs branch.

Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-09 05:26:46 +02:00
Harald Welte 2d820ccf67 add availability state abis_nm enum 2009-10-08 20:52:35 +02:00
Holger Hans Peter Freyther ca6bc1d10f [gsm0408] Add parameter to gsm48_send_rr_ciph_mode for controling the response
This parameter controls if the response should include the
IMEISV or not. This will be set by the MSC and this is why
this parameter was added.
2009-10-06 04:34:25 +02:00
Mike Haben e2d8227499 [ipaccess] Add nanoBTS 1900 support
Add support for 1900 nanoBTS by using unified bts_type
GSM_BTS_TYPE_NANOBTS for 900, 1800 and 1900 versions.

Reduce the nanoBTS enum values to one and derive the
version from the user supplied band. In the future we
might want to do auto band detection.

The configuration file needs to be changed to refer
to nanobts instead of nanobts900/nanobts1800.

Signed-off-by: Mike Haben <michael.haben@btinternet.com>
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-05 12:12:54 +02:00
Holger Hans Peter Freyther e48b9562a4 [lac] Do not use the reserved LAC 0x0 for two different things
We are using LAC=0 for remembering that a GSM subscriber is
detached. I recently added code to gsm_bts_by_lac that will
return every BTS in case the lac is 0. Harald highlightes
that we would now search for detached subscribers at every
BTS of our network which is clearly not what we want.

Introduce two defines for the two reserved LAC, add a
pointer to the specification, check that our config files
do not contain these reserved values, use the define
and change gsm_bts_by_lac to use the other define.
2009-10-01 04:07:15 +02:00
Holger Hans Peter Freyther f734a14485 [ipaccess] Add SCCP/A descriminator 2009-09-30 06:27:21 +02:00
Holger Hans Peter Freyther d5f052230c [ipaccess] Prepare to reuse parts of the code for the A-link
For the MSC<->BSC connection we are going to use the same header
as used from BTS<->BSC but we are not having an E1-Link, a gsm network
or a gsm_bts available and can not use this part of the code.
2009-09-30 06:27:16 +02:00