From 71aa3cb03ca4ddc004c36419362b64fc385bdb17 Mon Sep 17 00:00:00 2001 From: Jakub Karolczyk Date: Fri, 9 Sep 2022 11:07:19 +0100 Subject: [PATCH] [mod_sofia] Fix handling of late offer --- src/mod/endpoints/mod_sofia/sofia.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 82f990d906..9022039eb3 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -8576,7 +8576,11 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, if (!tech_pvt) goto done; if (tech_pvt->mparams.num_codecs) { - match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE); + if (sofia_test_flag(tech_pvt, TFLAG_GOT_ACK)) { + match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST); + } else { + match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE); + } } if (match) {