From c7f1c5347c7b62f7a9c0f3073a403788e3cc58dc Mon Sep 17 00:00:00 2001 From: Maximilian Fridrich Date: Thu, 14 Dec 2023 17:11:31 +0100 Subject: [PATCH] connect: do not enforce Contact header in 1XX responses with To tag (#1028) 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);