]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res/res_pjsip: Purge contacts when an AoR is deleted 07/1207/1
authorMatt Jordan <mjordan@digium.com>
Mon, 7 Sep 2015 16:15:59 +0000 (11:15 -0500)
committerMatt Jordan <mjordan@digium.com>
Mon, 7 Sep 2015 16:15:59 +0000 (11:15 -0500)
commitc3e6debdb95a5895894ed2b58b600fcdf17927b9
tree9c6b267f461ecc17f434b1db1c88eb80c603f3ec
parentd238cf33a9bfe86f9ebdb204384df820098c2670
res/res_pjsip: Purge contacts when an AoR is deleted

When an AoR is deleted by an external mechanism, such as through ARI, we
currently do not remove dynamic contacts that were created for that AoR as a
result of a received REGISTER request. As a result, re-creating the AoR will
cause the dynamic contact to be interpreted as a persistent contact, leading
to some rather strange state being created for the contacts/endpoints.

This patch adds a sorcery observer for the 'aor' object. When a delete is
issued on the underlying sorcery object, the observer is called, and all
contacts created and persisted in sorcery for that AoR are also removed. Note
that we don't want to perform this action when an AO2 object that is an AoR is
destroyed, as the AoR can still exist in the backing storage (and we would
thus be removing valid contacts from an AoR that still "exists".)

ASTERISK-25381 #close

Change-Id: I6697e51ef6b2858b5d63401f35dc378bb0f90328
res/res_pjsip/location.c