Commit Graph

16 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 7ce72c1be8 rtp: And really catch up and remove all occurences of openbsc/rtp.h 2015-03-22 14:43:19 +01:00
Holger Hans Peter Freyther 0169971a59 mgcp: Re-load the state after the transcoding change
Jacob ran the tests with ASAN and noticed that the state is
dead. This is on purpose as we have forced a change in the
transcoding. Re-load the state and verify that it has not
changed in the other cases.
2014-09-05 12:25:32 +02:00
Holger Hans Peter Freyther 0454e32861 mgcp: Use l16 in the test
G729 might not be available, so execute the test with codecs that
are always available.
2014-09-02 12:16:22 +02:00
Holger Hans Peter Freyther 4680121fe6 mgcp: Deal with receiving another payload type
In case we get offered G729 and G711 we might have selected
G729 as the audio codec. The first packet we receive might be
G711 though. In that case we will need to change. But only if
we have a matching alternate codec payload_type. E.g. in the
case of comfort noise we will receive the PT=11 and we don't
want to change.
2014-09-02 09:27:45 +02:00
Holger Hans Peter Freyther cac2438b0c mgcp: Move the "codec" params to a struct
We might be offered multiple codecs by the remote and need to
switch between them once we receive data. Do this by moving it
to a struct so we can separate between proposed and current
codec. In SDP we can have multiple codecs but a global ptime.
The current code doesn't separate that clearly instead we write
it to the main codec.
2014-09-02 08:25:49 +02:00
Holger Hans Peter Freyther cb6ad70994 mgcp: Change API to remove memory management from the name
Jacob pointed out that "free_endp" refers to the memory of
the endpoint being freed. What we want is actually a way to
release an endpoint (and the resource it allocated) or in
the case of the testcase/testapp initialize the data structure
correctly. Introduce two names for that.
2014-07-22 15:00:52 +02:00
Holger Hans Peter Freyther b936278b2e mgcp: Fix/test the case of a time jump and the resync
In case the sender didn't send a couple of frames we will have
a time gap that is bigger than the accepted delta. Add a new
testcase for this and update the next_time.
2014-07-22 14:48:07 +02:00
Holger Hans Peter Freyther 4c18d79475 mgcp: Add a testcase for 160->80 ptime handling 2014-07-22 14:48:07 +02:00
Holger Hans Peter Freyther c8b29083d2 mgcp: Initialise next_time in case the initial timestamp is not 0. 2014-07-22 14:48:07 +02:00
Holger Hans Peter Freyther bd4109babc mgcp: Document transcoding semantic and follow it
Transcoding from GSM to PCMA can lead to the MGCP MGW sending
two PCMA packages with the same sequence number and timestamp.
Once with the encoded audio and once completely empty.

This is because "state->dst_packet_duration" is 0 in most cases
(unless a ptime is forced) and we attempt to encode audio even
if there are not enough samples. The encode_audio return will
return 0 in that case which is not trated as an error by the
mgcp network code.

Handle rc == 0 specially and document the semantic.
2014-07-22 14:42:53 +02:00
Holger Hans Peter Freyther 91eeeae312 mgcp: Fix/test reading/writing the sequence number
The sequence number was read from the wrong place and then
the wrong byte order conversion routine was used so we ended
up wirting 0x00, 0x00 into the patched sequence number. Add
a testcase for that.
2014-07-22 14:31:35 +02:00
Holger Hans Peter Freyther 4fb7e64da2 mgcp: Capture the return value of the of the transcode function 2014-07-22 13:12:12 +02:00
Holger Hans Peter Freyther 6041c8db27 mgcp: Do not use errx as finding a test failure is too hard
It took me a long time to figure out that errx just exits and
the test output didn't indicate that the application was exited
early. Use a printf and good old abort in case of a failure.
2014-07-22 13:12:05 +02:00
Holger Hans Peter Freyther 83cbac2ac0 mgcp: Re-factor testcase to separate test and setup
Separate the test from the code necessary for the setup. This is
somehow inspired by the PhExample framework of Pharo.
2014-07-22 13:11:59 +02:00
Jacob Erlbeck 909fac6689 mgcp: Move transcoding to libmgcp
This patch moves the files relevant to transcoding from
src/osmo-bsc_mgcp to src/libmgcp and src/include/openbsc. Makefiles
and include directives are being updated accordingly.

Sponsored-by: On-Waves ehf
2014-06-05 14:08:53 +02:00
Jacob Erlbeck 84a45cbf83 mgcp/test: Add test cases for transcoding and repacking
This patch adds test cases for transcoding and repacking.

Sponsored-by: On-Waves ehf
2014-06-05 14:08:53 +02:00