diff --git a/daemon/call.c b/daemon/call.c index 407cd193d..a2203a5a2 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3931,6 +3931,7 @@ static call_t *call_create(const str *callid) { c->created = rtpe_now; c->dtls_cert = dtls_cert(); c->tos = rtpe_config.default_tos; + c->poller = rtpe_get_poller(); if (rtpe_config.cpu_affinity) c->cpu_affinity = call_socket_cpu_affinity++ % rtpe_config.cpu_affinity; else diff --git a/daemon/media_socket.c b/daemon/media_socket.c index f17eb4779..86137bc33 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -3268,7 +3268,7 @@ stream_fd *stream_fd_new(socket_t *fd, call_t *call, struct local_intf *lif) { pi.closed = stream_fd_closed; if (sfd->socket.fd != -1) { - struct poller *p = rtpe_get_poller(); + struct poller *p = call->poller; if (poller_add_item(p, &pi)) ilog(LOG_ERR, "Failed to add stream_fd to poller"); else diff --git a/include/call.h b/include/call.h index 5714d366f..672af007c 100644 --- a/include/call.h +++ b/include/call.h @@ -673,6 +673,9 @@ struct call { mutex_t buffer_lock; call_buffer_t buffer; + // use a single poller for all sockets within the call + struct poller *poller; + /* master_lock protects the entire call and all the contained objects. * * All the fields and any nested sub-object must: diff --git a/t/test-stats.c b/t/test-stats.c index 52a91042f..842015a02 100644 --- a/t/test-stats.c +++ b/t/test-stats.c @@ -15,9 +15,9 @@ struct rtpengine_config rtpe_config = { .dtls_rsa_key_size = 2048, }; struct rtpengine_config initial_rtpe_config; -struct poller **rtpe_pollers; +struct poller **rtpe_pollers = (struct poller *[]) {NULL}; struct poller *rtpe_control_poller; -unsigned int num_media_pollers; +unsigned int num_media_pollers = 1; unsigned int rtpe_poller_rr_iter; GString *dtmf_logs; GQueue rtpe_control_ng = G_QUEUE_INIT;