[sr-dev] git:master:7c39625e: sl: skip sending reply if FL_MSG_NOREPLY is set

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 12 15:36:41 CEST 2018


Module: kamailio
Branch: master
Commit: 7c39625e94a3c8cb5a2e1879454b4ce7f1888a93
URL: https://github.com/kamailio/kamailio/commit/7c39625e94a3c8cb5a2e1879454b4ce7f1888a93

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-09-12T11:53:12+02:00

sl: skip sending reply if FL_MSG_NOREPLY is set

---

Modified: src/modules/sl/sl.c
Modified: src/modules/sl/sl_funcs.c

---

Diff:  https://github.com/kamailio/kamailio/commit/7c39625e94a3c8cb5a2e1879454b4ce7f1888a93.diff
Patch: https://github.com/kamailio/kamailio/commit/7c39625e94a3c8cb5a2e1879454b4ce7f1888a93.patch

---

diff --git a/src/modules/sl/sl.c b/src/modules/sl/sl.c
index c523e8913b..4d17130a13 100644
--- a/src/modules/sl/sl.c
+++ b/src/modules/sl/sl.c
@@ -250,6 +250,11 @@ int send_reply(struct sip_msg *msg, int code, str *reason)
 	struct cell *t;
 	int ret = 1;
 
+	if(msg->msg_flags & FL_MSG_NOREPLY) {
+		LM_INFO("message marked with no-reply flag\n");
+		return -2;
+	}
+
 	if(reason->s[reason->len-1]=='\0') {
 		r = reason->s;
 	} else {
diff --git a/src/modules/sl/sl_funcs.c b/src/modules/sl/sl_funcs.c
index dbc5105d2c..1e408e653f 100644
--- a/src/modules/sl/sl_funcs.c
+++ b/src/modules/sl/sl_funcs.c
@@ -133,6 +133,11 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag)
 	if (msg->first_line.u.request.method_value==METHOD_ACK)
 		goto error;
 
+	if(msg->msg_flags & FL_MSG_NOREPLY) {
+		LM_INFO("message marked with no-reply flag\n");
+		return -2;
+	}
+
 	init_dest_info(&dst);
 	if (reply_to_via) {
 		if (update_sock_struct_from_via(&dst.to, msg, msg->via1 )==-1)
@@ -355,6 +360,11 @@ int sl_reply_error(struct sip_msg *msg )
 	int sip_error;
 	int ret;
 
+	if(msg->msg_flags & FL_MSG_NOREPLY) {
+		LM_INFO("message marked with no-reply flag\n");
+		return -2;
+	}
+
 	ret=err2reason_phrase( prev_ser_error, &sip_error,
 		err_buf, sizeof(err_buf), "SL");
 	if (ret>0) {




More information about the sr-dev mailing list