rtp_media_server: drop in-dialog messages for
authorJulien Chavanton <jchavanton@gmail.com>
Mon, 8 Jul 2019 19:19:05 +0000 (19:19 +0000)
committerJulien Chavanton <jchavanton@gmail.com>
Mon, 8 Jul 2019 19:45:10 +0000 (19:45 +0000)
disconnected calls

src/modules/rtp_media_server/rtp_media_server.c

index 47d5ffd..37ddb1b 100644 (file)
@@ -1072,7 +1072,15 @@ static int rms_sip_request_f(struct sip_msg *msg)
                LM_NOTICE("initial INVITE\n");
                return 1;
        } else {
-               LM_NOTICE("in dialog message\n");
+               LM_NOTICE("in dialog message, state [%d]\n", di->state);
+               if (di->state == RMS_ST_DISCONNECTING) {
+                       return -1; // ignore in dialog message in this state
+               } else if (di->state == RMS_ST_DISCONNECTED) {
+                       rms_create_trans(msg);
+                       if (!tmb.t_reply(msg, 481, "Call/Transaction Does Not Exist"))
+                               return -1;
+                       return 1;
+               }
        }
 
        rms_sip_forward(di, msg, method);