[sr-dev] git:5.6:272649c1: nats: fix the nats:connected event_route not being triggered on a successful connect

Daniel-Constantin Mierla miconda at gmail.com
Mon Jul 4 11:00:27 CEST 2022


Module: kamailio
Branch: 5.6
Commit: 272649c1c4b718067abc776186529b0e0c40e363
URL: https://github.com/kamailio/kamailio/commit/272649c1c4b718067abc776186529b0e0c40e363

Author: Seven Du <dujinfang at x-y-t.cn>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-07-04T10:33:56+02:00

nats: fix the nats:connected event_route not being triggered on a successful connect

(cherry picked from commit b3c8329cfbfa19613dfbadaea7f220443dbb7f55)

---

Modified: src/modules/nats/nats_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/272649c1c4b718067abc776186529b0e0c40e363.diff
Patch: https://github.com/kamailio/kamailio/commit/272649c1c4b718067abc776186529b0e0c40e363.patch

---

diff --git a/src/modules/nats/nats_mod.c b/src/modules/nats/nats_mod.c
index 2a53beda82f..6108d555e81 100644
--- a/src/modules/nats/nats_mod.c
+++ b/src/modules/nats/nats_mod.c
@@ -298,7 +298,10 @@ int _nats_pub_worker_proc(
 			!= NATS_OK) {
 		LM_ERR("could not connect to nats servers [%s]\n",
 				natsStatus_GetText(s));
+	} else {
+		connectedCB(worker->nc->conn, NULL);
 	}
+
 	s = natsOptions_SetEventLoop(worker->nc->opts, (void *)worker->uvLoop,
 			natsLibuv_Attach, natsLibuv_Read, natsLibuv_Write,
 			natsLibuv_Detach);




More information about the sr-dev mailing list