chan_pjsip: Don't assume a session will have a channel.
authorJoshua Colp <jcolp@digium.com>
Sun, 12 Mar 2017 14:21:16 +0000 (14:21 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 13 Mar 2017 18:37:55 +0000 (12:37 -0600)
commit12460b05c1abd37e412e155e47a6e349a2df3338
tree3762692e76314bd46cfca1b35a0e2a9f5334d8be
parent018e01543dd7392fd99873090b1781c05362b3cf
chan_pjsip: Don't assume a session will have a channel.

When querying for PJSIP specific information using the dialplan
function CHANNEL() it is possible that the underlying session
will no longer have a channel associated with it. This is
most likely to occur when the RTCP HEP module attempts to get
the channel name. If this happens then a crash will occur.

This change just adds a check that the channel exists on the
session before querying it.

ASTERISK-26857

Change-Id: I113479cffff6ae64cf8ed089e9e1565223426f01
channels/pjsip/dialplan_functions.c