res_pjsip_registrar.c: Fix AOR and pjproject group deadlock.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 6 Nov 2017 22:37:49 +0000 (16:37 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 7 Nov 2017 18:01:25 +0000 (13:01 -0500)
commit0cfc3cbf0271ba527d74f3117fd779b3df264c18
treee3c648ecd9f9c8f1df8dac8f2bd1443a1336c176
parent06746b0af503a3abd8ecb4fcb0150194f0d3f25f
res_pjsip_registrar.c: Fix AOR and pjproject group deadlock.

One of the patches for ASTERISK_27147 introduced a deadlock regression.
When the connection oriented transport shut down, the code attempted to
remove the associated contact.  However, that same transport had just
requested a registration that we hadn't responded to yet.  Depending
upon timing we could deadlock.

* Made send the REGISTER response after we completed processing the
request contacts and released the AOR lock to avoid the deadlock.

ASTERISK-27391

Change-Id: I89a90f87cb7a02facbafb44c75d8845f93417364
res/res_pjsip_registrar.c