]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_fax: Fix deadlock setting FAXMODE channel variable. 16/3716/1
authorRichard Mudgett <rmudgett@digium.com>
Tue, 23 Aug 2016 15:39:01 +0000 (10:39 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 25 Aug 2016 22:11:17 +0000 (17:11 -0500)
commitaaef3b71751d9418e5b11824e7f9b33da5363df6
tree107a0c2b9835867c2fd05792391aa8e97412658d
parenta53aebabbc182154153e955640b534d67b8648d3
res_fax: Fix deadlock setting FAXMODE channel variable.

ASTERISK-25980 added the FAXMODE channel variable to res_fax.c.
Unfortunately, it also introduced a deadlock potential because
set_channel_variables() which sets FAXMODE can be called during a
masquerade.  The ast_channel_get_t38_state() which gets the value used to
set FAXMODE cannot be called with the channel locked.  As a result, local
channels can deadlock because of how they must acquire the locks necessary
to operate.

The intent of FAXMODE is for dialplan to know how a fax was transferred
after the fax completes.  However, the previous patch sets FAXMODE to the
channel's current T.38 state AFTER the fax has completed and where T.38
may have already disconnected.

* Set FAXMODE based upon T.38 negotiations exchanged either with the fax
applications or the fax framehooks.

ASTERISK-26203
Reported by: Etienne Lessard

ASTERISK-24822
Reported by: David Brillert

ASTERISK-22732
Reported by: Richard Mudgett

Change-Id: Id525747254b64c1efe8b1b5973d52ff9719c2ae1
include/asterisk/res_fax.h
res/res_fax.c