chan_pjsip: Race between channel answer and bridge setup when using direct media
authorKevin Harwell <kharwell@digium.com>
Fri, 12 Dec 2014 15:31:38 +0000 (15:31 +0000)
committerKevin Harwell <kharwell@digium.com>
Fri, 12 Dec 2014 15:31:38 +0000 (15:31 +0000)
commit72499dc6970e6679c35f8732a0a840f9e3f303b7
treeb66e2ee6cd6eb96a01bcdbfaf2a7d90c241a195d
parent2e6d2b148496c43ffaafd6c8c463f77749d3feee
chan_pjsip: Race between channel answer and bridge setup when using direct media

When direct media is enabled and a pjsip channel is answered a race would occur
between the handling of the answer and bridge setup. Sometimes the media
negotiation would take place after the native bridge was setup. This resulted
in a NULL media address, which in turn resulted in Asterisk using its address
as the remote media address when sending a reinvite.  This patch makes the
chan_pjsip answer handler synchronous thus alleviating the race condition (the
bridge won't start setting things up until after it returns).

ASTERISK-24563 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4257/
........

Merged revisions 429477 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_pjsip.c