instead of outright rejecting local endpoints advertised by remote
clients (to allow for deliberately daisy chaining packet streams), we
flag them for checking against actual packet loops as we did before
Change-Id: I5652e86e12f3c1c5053ea70b01e8d128ebf47751
fixes#65
this also obsoletes the old loop detection
Change-Id: I850d81500c45828af2c4d50d80278ec2d599c2a0
(cherry picked from commit 3254278cfd55167fb881cc665328744183773728)
Updating, freeing, and writing the recording metadata is now
threadsafe. This is in regards to the metadata that we receive from
the `rtpengine_offer` or `rtpengine_answer` commands, not the
`meta_fp` file.
We can simply use the `call->master_lock` variable for protecting
updates to the recording metadata. We had to move the metadata
handling code in call_interfaces.c up into the master_lock guarded
section. The code in "recording.c:meta_finish_file" is called with
master_lock protection already.
- The packet counter was accidentally a pointer, resulting in it
incrementing by 8 instead of 1. That is fixed.
- Use proper formatting macro for uint64_t printing.
- Start PCAP packet indexing at 1 since that is what Wireshark does.
In the call recording metadata file, start and end timestamps for the
call are now "key: value" formatted so you can tell what they are just
by reading the metadata file.
We write out what RTP packet number the SDP came before. When we receive
an SDP offer or answer, we write out the RTP packet number that the SDP
preceeded. This will let us split the RTP recording PCAP around SDP
renegotiation for things like hold/unhold.
Also write out whether the SDP was an offer or an answer.
When we write out the start time of a call for the recording metadata,
we used to get the timestamp from the given `call_monologue.started`
member. This value changes after each SDP renegotiation. Now, we use the
`call.created` member.
I changed metadata file permissions to 664.
I made some non-void functions properly return non-void values. This
does not change any functionality. Just quiets a few compiler warnings.
We want to be able to match up the source and target <IP>:<PORT> with
the IP and port info sent in SDP. I adjusted the source and target
<IP>:<PORT> we write to the IP and UDP headers in the PCAP file.
I added the offer SDP (in addition to the already written answer SDP)
to the metadata file.
As a consequence of writing out the offer SDP, we will have empty PCAP
files and associated metadata files for calls that are never answered.
squash! Fixes to match PCAP packets with SDP
Added comments detailing the types of endpoint IP/port values we can
use.
We write the call-id out as part of the filename for pcap and metadata
files for recorded calls. We don't want troublesome characters to be in
the filename, so we urlencode the filenames.