aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp
AgeCommit message (Collapse)AuthorFilesLines
2014-01-16mgcp/test: Show the number of dummy packets sentJacob Erlbeck2-1/+34
This patch extends the test_messages test to show the number of dummy packets that has been passed to sendto(). This way, dummy packets are even being counted when sendto() itself failes (e.g. due to the fd being -1). Sponsored-by: On-Waves ehf
2014-01-16mgcp/test: Reset pkt_period_* after each testJacob Erlbeck2-1/+3
Currently these value may leak into the next test. This patch will reset them after each message has been processed. Sponsored-by: On-Waves ehf
2014-01-16mgcp/test: Test the connection mode parserJacob Erlbeck2-3/+50
This modifies the test MGCP messages to include M:recvonly (CRCX), M:sendrecv (MDCX) and M:sendonly (MDCX) outputs the resulting output_enabled flags and the conn_mode after processing the message. Sponsored-by: On-Waves ehf
2013-12-19mgcp/rtp: Only patch timestamp alignment errorsJacob Erlbeck2-23/+23
Currently, all timestamps are force to SeqNo*d + C which is more than required by the nanoBTS which seems to be sensitive to alignment errors only (dTS != k*d, d = ptime * rate = 160). This patch replaces the force_constant_timing feature by a force_aligned_timing feature. The timestamp offset will only be changed (and timestamp errors counted) when the alignment does not match to the raster based on ptime (default 20ms). The VTY interface does not change. Sponsored-by: On-Waves ehf
2013-12-19mgcp/test: Use differential output for counters and timestampJacob Erlbeck2-112/+236
Currently the counter and output timestamp values are written out for each packet. This makes it difficult to see in the diffs what has been changed significantly. This patch changes this by showing differences for those values. The absolute input values are also shown now. In addition, the sequence numbers (the difference for the output value) are written, too. Sponsored-by: On-Waves ehf
2013-12-19mgcp/test: Add test cases for constant RTP sequence numberJacob Erlbeck2-5/+49
This adds two test cases: 1. Packet repetition (dSeq=0, dTS=0) 2. Broken seqNo (dSeq=0, dTS=160) The second had been already present in the test cases, but it was a mere copy&paste mistake which turned out to be rather helpful. This patch therefore turns it into a documented test case. Sponsored-by: On-Waves ehf
2013-12-13mgcp: Optionally send ptime in SDPJacob Erlbeck1-4/+15
Currently the SDP 'ptime' media attribute is never set in generated MGCP responses. This patch optionally includes the 'ptime' attribute if packet_duration_ms is != 0. This behaviour can be enabled/disabled by using the VTY command "sdp audio-payload send-ptime" (enabled by default). Sponsored-by: On-Waves ehf
2013-12-13mgcp: Parse SDP to get rate and packet durationJacob Erlbeck1-5/+5
This patch parses the 'ptime' and 'maxptime' SDP attributes, and the SDP rate information and sets up packet_duration_ms accordingly. If the packet duration is unknown or allows for different values (e.g. because 'ptime' uses a range or 'maxptime' allows for more than one frame) the duration is set to 0. Sponsored-by: On-Waves ehf
2013-12-13mgcp: Put local connection options into a structJacob Erlbeck2-5/+12
Currently the local connection options have been stored as a string. This patch replaces this string by a struct (that still contains a string) along with the parsed fields (only the packetization period at the moment). It also re-adds the calls to set_local_cx_options() to the handle_create_con() and handle_modify_con() functions. Except for the test program this has no side effects, since the LCO values aren't used yet.
2013-12-13mgcp/test: Output the packet duration after MGCP parsingJacob Erlbeck2-5/+85
This also adds additional MDCX tests (based on MDCX4) to test the analysis of different combinations of 'p' and 'ptime' fields. Sponsored-by: On-Waves ehf
2013-12-12mgcp: Address compiler error for sprintf misusage...Holger Hans Peter Freyther1-1/+1
The hardening flags of debian have highlighted this sprintf mis-usage in the testcase. Address it.
2013-12-10mgcp/rtp: Fix RTP timestamps if enabledJacob Erlbeck1-36/+36
This forces the output timing to fulfill dTS = dSegNo * fixedPacketDuration where dSegNo = seqNo - lastSeqNo. If timestamp patching is enabled, the output timestamp will be set to lastTimestamp + dTS. This kind of relative updating is used to handle seqNo- and timestamp-wraparounds properly. The updating of timestamp and SSRC has been separated and the patch field of mgcp_rtp_state has been renamed to patch_ssrc to reflect it's semantics more closely. The offset fields are now used always and will change the corresponding header field if they are != 0. Ticket: OW#1065 Sponsored-by: On-Waves ehf
2013-12-10mgcp/rtp: Use SSRC in proper byte orderingJacob Erlbeck1-1/+1
The ssrc has been used without respect to proper byte ordering in mgcp_patch_and_count(). This only affected log messages. This patch introduces a new variable 'ssrc' that takes the value of the SSRC in proper byte order. Sponsored-by: On-Waves ehf
2013-12-10mgcp/rtp: Add RTP header patch mode configurationJacob Erlbeck1-1/+5
This adds datastructures and a VTY frontend to configure the different type of RTP header patching: SSRC and timestamp. Note that timestamp patching is not yet implemented. Sponsored-by: On-Waves ehf
2013-12-05mgcp/rtp: Fix output timing error counterJacob Erlbeck1-18/+18
The tsdelta computation and error detection didn't handle the intialisation phase properly. This patches fixes this by skipping the output timing validation when the SSRCs don't match. Sponsored-by: On-Waves ehf
2013-12-05mgcp/rtp: Add more test cases for RTP header patchingJacob Erlbeck2-4/+114
This patch extends the existing RTP error check test by adding a check for timestamp errors after SSRC changes and a check for a segno delta of 2 (with a timestamp delta of 320). To test SSRC patching too, a corresponding line will be written on each SSRC change that has been detected in the output stream. In addition there is now support for selectively enabling/disabling SSRC and timestamp patching. The RTP test sequence is repeated for all combinations thereof. Sponsored-by: On-Waves ehf
2013-12-05mgcp: Handle SDP in CRCX received by the MGWJacob Erlbeck1-2/+2
So far the SDP part of the CRCX message has been ignored by the MGW. This patch adds SDP parsing for this case, eventually updating the net end's payload type and connection parameters. Sponsored-by: On-Waves ehf
2013-12-05mgcp: Add tests for payload types in MGCP messagesJacob Erlbeck2-5/+78
These tests mainly check whether the SDP parsing works properly by looking at the payload type detected. Sponsored-by: On-Waves ehf
2013-12-05mgcp: Add new for_each_line macro that also returns empty linesJacob Erlbeck2-0/+48
This patch add the for_each_line macro based on a strline_r() function (similar to strtok_r()), that is also part of this patch. This strline_r() function is tolerant with respect to line endings, it supports CR-only, CRLF, and LF-only and any combinations thereof (note that a CRLF is always detected as a single line break). Similar to for_each_non_empty_line (the former for_each_line) where the 'save' pointer needed to be initialised by a call to strtok_r(), the new for_each_line macro expects, that the 'save' pointer has been initialised by a call to strline_r(). Also note, that for_each_line/strline_r and for_each_non_empty_line/strtok_r may use the 'save' pointer differently, so calls to them can not be mixed. Sponsored-by: On-Waves ehf
2013-11-25mgcp/rtp: Fix timestamp offset when patching RTP packetsJacob Erlbeck2-8/+14
The current implementation increments the seqno but does not increment the RTP timestamp, leading to two identical timestamps following one after the other. This patch fixes this by adding the computed tsdelta when the offset is calulated. In the unlikely case, that a tsdelta hasn't been computed yet when the SSRC changes, a tsdelta is computed based on the RTP rate and a RTP packet duration of 20ms (one speech frame per channel and packet). If the RTP rate is not known, a rate of 8000 is assumed. Note that this approach presumes, that the per RTP packet duration (in samples) is the same for the last two packets of the stream being replaced (the first one). Sponsored-by: On-Waves ehf
2013-11-25mgcp/rtp: Add test case for RTP timestamp patching and statsJacob Erlbeck2-0/+122
This patch adds a test case to check, whether RTP timestamps are generated properly after SSRC changes and whether the error counters work properly. Sponsored-by: On-Waves ehf
2013-11-25mgcp/rtp: Add counter for invalid RTP timestamp deltasJacob Erlbeck1-2/+3
This patch modifies the patch_and_count() function to check for RTP timestamp inconsistencies. It basically checks, whether dTS/dSeqNo remains constant. If this fails, the corresponding counter is incremented. There are four counter for this: Incoming and outgoing, each for streams from the BTS and the net. Note that this approach presumes, that the per RTP packet duration (in samples) remains the same throughout the entire stream. Changing the number of speech frames per channel and packet will be detected as error. In addition, the VTY command 'show mgcp' is extended by an optional 'stats' to show the counter values, too. Ticket: OW#964 Sponsored-by: On-Waves ehf
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-04-16nat: We want the remote to respond to our DLCX requestHolger Hans Peter Freyther2-0/+28
We want to send a TRAP with the MGCP statistics from the NAT and the connected BSC. The BSC endpoint can be either released because of a DLCX from the MGCP CallAgent or the SCCP Connection release on the A-link. This is why we need to queue the statistics when the deleting the endpoint on the BSC. The processing is continued once the response arrives. This code assumes that the response of the DLCX will be sent by the remote side. The current amount of outstanding responses can be seen on the VTY. This assumption is based on the fact that the BSC has already responded to the CRCX and maybe to the MDCX. The MGCP RFC is bended to prefix the transaction identifier with "nat-" to easily detect the response and hand it to the handler. This will then parse the response and generate the TRAP. The current version is v1. We assume that the transaction space is big enough and we will not re-assign the transaction identifier too early.
2012-12-10mgcp: Test and implement re-transmission handlingHolger Hans Peter Freyther2-5/+64
MGCP is used over UDP and a response might be lost. The MGCP RFC asks for keeping a list of responses and then using the previous response to answer a duplicate request. I tried to conserve memory and just wanted to remember the last transaction identifier and result-code and re-generate the result from that. This made the code look bad and this is why the entire response will now be stored. It sadly increases the memory usage but can not be avoided at this time. Remove the msg->l3h pointer for the RQNT callback as strtok has modified the content of it.
2012-12-10mgcp: Add testdata for MDCX handlingHolger Hans Peter Freyther2-0/+21
2012-12-10mgcp: Test the second CRCX as a CRCX and not as a re-transmissionHolger Hans Peter Freyther2-2/+14
The second CRCX would be mostly ignored and be handled by the retransmission layer of MGCP.
2012-11-29mgcp: Begin handling of the RQNT message as needed for DTMFHolger Hans Peter Freyther2-0/+60
Introduce a callback for the request and forward the signalrequest to the callback. This is not a full implementation of MGCP RQNT.
2012-11-12mgcp: Send the jitter statistics at the end of the callHolger Hans Peter Freyther1-1/+1
2012-11-12mgcp: Calculate the packet loss as of Appendix A of RFC 3550Holger Hans Peter Freyther2-3/+58
Calculate the expected packages and packet loss as of RFC 3550. The values should be clamped but our packet loss counter is 32 bits and not 24 and we should clamp at other values but I am waiting for some issues first before dealing with that.
2012-11-12mgcp: Include statistics at the end of a connectionHolger Hans Peter Freyther2-0/+9
Follow the MGCP specification and send the collected statistics at the end of a call. Right now this does not include jitter, packet loss and delay.
2012-03-16mgcp: implement a more tolerant parser based on strtok_r()Harald Welte1-2/+0
Instead of building complex manual byte-wise parsers, we simply use two strtok_r loops: one iterating over all the lines, the next one iterating over the invididual space-separated elements in the first line. The benefit is that we now accept \r, \n or \r\n, or any multiple of them as line ending. This works around incompliant MGCP implementations like that of Zynetix MSC. Addition: mgcp_analyze_header returns 0 when all out parameters have been set. Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16mgcp_test: Add wrong messages as input and check what happensHolger Hans Peter Freyther2-2/+30
Test parsing some invalid messages and see if we start to crash.
2012-03-16mgcp_test: Rename method as it now operates on an array of messagesHolger Hans Peter Freyther1-2/+2
This code was cleaned up, catch up and rename the method.
2012-01-27MGCP: Add CRCX test casesHarald Welte1-0/+29
The second test case (CRCX_ZYN) fails as the message is not compliant with the spec. However, our parer should be more tolerant, just in case...
2012-01-27further generalize mgcp testing codeHarald Welte1-19/+30
use a data-structure driven approach
2012-01-27mgcp_test: remove duplicate codeHarald Welte1-13/+6
2012-01-06tests: Introduce running tests with GNU autotest in OpenBSCHolger Hans Peter Freyther2-0/+4
The quality of the tests is of different value but it is good to get started and improve from here.
2012-01-06mgcp: Print message when the test is finishedHolger Hans Peter Freyther1-2/+8
2011-05-12misc: Use the osmo_init code for signals and loggingHolger Hans Peter Freyther1-5/+2
Use the libosmocore code to ignore certain signals by default (e.g. SIGHUP, SIGPIPE) and use the new code to create a default stderr logging target and initialize it properly.
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-1/+1
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-4/+6
... and make sure tests work again after restructuring
2011-02-28mgcp: Fix make distcheck due a copy 'n pasted Makefile.amHolger Hans Peter Freyther1-2/+0
2011-02-28mgcp: Allocate the endpoints for the E1 trunks as well.Holger Hans Peter Freyther1-1/+4
2011-02-28mgcp: Introduce a mgcp_trunk_config enum for endpoint configsHolger Hans Peter Freyther1-1/+1
We want to support real trunks in the MGCP code and we need to have some better book keeping for those. Move the code around.
2011-01-07mgcp: We want to count trunks starting from one.Holger Hans Peter Freyther1-2/+2
2011-01-06mgcp: Parse a Digital Trunk endpoint name.Holger Hans Peter Freyther2-0/+94