From a0e965d487bb38fb087c200c9066342e0bd3d494 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sipsess/connect.c b/src/sipsess/connect.c index 7a67d1e13..5b3f2af57 100644 --- a/src/sipsess/connect.c +++ b/src/sipsess/connect.c @@ -103,7 +103,9 @@ 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);