Module: kamailio
Branch: master
Commit: 0ed7b57b31f108f904609c2991a24396b3e94a87
URL:
https://github.com/kamailio/kamailio/commit/0ed7b57b31f108f904609c2991a2439…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-11T14:17:30+02:00
core: parser - use sip_parser_log for parsing log messages
---
Modified: src/core/parser/msg_parser.c
---
Diff:
https://github.com/kamailio/kamailio/commit/0ed7b57b31f108f904609c2991a2439…
Patch:
https://github.com/kamailio/kamailio/commit/0ed7b57b31f108f904609c2991a2439…
---
diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index 1e24b21e49..682b71cd7c 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -359,8 +359,9 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags,
const int
if (msg->callid==0) {
msg->callid=hf;
} else if(ksr_sip_parser_mode & KSR_SIP_PARSER_MODE_STRICT) {
- ERR("duplicate Call-ID header field [%.*s]\n",
- (end-tmp>100)?100:(int)(end-tmp), tmp);
+ LOG(cfg_get(core, core_cfg, sip_parser_log),
+ "duplicate Call-ID header field [%.*s]\n",
+ (end-tmp>100)?100:(int)(end-tmp), tmp);
goto error;
}
msg->parsed_flag|=HDR_CALLID_F;
@@ -373,8 +374,9 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags,
const int
if (msg->to==0) {
msg->to=hf;
} else if(ksr_sip_parser_mode & KSR_SIP_PARSER_MODE_STRICT) {
- ERR("duplicate To header field [%.*s]\n",
- (end-tmp>100)?100:(int)(end-tmp), tmp);
+ LOG(cfg_get(core, core_cfg, sip_parser_log),
+ "duplicate To header field [%.*s]\n",
+ (end-tmp>100)?100:(int)(end-tmp), tmp);
goto error;
}
msg->parsed_flag|=HDR_TO_F;
@@ -407,8 +409,9 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags,
const int
if(msg->maxforwards==0) {
msg->maxforwards=hf;
} else {
- ERR("duplicate Max-Forwards header field [%.*s]\n",
- (end-tmp>100)?100:(int)(end-tmp), tmp);
+ LOG(cfg_get(core, core_cfg, sip_parser_log),
+ "duplicate Max-Forwards header field [%.*s]\n",
+ (end-tmp>100)?100:(int)(end-tmp), tmp);
goto error;
}
msg->parsed_flag|=HDR_MAXFORWARDS_F;
@@ -429,8 +432,9 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags,
const int
if (msg->content_length==0) {
msg->content_length = hf;
} else if(ksr_sip_parser_mode & KSR_SIP_PARSER_MODE_STRICT) {
- ERR("duplicate Content-Length header field [%.*s]\n",
- (end-tmp>100)?100:(int)(end-tmp), tmp);
+ LOG(cfg_get(core, core_cfg, sip_parser_log),
+ "duplicate Content-Length header field [%.*s]\n",
+ (end-tmp>100)?100:(int)(end-tmp), tmp);
goto error;
}
msg->parsed_flag|=HDR_CONTENTLENGTH_F;