Browse code

usrloc: do not send keepalives when destroying modules

- GH #3207

Daniel-Constantin Mierla authored on 11/08/2022 19:48:25
Showing 1 changed files
... ...
@@ -33,6 +33,7 @@
33 33
 #include "../../core/forward.h"
34 34
 #include "../../core/globals.h"
35 35
 #include "../../core/pvar.h"
36
+#include "../../core/sr_module.h"
36 37
 #include "../../core/parser/parse_uri.h"
37 38
 #include "../../core/parser/parse_from.h"
38 39
 #include "../../core/parser/parse_to.h"
... ...
@@ -110,6 +111,11 @@ int ul_ka_urecord(urecord_t *ur)
110 111
 	if (ul_ka_mode == ULKA_NONE) {
111 112
 		return 0;
112 113
 	}
114
+
115
+	if(likely(destroy_modules_phase()!=0)) {
116
+		return 0;
117
+	}
118
+
113 119
 	LM_DBG("keepalive for aor: %.*s\n", ur->aor.len, ur->aor.s);
114 120
 	tnow = time(NULL);
115 121