sl: skip sending reply if FL_MSG_NOREPLY is set
authorDaniel-Constantin Mierla <miconda@gmail.com>
Wed, 12 Sep 2018 09:53:12 +0000 (11:53 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Wed, 12 Sep 2018 09:53:12 +0000 (11:53 +0200)
src/modules/sl/sl.c
src/modules/sl/sl_funcs.c

index c523e89..4d17130 100644 (file)
@@ -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 {
index dbc5105..1e408e6 100644 (file)
@@ -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) {