You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kamailio/debian/patches/upstream/cfgt-log-info-when-node-is-...

43 lines
1.4 KiB

From: Victor Seva <vseva@sipwise.com>
Date: Thu, 3 Dec 2020 14:32:45 +0100
Subject: cfgt: log info when node is created and saved
---
src/modules/cfgt/cfgt_int.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/modules/cfgt/cfgt_int.c b/src/modules/cfgt/cfgt_int.c
index c47a1ce..7b0c991 100644
--- a/src/modules/cfgt/cfgt_int.c
+++ b/src/modules/cfgt/cfgt_int.c
@@ -429,6 +429,8 @@ void cfgt_save_node(cfgt_node_p node)
}
fclose(fp);
node->jdoc.free_fn(dest.s);
+ LM_INFO("*** node uuid:[%.*s] id:[%d] saved ***\n",
+ STR_FMT(&node->uuid), node->msgid);
} else {
LM_ERR("Can't open file [%s] to write\n", dest.s);
pkg_free(dest.s);
@@ -767,7 +769,7 @@ int cfgt_msgin(sr_event_param_t *evp)
int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar)
{
str unknown = {"unknown", 7};
- int get_hdr_result = 0;
+ int get_hdr_result = 0, res;
if(_cfgt_node) {
if(_cfgt_node->msgid == 0) {
@@ -786,7 +788,10 @@ int cfgt_pre(struct sip_msg *msg, unsigned int flags, void *bar)
}
pkg_str_dup(&_cfgt_node->uuid, &unknown);
}
- return _cfgt_get_uuid_id(_cfgt_node);
+ res = _cfgt_get_uuid_id(_cfgt_node);
+ LM_INFO("*** node uuid:[%.*s] id:[%d] created ***\n",
+ STR_FMT(&_cfgt_node->uuid), _cfgt_node->msgid);
+ return res;
} else {
LM_DBG("_cfgt_node->uuid:[%.*s]\n", _cfgt_node->uuid.len,
_cfgt_node->uuid.s);