Browse Source

Recrypt SRTP for DTMF logging

Change-Id: Id877b8464e99cfd5dca728a01fcdc3ffc654d698
changes/37/42137/1
Richard Fuchs 5 years ago
parent
commit
e04fb03787
3 changed files with 12 additions and 2 deletions
  1. +7
    -1
      daemon/dtmf.c
  2. +4
    -1
      daemon/media_socket.c
  3. +1
    -0
      include/dtmf.h

+ 7
- 1
daemon/dtmf.c View File

@ -63,6 +63,12 @@ static GString *dtmf_json_print(struct media_packet *mp,
return buf;
}
int dtmf_do_logging(void) {
if (_log_facility_dtmf || dtmf_log_sock.family)
return 1;
return 0;
}
int dtmf_event(struct media_packet *mp, str *payload, int clockrate) {
struct telephone_event_payload *dtmf;
if (payload->len < sizeof(*dtmf)) {
@ -78,7 +84,7 @@ int dtmf_event(struct media_packet *mp, str *payload, int clockrate) {
GString *buf = NULL;
if (_log_facility_dtmf || dtmf_log_sock.family)
if (dtmf_do_logging())
buf = dtmf_json_print(mp, dtmf, clockrate);
if (buf) {


+ 4
- 1
daemon/media_socket.c View File

@ -27,6 +27,7 @@
#include "codec.h"
#include "media_player.h"
#include "jitter_buffer.h"
#include "dtmf.h"
#ifndef PORT_RANDOM_MIN
@ -1292,7 +1293,9 @@ static void __determine_handler(struct packet_stream *in, const struct packet_st
if (!out_proto)
goto err;
if (MEDIA_ISSET(in->media, DTLS) || MEDIA_ISSET(out->media, DTLS))
if (dtmf_do_logging())
must_recrypt = 1;
else if (MEDIA_ISSET(in->media, DTLS) || MEDIA_ISSET(out->media, DTLS))
must_recrypt = 1;
else if (MEDIA_ISSET(in->media, TRANSCODE) || MEDIA_ISSET(out->media, TRANSCODE))
must_recrypt = 1;


+ 1
- 0
include/dtmf.h View File

@ -23,6 +23,7 @@ int dtmf_event_payload(str *, uint64_t *, uint64_t, struct dtmf_event *, GQueue
void dtmf_event_free(void *);
int dtmf_code_from_char(char);
const char *dtmf_inject(struct call_media *media, int code, int volume, int duration, int pause);
int dtmf_do_logging(void);
#endif

Loading…
Cancel
Save