]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_fax: Don't start a gateway if either channel is hung up
authorGeorge Joseph <gjoseph@digium.com>
Wed, 3 Jun 2020 16:23:31 +0000 (10:23 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 10 Jun 2020 18:59:17 +0000 (13:59 -0500)
commit816a0824708aa29564580f9f81c61285691bffce
treef0a89e12c5c2180025723805092a145fa6fef29e
parentbc0207d0dd0118cd07cd959a96753f385c58e68d
res_fax: Don't start a gateway if either channel is hung up

When fax_gateway_framehook is called and a gateway hasn't already
been started, the framehook gets the t38 state for both the current
channel and the peer.  That call trickles down to the channel
driver which determines the state.  If either channel is hung up
(or in the process of being hung up), the channel driver's tech_pvt
is going to be NULL which, in the case of chan_pjsip, will cause a
segfault.

* Added a hangup check for both the channel and peer channel
  before starting a fax gateway.

* Added a check for NULL tech_pvt to chan_pjsip_queryoption
  so we don't attempt to reference a tech_pvt that's already
  gone.

ASTERISK-28923
Reported by: Yury Kirsanov

Change-Id: I4e10e63b667bbb68c1c8623f977488f5d807897c
channels/chan_pjsip.c
res/res_fax.c