From b78995c6609d76b050eb093173a504f199ace03d Mon Sep 17 00:00:00 2001 From: Dmitry Verenitsin Date: Fri, 25 Sep 2026 01:04:49 +0500 Subject: [PATCH] [mod_sofia] Keep the dialog handle after answering a refer NOTIFY (#3189) `sofia_handle_sip_i_notify()` answered an in-dialog `refer` NOTIFY and then fell through to the generic handling, which sent a second response and, on a terminated subscription, destroyed the dialog's handle. A channel kept up after the REFER outcome (`sip_refer_continue_after_reply=true`) could no longer send a REFER, re-INVITE or BYE. Return right after the `200 OK`; `refer` NOTIFYs are no longer forwarded under `proxy-notify-events`. Co-authored-by: Chris Rienzo --- src/mod/endpoints/mod_sofia/sofia.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 98c0becf6f..93583895c7 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -693,6 +693,7 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status, } } nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_IF(!zstr(session_id_header), SIPTAG_HEADER_STR(session_id_header)), TAG_END()); + return; } /* if no session, assume it could be an incoming notify from a gateway subscription */