diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index cecfa5072c..ca6ddaecfb 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2944,7 +2944,7 @@ static void event_callback(nua_event_t event, switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); nua_respond(nh, SIP_401_UNAUTHORIZED, TAG_END()); - return; + goto done; } } @@ -3067,6 +3067,8 @@ static void event_callback(nua_event_t event, } + done: + if (session) { switch_core_session_rwunlock(session); }