diff --git a/daemon/dtmf.c b/daemon/dtmf.c index 0f578dffa..c787d91aa 100644 --- a/daemon/dtmf.c +++ b/daemon/dtmf.c @@ -15,11 +15,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) { diff --git a/daemon/main.c b/daemon/main.c index 42e36fc1f..30d6224dd 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -1194,7 +1194,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()) diff --git a/include/dtmf.h b/include/dtmf.h index 6ac7e5830..70367f210 100644 --- a/include/dtmf.h +++ b/include/dtmf.h @@ -23,7 +23,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 *, dtmf_event_q *); void dtmf_event_free(struct dtmf_event *);