diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c index 1d39e0fd2802f230014e79c07322392872ce5e66..c40f7f9eddb4eadd7e95448fec1165678700fdab 100644 --- a/res/res_pjsip/pjsip_distributor.c +++ b/res/res_pjsip/pjsip_distributor.c @@ -287,7 +287,9 @@ static pj_bool_t distributor(pjsip_rx_data *rdata) * some sort of terrible condition and don't need to be adding more work to the threadpool. * It's in our best interest to send back a 503 response and be done with it. */ - pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 503, NULL, NULL, NULL); + if (rdata->msg_info.msg->type == PJSIP_REQUEST_MSG) { + pjsip_endpt_respond_stateless(ast_sip_get_pjsip_endpoint(), rdata, 503, NULL, NULL, NULL); + } ao2_cleanup(clone->endpt_info.mod_data[endpoint_mod.id]); pjsip_rx_data_free_cloned(clone); } else {