diff --git a/daemon/media_socket.c b/daemon/media_socket.c index a2da1349b..4a00fd1d9 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -21,8 +21,6 @@ #include "recording.h" - - #ifndef PORT_RANDOM_MIN #define PORT_RANDOM_MIN 6 #define PORT_RANDOM_MAX 20 @@ -1202,7 +1200,7 @@ loop_ok: // If recording pcap dumper is set, then we record the call. if (recording_pdumper != NULL && call->record_call) { stream_pcap_dump(recording_pdumper, stream, s); - call->recording->packet_num += 1; + call->recording->packet_num++; } if (handler_ret >= 0) { diff --git a/daemon/recording.c b/daemon/recording.c index 10c7db5ce..4779b61ab 100644 --- a/daemon/recording.c +++ b/daemon/recording.c @@ -6,10 +6,10 @@ #include #include #include -#include "call.h" #include #include - +#include +#include "call.h" int maybe_create_spool_dir(char *dirpath); @@ -136,7 +136,8 @@ int set_record_call(struct call *call, str recordcall) { call->recording = g_slice_alloc0(sizeof(struct recording)); call->recording->recording_pd = NULL; call->recording->recording_pdumper = NULL; - call->recording->packet_num = 0; + // Wireshark starts at packet index 1, so we start there, too + call->recording->packet_num = 1; meta_setup_file(call->recording, call->callid); } } else if (!str_cmp(&recordcall, "no")) { @@ -219,7 +220,7 @@ ssize_t meta_write_sdp(FILE *meta_fp, struct iovec *sdp_iov, int iovcnt, } else { fprintf(meta_fp, "other"); } - fprintf(meta_fp, "\nSDP before RTP packet: %llu\n\n", packet_num); + fprintf(meta_fp, "\nSDP before RTP packet: %" PRIu64 "\n\n", packet_num); fflush(meta_fp); return writev(meta_fd, sdp_iov, iovcnt); } diff --git a/daemon/recording.h b/daemon/recording.h index 2f83b979e..0a0cd2784 100644 --- a/daemon/recording.h +++ b/daemon/recording.h @@ -20,7 +20,7 @@ struct recording { str *metadata; pcap_t *recording_pd; pcap_dumper_t *recording_pdumper; - uint64_t *packet_num; + uint64_t packet_num; str *recording_path; };