Module: kamailio Branch: master Commit: a675ab88fefac75145a7d563fee0431458630529 URL: https://github.com/kamailio/kamailio/commit/a675ab88fefac75145a7d563fee04314...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-04-24T21:14:24+02:00
dmq: test of if reply code and reason are set to send the response
---
Modified: src/modules/dmq/worker.c
---
Diff: https://github.com/kamailio/kamailio/commit/a675ab88fefac75145a7d563fee04314... Patch: https://github.com/kamailio/kamailio/commit/a675ab88fefac75145a7d563fee04314...
---
diff --git a/src/modules/dmq/worker.c b/src/modules/dmq/worker.c index 38b49e4512..a2ccc636bf 100644 --- a/src/modules/dmq/worker.c +++ b/src/modules/dmq/worker.c @@ -126,12 +126,17 @@ void worker_loop(int id) } } /* send the reply */ - if(slb.freply(current_job->msg, peer_response.resp_code, - &peer_response.reason) - < 0) { - LM_ERR("error sending reply\n"); + if(peer_response.resp_code>0 && peer_response.reason.s!=NULL + && peer_response.reason.len>0) { + if(slb.freply(current_job->msg, peer_response.resp_code, + &peer_response.reason) + < 0) { + LM_ERR("error sending reply\n"); + } else { + LM_DBG("done sending reply\n"); + } } else { - LM_DBG("done sending reply\n"); + LM_WARN("no reply sent\n"); } worker->jobs_processed++;