Browse Source

MT#55283 add failure mode for dtmf_init

Change-Id: I4896953586ef8c81ce56dca05523dabd9e2773e6
(cherry picked from commit 339c705469)
pull/1887/head
Richard Fuchs 2 years ago
parent
commit
75bdc27aab
3 changed files with 8 additions and 4 deletions
  1. +5
    -2
      daemon/dtmf.c
  2. +2
    -1
      daemon/main.c
  3. +1
    -1
      include/dtmf.h

+ 5
- 2
daemon/dtmf.c View File

@ -13,11 +13,14 @@
static socket_t dtmf_log_sock;
void dtmf_init(void) {
bool dtmf_init(void) {
ilog(LOG_DEBUG, "log dtmf over ng %d", rtpe_config.dtmf_via_ng);
ilog(LOG_DEBUG, "no log injected dtmf %d", rtpe_config.dtmf_no_log_injects);
if (open_v46_socket(&dtmf_log_sock, SOCK_DGRAM))
if (open_v46_socket(&dtmf_log_sock, SOCK_DGRAM)) {
ilog(LOG_ERR, "Failed to open/connect DTMF logging socket: %s", strerror(errno));
return false;
}
return true;
}
static unsigned int dtmf_volume_from_dsp(int vol) {


+ 2
- 1
daemon/main.c View File

@ -1113,7 +1113,8 @@ static void init_everything(void) {
statistics_init();
codeclib_init(0);
media_player_init();
dtmf_init();
if (!dtmf_init())
die("DTMF init failed, see log");
jitter_buffer_init();
t38_init();
if (rtpe_config.mqtt_host && mqtt_init())


+ 1
- 1
include/dtmf.h View File

@ -25,7 +25,7 @@ struct dtmf_event {
enum block_dtmf_mode block_dtmf; // block mode at the time of the event
};
void dtmf_init(void);
bool dtmf_init(void);
int dtmf_event_packet(struct media_packet *, str *, int, uint64_t ts); // 0 = ok, 1 = end event, -1 = error
int dtmf_event_payload(str *, uint64_t *, uint64_t, struct dtmf_event *, GQueue *);
void dtmf_event_free(void *);


Loading…
Cancel
Save