diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f717c77eef..1b4fa4afe3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23114,9 +23114,11 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest /* This 200 OK's SDP is not acceptable, so we need to ack, then hangup */ /* For re-invites, we try to recover */ ast_set_flag(&p->flags[0], SIP_PENDINGBYE); - ast_channel_hangupcause_set(p->owner, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL); p->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL; - sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL); + if (p->owner) { + ast_channel_hangupcause_set(p->owner, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL); + sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL); + } } } ast_rtp_instance_activate(p->rtp);