chan_dahdi.c: Lock private struct for ast_write().
authorRichard Mudgett <rmudgett@digium.com>
Wed, 5 Aug 2015 19:21:50 +0000 (14:21 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 11 Aug 2015 21:58:11 +0000 (16:58 -0500)
commitb9b957d4e921a78b0918b584cb6e3d9a34abc160
tree7c2f3be797171773bdcd87a21f011f7cb6911a35
parente188192ad10a8570785986a46666b91d7a448b75
chan_dahdi.c: Lock private struct for ast_write().

There is a window of opportunity for DTMF to not go out if an audio frame
is in the process of being written to DAHDI while another thread starts
sending DTMF.  The thread sending the audio frame could be past the
currently dialing check before being preempted by another thread starting
a DTMF generation request.  When the thread sending the audio frame
resumes it will then cause DAHDI to stop the DTMF tone generation.  The
result is no DTMF goes out.

* Made dahdi_write() lock the private struct before writing to the DAHDI
file descriptor.

ASTERISK-25315
Reported by John Hardin

Change-Id: Ib4e0264cf63305ed5da701188447668e72ec9abb
channels/chan_dahdi.c