Module: sip-router Branch: master Commit: 63bbaabba4eaf14c427896bd1e0467466616f3f0 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=63bbaabb...
Author: Alex Hermann alex@speakup.nl Committer: Alex Hermann alex@speakup.nl Date: Fri Oct 24 15:13:10 2014 +0200
dmq: Don't try to use a (worker)queue before it is initialized
It seems SIP traffic is handled before all children are initialized...
---
modules/dmq/worker.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules/dmq/worker.c b/modules/dmq/worker.c index d92c7fd..1ac77f0 100644 --- a/modules/dmq/worker.c +++ b/modules/dmq/worker.c @@ -154,6 +154,10 @@ int add_dmq_job(struct sip_msg* msg, dmq_peer_t* peer) LM_ERR("error in add_dmq_job: no workers spawned\n"); goto error; } + if (!workers[0].queue) { + LM_ERR("workers not (yet) initialized\n"); + goto error; + } /* initialize the worker with the first one */ worker = workers; /* search for an available worker, or, if not possible,