Browse Source

topos: allow various replies for INVITE without contact

- GH #1720
Daniel-Constantin Mierla 6 years ago
parent
commit
416d79b462
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/modules/topos/tps_storage.c

+ 12 - 0
src/modules/topos/tps_storage.c

@@ -353,6 +353,18 @@ int tps_storage_link_msg(sip_msg_t *msg, tps_data_t *td, int dir)
 			/* no mandatory contact unless is INVITE - done */
 			return 0;
 		}
+		if(msg->first_line.type==SIP_REPLY) {
+			if(msg->first_line.u.reply.statuscode>=100
+					&& msg->first_line.u.reply.statuscode<200
+					&& msg->first_line.u.reply.statuscode!=183) {
+				/* provisional response with no mandatory contact header */
+				return 0;
+			}
+			if(msg->first_line.u.reply.statuscode>=400) {
+				/* failure response with no mandatory contact header */
+				return 0;
+			}
+		}
 		LM_ERR("bad sip message or missing Contact hdr\n");
 		goto error;
 	}