Browse code

rtp_media_server: drop in-dialog messages for

disconnected calls

Julien Chavanton authored on 08/07/2019 19:19:05
Showing 1 changed files
... ...
@@ -1072,7 +1072,15 @@ static int rms_sip_request_f(struct sip_msg *msg)
1072 1072
 		LM_NOTICE("initial INVITE\n");
1073 1073
 		return 1;
1074 1074
 	} else {
1075
-		LM_NOTICE("in dialog message\n");
1075
+		LM_NOTICE("in dialog message, state [%d]\n", di->state);
1076
+		if (di->state == RMS_ST_DISCONNECTING) {
1077
+			return -1; // ignore in dialog message in this state
1078
+		} else if (di->state == RMS_ST_DISCONNECTED) {
1079
+			rms_create_trans(msg);
1080
+			if (!tmb.t_reply(msg, 481, "Call/Transaction Does Not Exist"))
1081
+				return -1;
1082
+			return 1;
1083
+		}
1076 1084
 	}
1077 1085
 
1078 1086
 	rms_sip_forward(di, msg, method);