pjsip: race condition in registrar
authorKevin Harwell <kharwell@digium.com>
Thu, 26 Sep 2013 18:51:54 +0000 (18:51 +0000)
committerKevin Harwell <kharwell@digium.com>
Thu, 26 Sep 2013 18:51:54 +0000 (18:51 +0000)
commit103ebcf807cb9050ad3653c606cb8cf07c36850f
tree0b2385b16e999ff3dd5f9feeaa6e21c41f0f153a
parent1df1ebdc379d46545c35f1abdff6b100f0c4bcac
pjsip: race condition in registrar

While handling a registration request a race condition could occur if/when two+
clients registered at the same time.  This happened when one request obtained a
copy of the current contacts for an AOR and another request did the same before
the first request updated.  Thus the second would update and overwrite the first
(or vice-versa depending on which actually updated first).  In the case of it
being the same contact two "add" events would be raised.

pjsip registration handling is now serialized to alleviate this issue.

(closes issue AST-1213)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2860/
........

Merged revisions 399897 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/res_pjsip.h
res/res_pjsip.exports.in
res/res_pjsip/security_events.c
res/res_pjsip_registrar.c