]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_pjsip: Lock channel when checking for RTP changes. 03/3003/1
authorMark Michelson <mmichelson@digium.com>
Thu, 9 Jun 2016 15:37:53 +0000 (10:37 -0500)
committerMark Michelson <mmichelson@digium.com>
Thu, 9 Jun 2016 15:37:53 +0000 (10:37 -0500)
commit715ef071a1d27d550ddc3f83d9ff569381b8fddc
tree40a491c48381d62fb7b369bf258a636f4c83c894
parentbd3b6e9f193c7f07d86070df4866a4f5cbd82055
chan_pjsip: Lock channel when checking for RTP changes.

bridge_native_rtp can call into an RTP-capable channel driver in order
for the driver to update information about who the channel is
communicating with. For SIP channel drivers, this means deactivating
RTCP and sending a reinvite so that the endpoints can communicate
directly.

bridge_native_rtp does the right thing and has the channel locked when
calling into the channel driver. chan_pjsip can't alter session
properties in this thread, though. chan_pjsip queues a task on the
session serializer in order to update properties there.

The problem is that this queued task was not locking the channel. This
meant that the queued task could attempt to deactivate RTCP at the same
time that the channel thread was attempting to process an incoming RTCP
packet. This could lead to a crash.

This patch fixes the issue by locking the channel in the queued task
when altering RTP properties.

ASTERISK-26092 #close
Reported by Niklas Larsson

Change-Id: I3464e226a3c41f6b915f97891e07fa1599e2a159
channels/chan_pjsip.c