Commit Graph

67 Commits

Author SHA1 Message Date
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 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 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 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 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 9aa8a9c5a7 mgcp: Count the packets that arrive on the transcoder 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 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 39a97e24fb mgcp: Remember if the endpoint was allocated...
Do not use the CI_UNUSED to decide if an endpoint is allocated
but introduce a new flag. This way only the CRCX and free_endp
play with the allocated field.
2010-08-06 18:03:11 +08:00
Holger Hans Peter Freyther 52ccf6a480 mgcp: Fix discovering the RTCP port with the more strict check.
If we have found the BTS and we receive data on the RTCP port
from the IP of the BTS we will set our RTCP port and forward it
to the network and hope it will be useful.
2010-08-06 07:49:57 +08:00
Holger Hans Peter Freyther 0d44eb6a24 mgcp: Determine the proto properly... 2010-08-06 07:49:57 +08:00
Holger Hans Peter Freyther 7fe2a3d293 mgcp: Add instrumentation code to find a possible port leak/bsc-fd corruption 2010-08-06 07:18:22 +08:00
Holger Hans Peter Freyther 6f36e92cab mgcp: Fix a filedescriptor leak in case the bind is failing. 2010-08-06 03:00:17 +08:00
Holger Hans Peter Freyther 260d6ed02c mgcp: Add a call tap feature to forward audio to another forward port
For debugging it is useful to forward (tee) UDP packets to another
system and use gstreamer to inspect the rtp stream. This is untested
code and might contain bugs.... and of course only tap your own calls.
2010-08-06 01:12:21 +08:00
Holger Hans Peter Freyther 6357a8e311 mgcp: Patch RTP packets again if that is allowed. 2010-08-05 20:08:22 +08:00
Holger Hans Peter Freyther ea97fbf1a1 mgcp: Be more strict on the source addr/source port of the bts
Once we have discovered the bts we will not accept data from
anything else. The call will drop if the BTS is changing the
ip address of the nat anyway.
2010-08-05 19:35:44 +08:00
Holger Hans Peter Freyther b97c50db0a mgcp: Only discover the bts once, the extra check got lost 2010-08-05 19:35:44 +08:00
Holger Hans Peter Freyther f138f917ec mgcp: Allow to dynamically allocate ports from a range..
Allow to switch to a dynamic port allocator and not reuse
the ports for a long time... This should help with a crazy
network sending two streams at the same time.
2010-08-05 08:08:17 +08:00
Holger Hans Peter Freyther e602cd6988 mgcp: Separate recv from net/bts and remove autodetection
This allows a more strict check on the source of RTP messages
and we can more easily reject those. For the BTS without an ip
address we will also update the ip address.
2010-08-05 06:57:29 +08:00
Holger Hans Peter Freyther 1fc432984c mgcp: Move the loopback code into the common send as well. 2010-08-05 06:57:29 +08:00
Holger Hans Peter Freyther b615164d75 mgcp: Remove the receive code into a new method. 2010-08-05 06:57:29 +08:00
Holger Hans Peter Freyther 84e1c47f74 mgcp: Move the selection of the right source port to a new method 2010-08-05 06:57:28 +08:00
Holger Hans Peter Freyther 314584ab44 mgcp: Allocate a different port for the networking...
Use the right source port when sending the message.
2010-08-05 06:12:02 +08:00
Holger Hans Peter Freyther c49212778f mgcp: Move the bfd for rtp/rtcp into the port
Stop using the memset in the mgcp_rtp_end_reset as we
will reset the list pointers and then have a mess..
2010-08-05 06:10:58 +08:00
Holger Hans Peter Freyther 217d712012 mgcp: Rename the bind method to show it is only binding for the bts port 2010-08-05 06:10:57 +08:00
Holger Hans Peter Freyther 58ff219c85 mgcp: Attempt to separate the RTP/RTCP port for the Network and for the BTS
We plan to have two different ports for the network and for the
BTS to avoid detecting the BTS and to dynamically allocate the
port to have old data not go to a new socket.
2010-08-05 06:10:57 +08:00
Holger Hans Peter Freyther a17d701a70 mgcp: Group the state for bts/net into a struct and have two instances
Group the data that each end (network/bts) have into a struct and use
this struct throughout the sourcecode.
2010-08-05 06:10:54 +08:00
Holger Hans Peter Freyther 8b5772ebe4 mgcp: Remove the forwarding mode as it was not used. 2010-08-05 06:10:13 +08:00
Holger Hans Peter Freyther 7f8aec2b2b mgcp: Fix the payload_type... it broke in 7cdc62c012 2010-08-05 06:10:10 +08:00
Holger Hans Peter Freyther 7cdc62c012 mgcp: Fix the reversed net/bts... which has not cause any issue.. 2010-08-04 22:21:40 +08:00
Holger Hans Peter Freyther c02f11a04f mgcp: Pass the whole endpoint to the patch method. 2010-08-04 22:20:34 +08:00
Holger Hans Peter Freyther f1f6bba16d mgcp: Fix the order of the arguments... 2010-08-04 22:14:46 +08:00
Holger Hans Peter Freyther aaf8301a19 mgcp: Print the conn mode as well 2010-08-04 21:52:11 +08:00
Holger Hans Peter Freyther bb14e62a7f mgcp: Disable the actual patching... this is a temporary hack 2010-08-04 21:52:11 +08:00
Holger Hans Peter Freyther 2f10458831 mgcp: Print the system for the duplicate SSRC... 2010-08-04 21:52:11 +08:00
Holger Hans Peter Freyther 5c1e6cf5fc mgcp: Only patch the header if we had a change in SSRC 2010-08-03 23:57:16 +08:00
Holger Hans Peter Freyther 6aa882b515 mgcp: Allow switching the audio streams, patch the header
Patch the sequence number, the SSRC and the timestamp to
allow to mix various voice streams, e.g. toggling the loop
during the call.
2010-08-03 23:57:16 +08:00
Holger Hans Peter Freyther 3186892771 mgcp: Move the rtp state into a struct
Use a struct to group the rtp state for the up and the down
link of the bts.
2010-08-03 23:57:16 +08:00
Holger Hans Peter Freyther 98a3877e97 mgcp: Implement the "loopback" mode for a connection endpoint. 2010-08-03 02:27:21 +08:00
Holger Hans Peter Freyther 417920a660 mgcp: Attempt to count lost packets better... 2010-07-29 03:04:57 +08:00
Holger Hans Peter Freyther 380b8711a2 mgcp: Attempt to count missing RTP packets with a basic calculation
This code compares the UDP sequence numbers of two RTP messages
and guesses if packets are missing. It is guessing in two ways:

	1.) by default the sequence number is 0, so on the first
	    value we ignore the jump... we might ignore a real issue
	    in case of a wrap around which is easily possible as the
	    sequence should be a random number.
	2.) the UDP stream might have been reordered on the network
	    and we would see the jump...

In any case these two shortcomings are acceptable for the feature
that is meant to provide some basic analysis..
2010-07-29 02:41:38 +08:00
Holger Hans Peter Freyther d0c3229590 mgcp: Rename TOS to DSCP
DSCP is the more modern information for TOS and the kernel
will set parts of TOS by itself (e.g. for ECN).
2010-07-27 20:35:03 +08:00
Holger Hans Peter Freyther 7dece86a08 mgcp: u_int8_t -> uint8_t 2010-07-23 18:56:26 +08:00
Holger Hans Peter Freyther d340cd3b2f mgcp: u_int16_t -> uint16_t 2010-07-23 18:56:01 +08:00
Holger Hans Peter Freyther d9b18f8c21 mgcp: u_int32_t -> uint32_t 2010-07-23 18:55:38 +08:00
Holger Hans Peter Freyther 75492e6e54 [mgcp] Set the IP_TOS/DSCP on RTP/RTCP IP packets. 2010-06-17 14:34:30 +08:00