summaryrefslogtreecommitdiff
path: root/res/res_pjsip
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2015-11-12 11:17:51 -0600
committerMark Michelson <mmichelson@digium.com>2015-11-12 11:17:51 -0600
commit40b58a5d2b2acddc8ff616b4c0fbdc808e16a9da (patch)
tree8404a4565cf98f91d25060a3d106a0b2f186b663 /res/res_pjsip
parent6879ce7fba6de293c538c80a4eb273396c0e4d9c (diff)
res_pjsip distributor: Don't send 503 response to responses.
When the SIP threadpool is backed up with tasks, we send 503 responses to ensure that we don't try to overload ourselves. The problem is that we were not insuring that we were not trying to send a 503 to an incoming SIP response. This change makes it so that we only send the 503 on incoming requests. Change-Id: Ie2b418d89c0e453cc6c2b5c7d543651c981e1404
Diffstat (limited to 'res/res_pjsip')
-rw-r--r--res/res_pjsip/pjsip_distributor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index 1d39e0fd2..c40f7f9ed 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 {