Module: kamailio
Branch: master
Commit: af7e6e55182da0bf44a159e21df8948556bf71ae
URL:
https://github.com/kamailio/kamailio/commit/af7e6e55182da0bf44a159e21df8948…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-09-13T12:24:53+02:00
sanity: send 500 reply if sanity info is not set for the current request
---
Modified: src/modules/sanity/sanity.c
---
Diff:
https://github.com/kamailio/kamailio/commit/af7e6e55182da0bf44a159e21df8948…
Patch:
https://github.com/kamailio/kamailio/commit/af7e6e55182da0bf44a159e21df8948…
---
diff --git a/src/modules/sanity/sanity.c b/src/modules/sanity/sanity.c
index 8cde4729c2..d00eab5d6d 100644
--- a/src/modules/sanity/sanity.c
+++ b/src/modules/sanity/sanity.c
@@ -76,10 +76,14 @@ int ki_sanity_reply(sip_msg_t *msg)
}
if(!(msg->msg_flags&FL_MSG_NOREPLY)) {
- if(msg->id != _ksr_sanity_info.msgid
+ if(_ksr_sanity_info.code==0 || _ksr_sanity_info.reason[0]=='\0'
+ || msg->id != _ksr_sanity_info.msgid
|| msg->pid != _ksr_sanity_info.msgpid) {
- LM_INFO("reply sending invoked for a different sip request\n");
- return -1;
+ LM_INFO("no sanity reply info set - sending 500\n");
+ if(slb.zreply(msg, 500, "Server Sanity Failure") < 0) {
+ return -1;
+ }
+ return 1;
}
if(slb.zreply(msg, _ksr_sanity_info.code, _ksr_sanity_info.reason) < 0) {
return -1;