summaryrefslogtreecommitdiff
path: root/channels/pjsip
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2015-02-13 17:21:28 +0000
committerRichard Mudgett <rmudgett@digium.com>2015-02-13 17:21:28 +0000
commit4d797f17c5a2ad20830073a5fcec28feaecbefd4 (patch)
tree650d4097833a623843a66ef622a0a6ea0ceb4cd2 /channels/pjsip
parent1995baad71412b740743f2be82d7323f7c15de12 (diff)
res_pjsip_session: Fix double re-INVITE collision crash.
A multi-asterisk box setup with direct media enabled would occasionally crash when two re-INVITE collisions on a call leg happen in a row. The re-INVITE logic only had one timer struct to defer the re-INVITE. When the second collision happens the timer struct is overwritten and put into the timer heap again. Resources for the first timer are leaked and the heap has two positions occupied by the same timer struct. Now the heap ordering is potentially corrupted, the timer will fire twice, and any resources allocated for the second timer will be released twice. * The solution is to put the collided re-INVITE into the delayed requests queue with all the other delayed requests and cherry pick the next request that can come off the queue when an event happens. * Changed to put delayed BYE requests at the head of the delayed queue. There is no sense in processing delayed UPDATEs and re-INVITEs when a BYE has been requested. * Made the start of a BYE request flush the delayed requests queue to prevent a delayed request from overlapping the BYE transaction. I saw a few cases where a delayed re-INVITE got started after the BYE transaction started. * Changed the delayed_request struct to use an enum instead of a string for the request method. Cherry picking the queue is easier with an enum than string comparisons and the compiler can warn if a switch statement does not cover all defined enum values. * Improved the debug output to give more information. It helps to know which channel is involved with an endpoint. Trunks can have many channels associated with the endpoint at the same time. ASTERISK-24727 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/4414/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/pjsip')
0 files changed, 0 insertions, 0 deletions