aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmgcp
AgeCommit message (Collapse)AuthorFilesLines
2013-07-08libmgcp: add enum mgcp_type and use itPablo Neira Ayuso2-12/+30
This patch replaces the field 'is_transcoded' in the mgcp_endpoint structure by the enum mgcp_type, that can be further extended with new types.
2013-07-03mgcp: Make sure the save pointer is initialized with NULL.Holger Hans Peter Freyther1-1/+1
Coverity is not happy about it but it doesn't appear to be a real issue as the data will not be NULL on the first call. Addresses: Coverity CID 1040704
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-05-21mgcp: Initialize the tone to CHAR_MAX as this might not be a requestHolger Hans Peter Freyther1-1/+1
The RQNT message might not contain a 'S:' line with the actual tone to play. Instead of calling the callback with the 0 as tone just leave early. Example: X: 6B9519B88F0 R: D/[0-9#*](N), G/ft, fxr/t38
2013-04-16nat: We want the remote to respond to our DLCX requestHolger Hans Peter Freyther1-1/+29
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.
2013-03-03vty: Document some previously undocumented parametersHolger Hans Peter Freyther1-2/+4
Katerina pointed out that some nodes are not fully documented and proposed some messages. The token/timeout messages were correct, I have modified the other messages. I removed the full-stop from the PING/PONG documentation as we are normally not using a full sentence.
2012-12-16mgcp: Allow to freely control the a=fmtp line for experimentsHolger Hans Peter Freyther2-2/+45
In case of AMR one can specify the available codecs out-of-band. Allow to configure this line statically in the configuration file.
2012-12-16mgcp: Fix the vary large jump detection in the codeHolger Hans Peter Freyther1-1/+1
GCC 3.x on PowerPC correctly highlights that the code is fishy. Re-reading the RFC 3550 shows that we should subtract it and then we are in the 16bit range. The probation and re-sync code is still missing. GCC: mgcp/mgcp_network.c:200: warning: comparison is always true due to limited range of data type
2012-12-10mgcp: Test and implement re-transmission handlingHolger Hans Peter Freyther1-161/+161
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: Change the flow of the code when handling a MGCP responseHolger Hans Peter Freyther1-11/+14
Attempt to detect a response and return only then. Remove one level of tabls in preparation for the re-transmission handling.
2012-12-10mgcp: Methods generating a response now include the endpoint pointerHolger Hans Peter Freyther1-37/+35
This is required for remembering the last result in a central place and is required to properly implement detection of re-transmissions.
2012-12-10mgcp: Fix a typo.. it is msg and not mgsHolger Hans Peter Freyther1-1/+1
2012-12-10mgcp: We do not need to check for talloc_freeHolger Hans Peter Freyther1-8/+4
Simplify the code and remove null check for the two strings.
2012-11-29mgcp: Begin handling of the RQNT message as needed for DTMFHolger Hans Peter Freyther1-11/+47
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: Print both receivd and expected address in the error statementHolger Hans Peter Freyther1-2/+4
The log statement is split into two because inet_ntoa works on an internal buffer and would print the last address twice.
2012-11-12mgcp: Send the jitter statistics at the end of the callHolger Hans Peter Freyther2-3/+11
2012-11-12mgcp: Calculate the jitter with the formula/code from the appendixHolger Hans Peter Freyther1-0/+42
Use a usec timestamp for the local time. The seconds to usec will swap over to the lower bits but this appears to be correct. The CLOCK_MONOTONIC is used to fulfill the RFC 3550 requirement even if it is a bit slower than the gettimeofday. Make sure to initialize transit in a way that the first transit time will be 0. Otherwise the jitter will contain the difference of the localtime and the remote time.
2012-11-12mgcp: Calculate the packet loss as of Appendix A of RFC 3550Holger Hans Peter Freyther2-4/+38
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: Calculate the wrap around as of Appendix A in RFC 3550Holger Hans Peter Freyther1-1/+20
This is missing the probation and the dealing with a remote restart. For the remote restart we will simply write a log statement as this is unlikely to happen during a call or if it does happen the call will be taken down by the BSC anyway.
2012-11-12mgcp: Document a difference between RFC 3550 and this codeHolger Hans Peter Freyther1-0/+8
Explain why this code deals with only one source and that this is a limit of some equipment (e.g. the nanoBTS).
2012-11-12mgcp: Align the variable naming with Appendix A of RFC 3550Holger Hans Peter Freyther1-4/+4
Align the naming inside the mgcp_rtp_state with the naming inside the 'source' struct of the appendix. Make first_seq_no/base_seq a uint16_t. This is removing rules for alignments and reduces the struct from 40 bytes to 36.
2012-11-12mgcp: Include statistics at the end of a connectionHolger Hans Peter Freyther1-9/+36
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-11-12mgcp: Remember the initial sequence number of the streamHolger Hans Peter Freyther1-0/+1
This information is required for calculating the packet loss at the end of a phone call.
2012-11-12mgcp: Count the received octets as of the MGCP specificationHolger Hans Peter Freyther2-0/+3
Count the received octets. This is encouraged by the MGCP specification. Use a 32bit counter that is good enough for more than 12 hours of a EFR call. This limit is good enough for the current configuration.
2012-11-12mgcp: Remove the lost_no from the mgcp statisticsHolger Hans Peter Freyther2-7/+2
The RFC 3435 specifies a different formula for calculating the lost packages. It involves the number of received packages and the delta of the sequence number.
2012-10-27Set byte order defines when compiled on OSXTobias Engel1-1/+7
Byte order defines have a DARWIN prefix on OSX so the values openbsc expects are set from their Darwin counterparts when compiled on OSX.
2012-09-11mgcp_network.c: Address compiler warning on returnHolger Hans Peter Freyther1-0/+2
When adding the "omit RTCP" the method started to return with a proper return statement. mgcp_network.c: In function ‘send_to’: mgcp_network.c:233:1: warning: control reaches end of non-void function [-Wreturn-type]
2012-08-17VTY: improve VTY prompt and make sure exit/end works everywhereHarald Welte1-2/+2
Some nodes below 'config' didn't have ournode_exit / ournode_end, and thus were not able to properly perform this function. exit should always only go back one level, while end drops us back to ENABLE_NODE. The prompt now represents the nesting level, and there's one consistent space after the final prompt character (typically #).
2012-07-28mgcp: Make sure "no rtcp-omit" is fully documentedHolger Hans Peter Freyther1-4/+6
One command missed the NO_STR in the documentation, share the main text across all commands.
2012-05-11mgcp: Make it possible to drop RTCP packets coming from the BTS/NetHolger Hans Peter Freyther3-2/+54
The ip.access nanoBTS appears to send quite broken NTP timestamps in the RTCP messages might confuse equipment that uses the sender report of the BTS. Make it easy to experiment by adding an option to drop RTCP.
2012-03-16mgcp: implement a more tolerant parser based on strtok_r()Harald Welte1-254/+187
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-01-27MGCP: Add VTY commands to reset (RSIP) one or all endpointsHarald Welte2-0/+86
2012-01-17mgcp: Fix warning about unused variableHolger Hans Peter Freyther1-2/+0
mgcp_network.c:335:22: warning: variable ‘cfg’ set but not used [-Wunused-but-set-variable]
2011-11-06mgcp: Make sure each command has some kind of online helpHolger Hans Peter Freyther1-37/+96
In this iteration I just want to make sure that each VTY command has online help. Replace "a b" with "a-b" if there is no "a c" with b!=c. This config should gain some more sanity and consistency, this will happen in another iteration.
2011-08-22mgcp: Make CRCX deal better with UDP retransmissionsHolger Hans Peter Freyther1-24/+44
When the CRCX 200 is lost on the way to the CallAgent we will get another CRCX (retransmission) which was answered with a 400. Change the code to extract the CallID, Mode and the optional LocalOptions first. Then check if the endp is allocated with the same call identifier, in that case return the current session information.
2011-08-22mgcp: FreeSWITCH requiresn us to provide the o= and t= paramHolger Hans Peter Freyther1-3/+5
The SDP file for FreeSWITCH should contain o= (Origin) and the t= (Timing) for the session. The data of the Origin should be globally unique but this is not the case yet. We will need to store the (NTP) time of the creation of the endpoint.
2011-07-19mgcp: Implement RSIP based on a trunk levelHolger Hans Peter Freyther1-1/+13
Implement the RSIP spec extension to work on the specified trunk instead of hardcoding it to the virtual trunk.
2011-06-02mgcp: Fix a typo in the function nameHolger Hans Peter Freyther1-5/+5
2011-05-07src: use namespace prefix osmo_* for misc utilsPablo Neira Ayuso1-3/+3
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-05-06src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-12/+12
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-04-18misc: Remove sys/types.h includes from the filesHolger Hans Peter Freyther2-2/+0
These are not needed any more. We used them for u_int types but we now use uint which comes from stdint.h
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso4-7/+7
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-08mgcp: Remove some duplicate header files from the list.Holger Hans Peter Freyther3-7/+1
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte4-0/+2430
... and make sure tests work again after restructuring