Merged revisions 308945 via svnmerge from
authorAlec L Davis <sivad.a@paradise.net.nz>
Fri, 25 Feb 2011 18:58:10 +0000 (18:58 +0000)
committerAlec L Davis <sivad.a@paradise.net.nz>
Fri, 25 Feb 2011 18:58:10 +0000 (18:58 +0000)
commitb6e37118c9220f65e9bcb77bf88ccb46796906a2
tree05b4cd119d2d4b9cd137ef9b72ab07da4fad9af7
parent642d6c306c8e9146bf85c3080ec9af4bef3fd011
Merged revisions 308945 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r308945 | alecdavis | 2011-02-26 07:52:53 +1300 (Sat, 26 Feb 2011) | 21 lines

  Fix Deadlock with attended transfer of SIP call

  Call path
    sip_set_rtp_peer (locks chan then pvt)
     transmit_reinvite_with_sdp
      try_suggested_sip_codec
       pbx_builtin_getvar_helper (locks p->owner)

  But by the time p->owner lock was attempted, seems as though chan and p->owner were different.

  So in sip_set_rtp_peer, lock pvt first then lock p->owner using deadlocking methods.

  (closes issue #18837)
  Reported by: alecdavis
  Patches:
        bug18837-trunk.diff3.txt uploaded by alecdavis (license 585)
  Tested by: alecdavis, Irontec, ZX81, cmaj

  Review: [https://reviewboard.asterisk.org/r/1126/]
........

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