diff --git a/daemon/call.c b/daemon/call.c index 80b7da7e5..5b37c5362 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -526,9 +526,6 @@ int call_init() { for (int i = 0; i < NUM_CALL_ITERATORS; i++) mutex_init(&rtpe_call_iterators[i].lock); - thread_create_looper(call_timer, rtpe_config.idle_scheduling, - rtpe_config.idle_priority, "kill calls", 1000000); - if (mqtt_publish_scope() != MPS_NONE) mqtt_timer_start(&global_mqtt_timer, NULL, NULL); diff --git a/daemon/main.c b/daemon/main.c index 202c63183..4e08c9aa7 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -1113,8 +1113,6 @@ no_kernel: if (!rtpe_poller_map) die("poller map creation failed"); - dtls_timer(); - if (call_init()) abort(); @@ -1335,6 +1333,13 @@ int main(int argc, char **argv) { thread_create_looper(ice_slow_timer, rtpe_config.idle_scheduling, rtpe_config.idle_priority, "ICE slow", 1000000); + /* thread to close expired call */ + thread_create_looper(call_timer, rtpe_config.idle_scheduling, + rtpe_config.idle_priority, "kill calls", 1000000); + + /* thread to refresh DTLS certificate */ + dtls_timer(); + if (!is_addr_unspecified(&rtpe_config.redis_ep.address) && initial_rtpe_config.redis_delete_async) thread_create_detach(redis_delete_async_loop, NULL, "redis async");