MT#55283 Fixing Source and Destination fields when record-egress is enabled

closes #1776

Change-Id: I98fbf1eda5b69fb3d4f1bb95b5e2beab75bb7b60
pull/1786/head
yksp 2 years ago committed by Richard Fuchs
parent bda1b937cb
commit 9fed01c467

@ -15,6 +15,7 @@
#include <stdarg.h>
#include "call.h"
#include "main.h"
#include "kernel.h"
#include "bencode.h"
#include "rtplib.h"
@ -663,8 +664,15 @@ static void rec_pcap_recording_finish_file(struct recording *recording) {
// "out" must be at least inp->len + MAX_PACKET_HEADER_LEN bytes
static unsigned int fake_ip_header(unsigned char *out, struct media_packet *mp, const str *inp) {
endpoint_t *src_endpoint = &mp->fsin;
endpoint_t *dst_endpoint = &mp->sfd->socket.local;
endpoint_t *src_endpoint, *dst_endpoint;
if (!rtpe_config.rec_egress) {
src_endpoint = &mp->fsin;
dst_endpoint = &mp->sfd->socket.local;
}
else {
src_endpoint = &mp->sfd->socket.local;
dst_endpoint = &mp->fsin;
}
unsigned int hdr_len =
endpoint_packet_header(out, src_endpoint, dst_endpoint, inp->len);

Loading…
Cancel
Save