Module: kamailio
Branch: master
Commit: f854f2c27bee1b1e4f43565ff1865b88c27387c9
URL:
https://github.com/kamailio/kamailio/commit/f854f2c27bee1b1e4f43565ff1865b8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-05-29T22:49:42+02:00
core: kemi - more log-level message shortcut functions
---
Modified: src/core/kemi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f854f2c27bee1b1e4f43565ff1865b8…
Patch:
https://github.com/kamailio/kamailio/commit/f854f2c27bee1b1e4f43565ff1865b8…
---
diff --git a/src/core/kemi.c b/src/core/kemi.c
index 5a07abb254..ac31b1beb0 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -98,6 +98,36 @@ static int sr_kemi_core_info(sip_msg_t *msg, str *txt)
return 0;
}
+/**
+ *
+ */
+static int sr_kemi_core_warn(sip_msg_t *msg, str *txt)
+{
+ if(txt!=NULL && txt->s!=NULL)
+ LM_WARN("%.*s", txt->len, txt->s);
+ return 0;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_notice(sip_msg_t *msg, str *txt)
+{
+ if(txt!=NULL && txt->s!=NULL)
+ LM_NOTICE("%.*s", txt->len, txt->s);
+ return 0;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_crit(sip_msg_t *msg, str *txt)
+{
+ if(txt!=NULL && txt->s!=NULL)
+ LM_CRIT("%.*s", txt->len, txt->s);
+ return 0;
+}
+
/**
*
*/
@@ -1157,6 +1187,21 @@ static sr_kemi_t _sr_kemi_core[] = {
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init(""), str_init("warn"),
+ SR_KEMIP_NONE, sr_kemi_core_warn,
+ { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init(""), str_init("notice"),
+ SR_KEMIP_NONE, sr_kemi_core_notice,
+ { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init(""), str_init("crit"),
+ SR_KEMIP_NONE, sr_kemi_core_crit,
+ { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ str_init(""), str_init("log"),
SR_KEMIP_NONE, sr_kemi_core_log,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,