Commit Graph

63 Commits

Author SHA1 Message Date
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 fbca4ea117 mgcp: Fix the indetion of this code. it should use tabs 2010-11-01 21:15:55 +01: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
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 e02860af00 mgcp: Be able to parse 'sendonly' for the connection mode. 2010-09-20 02:49:09 +08:00
Holger Hans Peter Freyther 0e940e65c7 mgcp: Switch the default audio codec to AMR 2010-09-20 02:48:59 +08:00
Holger Hans Peter Freyther adb6e1cce1 janitor: Move the * to the variable name 2010-09-18 06:44:24 +08:00
Holger Hans Peter Freyther 9e9392d5b3 mgcp: Use transient errors in more cases... 2010-08-08 16:24:48 +08:00
Holger Hans Peter Freyther e378cb1341 mgcp: Reduce the log level to debug for these calls. 2010-08-06 20:22:23 +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 869e38eced mgcp: Add a callback to inform the client that an endpoint got reallocated 2010-08-06 17:54:27 +08:00
Holger Hans Peter Freyther 4634013cde mgcp: Make the CI uint32_t all the way to avoid mismatch 2010-08-06 08:29:37 +08:00
Holger Hans Peter Freyther 414bf401c7 mgcp: Move the mgcp_free_endp into the right path for the CRCX failure 2010-08-06 07:05:13 +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 a39ddd5654 mgcp: Get the for network/for bts flag right. 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 15e7389cf0 mgcp: Prepare to have different port allocation strategies. 2010-08-05 07:10:56 +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 196349dda1 mgcp: Rename the base port to bts_base as it will be used for the bts 2010-08-05 06:10:58 +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 f1a168dc20 mgcp: Only use early bind for the BTS socket.
Simplify the code by onlt allowing one way to allocate
a socket.
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 89976e8285 mgcp: Style issue... add a space. 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 c597a4eba1 mgcp: Allow to change the receive (the loopback part) via the VTY 2010-08-03 03:04:31 +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 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 32d4e50d46 [mgcp] Possible memleak fix for the allowed reallocation case
When allowing to reallocate an allocated endpoint we will need
to free it first. When freeing we will free the call id and other
ids that we would have leaked otherwise.
2010-04-25 23:02:55 +08:00
Holger Hans Peter Freyther e3d16bb775 [mgcp] Protocol extension to not generate answers.
For the NAT we want to send requests in a send and forget
way and we are not interested in seeing the answers, so tell
the gateway to not answer them.
2010-04-25 23:02:17 +08:00
Holger Hans Peter Freyther 74076934fb [mgcp] Print a Deleted endpoint message again. 2010-04-25 23:02:05 +08:00
Holger Hans Peter Freyther 408cc4ace9 [mgcp] Add an option to allow using reallocing an endpoint
For some mode of operation it can be acceptable to reallocate
an already allocated endpoint. This can be the case when we
only deal with one call agent that is keeping track of the
endpoint but slightly confused.
2010-04-07 22:52:25 +02:00
Holger Hans Peter Freyther b4b135efbf [mgcp] Count incoming RTP packets from the BTS and remote 2010-04-07 22:51:59 +02:00
Holger Hans Peter Freyther b4c7b274a1 [mgcp] Reset the the address when freeing the endp as well 2010-04-06 12:13:19 +02:00
Holger Hans Peter Freyther f2f1591ce7 [mgcp] Export header parsing via mgcp internal
This will be used by the NAT code to implement custom protocol
handling on top of that.
2010-04-05 22:02:54 +02:00
Holger Hans Peter Freyther f36a11a35d [mgcp] Do not operate on the ->data pointer, use ->l2h instead
This would have been broken once we attempt to parse encapsulated
MGCP messages.
2010-04-05 22:02:47 +02:00
Holger Hans Peter Freyther c77efdf057 [mgcp] Degrade verbosity to debug 2010-04-05 22:02:38 +02:00
Holger Hans Peter Freyther 9bdcc9ca75 [mgcp] Add some parsing for RSIP messages coming in
This will just call a callback and leave all the handling
to the application.
2010-04-05 22:01:44 +02:00
Holger Hans Peter Freyther e7d2ae69c9 [mgcp] Remove unused method from the mgcp
This was removed when sending the RSIP was
removed from the code.
2010-04-05 22:01:36 +02:00
Holger Hans Peter Freyther 13d67b7ea3 [mgcp] Remove the sending of RSIP
This message is ignored by the call agent and we were
sending this on the first request which we maybe should
not ignore...
2010-04-05 22:01:20 +02:00
Holger Hans Peter Freyther 88c6eeaa7d [mgcp] Set the right variable back to NULL 2010-03-01 18:52:04 +01:00
Holger Hans Peter Freyther 1ebad74377 Merge remote branch 'origin/master' into on-waves/mgcp
Conflicts:
	openbsc/include/openbsc/Makefile.am
	openbsc/src/Makefile.am
2010-02-26 20:16:45 +01:00
Holger Hans Peter Freyther ef6bb25aa5 [mgcp] Keep track of the local and remote RTP payload type
Keep track of which RTP payload type to use for which direction.
2010-02-26 13:41:22 +01:00
Holger Hans Peter Freyther fe86d3c9f8 [mgcp] Introduce a policy CB for the MGCP protocol
The are three policies. Accept, Reject and Defer. This will
allow to handle network connections and such from the policy
callback instead of directly acting on it.
2010-02-26 13:37:05 +01:00