From d1027d02a0e0d7738e65d37b596e9344abf82fdb Mon Sep 17 00:00:00 2001 From: Maximilian Fridrich Date: Tue, 12 Dec 2023 10:41:04 +0100 Subject: [PATCH] connect: do not enforce Contact header in 1XX responses with To tag There are some SIP UAs which send 1XX responses with a To tag and without a Contact header. --- src/sipsess/connect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sipsess/connect.c b/src/sipsess/connect.c index 7a67d1e13..a27d323ba 100644 --- a/src/sipsess/connect.c +++ b/src/sipsess/connect.c @@ -103,7 +103,8 @@ static void invite_resp_handler(int err, const struct sip_msg *msg, void *arg) goto out; } - if (pl_isset(&msg->to.tag)) { + contact = sip_msg_hdr(msg, SIP_HDR_CONTACT); + if (pl_isset(&msg->to.tag) && contact) { err = sip_dialog_established(sess->dlg) ? sip_dialog_update(sess->dlg, msg) : sip_dialog_create(sess->dlg, msg);