summaryrefslogtreecommitdiff
path: root/res/res_pjsip_send_to_voicemail.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-02-17 15:31:46 +0000
committerRichard Mudgett <rmudgett@digium.com>2015-02-17 15:31:46 +0000
commit6d3fcfc3c2f49b3909b7ae0ebb74d99e2fedbb65 (patch)
tree8238044471bb69f8a8ae40eeeb41a3af3771b9da /res/res_pjsip_send_to_voicemail.c
parent562b7bf6f09d9ea5ac8e20575d87f4e892609c20 (diff)
res_pjsip_refer: Fix crash from a REFER and BYE collision.
Analyzing a one-off crash on a busy system showed that processing a REFER request had a NULL session channel pointer. The only way I can think of that could cause this is if an outgoing BYE transaction overlapped the incoming REFER transaction in a collision. Asterisk sends a BYE while the phone sends a REFER to complete an attended transfer. * Made check the session channel pointer before processing an incoming REFER request in res_pjsip_refer. * Fixed similar crash potential for res_pjsip supplement incoming request processing for res_pjsip_sdp_rtp INFO, res_pjsip_caller_id INVITE/UPDATE, res_pjsip_messaging MESSAGE, and res_pjsip_send_to_voicemail REFER messages. * Made res_pjsip_messaging respond to a message body too large with a 413 instead of ignoring it. ASTERISK-24700 #close Reported by: Zane Conkle Review: https://reviewboard.asterisk.org/r/4417/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_send_to_voicemail.c')
-rw-r--r--res/res_pjsip_send_to_voicemail.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/res/res_pjsip_send_to_voicemail.c b/res/res_pjsip_send_to_voicemail.c
index 97f55d300..3a57aea7a 100644
--- a/res/res_pjsip_send_to_voicemail.c
+++ b/res/res_pjsip_send_to_voicemail.c
@@ -119,13 +119,17 @@ static int has_call_feature(pjsip_rx_data *rdata)
static int handle_incoming_request(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
{
-
struct ast_datastore *sip_session_datastore;
struct ast_channel *other_party;
+ int has_feature;
+ int has_reason;
- int has_feature = has_call_feature(rdata);
- int has_reason = has_diversion_reason(rdata);
+ if (!session->channel) {
+ return 0;
+ }
+ has_feature = has_call_feature(rdata);
+ has_reason = has_diversion_reason(rdata);
if (!has_feature && !has_reason) {
/* If we don't have a call feature or diversion reason or if
it's not a feature this module is related to then there