]> 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:42 +0000 (13:59 -0500)
commitdd983edafe678e3b25f455135f77968d7759dee2
treef3919dac959fb62834b55b06a1fd1aafff71cacb
parent654ec4b908f68e6970439216796f8109395f14de
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