Browse code

cfgt: log info when node is created and saved

Victor Seva authored on 04/12/2020 09:23:04
Showing 1 changed files
... ...
@@ -429,6 +429,8 @@ void cfgt_save_node(cfgt_node_p node)
429 429
 		}
430 430
 		fclose(fp);
431 431
 		node->jdoc.free_fn(dest.s);
432
+		LM_INFO("*** node uuid:[%.*s] id:[%d] saved ***\n",
433
+				STR_FMT(&node->uuid), node->msgid);
432 434
 	} else {
433 435
 		LM_ERR("Can't open file [%s] to write\n", dest.s);
434 436
 		pkg_free(dest.s);
... ...
@@ -767,7 +769,7 @@ int cfgt_msgin(sr_event_param_t *evp)
767 769
 int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar)
768 770
 {
769 771
 	str unknown = {"unknown", 7};
770
-	int get_hdr_result = 0;
772
+	int get_hdr_result = 0, res;
771 773
 
772 774
 	if(_cfgt_node) {
773 775
 		if(_cfgt_node->msgid == 0) {
... ...
@@ -786,7 +788,10 @@ int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar)
786 788
 				}
787 789
 				pkg_str_dup(&_cfgt_node->uuid, &unknown);
788 790
 			}
789
-			return _cfgt_get_uuid_id(_cfgt_node);
791
+			res = _cfgt_get_uuid_id(_cfgt_node);
792
+			LM_INFO("*** node uuid:[%.*s] id:[%d] created ***\n",
793
+				STR_FMT(&_cfgt_node->uuid), _cfgt_node->msgid);
794
+			return res;
790 795
 		} else {
791 796
 			LM_DBG("_cfgt_node->uuid:[%.*s]\n", _cfgt_node->uuid.len,
792 797
 					_cfgt_node->uuid.s);