Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 85764) +++ channels/chan_sip.c (working copy) @@ -14431,7 +14431,10 @@ /* XXX Should we authenticate OPTIONS? XXX */ if (ast_strlen_zero(p->context)) ast_string_field_set(p, context, default_context); - if (res < 0) + + if (ast_shutting_down()) + transmit_response_with_allow(p, "503 Unavailable", req, 0); + else if (res < 0) transmit_response_with_allow(p, "404 Not Found", req, 0); else transmit_response_with_allow(p, "200 OK", req, 0);