2
0
Эх сурвалжийг харах

dmq: test of if reply code and reason are set to send the response

Daniel-Constantin Mierla 5 жил өмнө
parent
commit
a675ab88fe
1 өөрчлөгдсөн 10 нэмэгдсэн , 5 устгасан
  1. 10 5
      src/modules/dmq/worker.c

+ 10 - 5
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++;