]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: prevent crash on websocket disconnect
authorMike Bradeen <mbradeen@sangoma.com>
Thu, 13 Oct 2022 16:19:17 +0000 (10:19 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 1 Nov 2022 10:51:21 +0000 (05:51 -0500)
commit40ce4345122ee98c23176e3d5f6134870980ec50
tree709cc5b813e888b3f1d46bb32b08065e3a50e6e2
parent628551bb140a9333ec55be436c6380490fe9cf16
res_pjsip: prevent crash on websocket disconnect

When a websocket (or potentially any stateful connection) is quickly
created then destroyed, it is possible that the qualify thread will
destroy the transaction before the initialzing thread is finished
with it.

Depending on the timing, this can cause an assertion within pjsip.

To prevent this, ast_send_stateful_response will now create the group
lock and add a reference to it before creating the transaction.

While this should resolve the crash, there is still the potential that
the contact will not be cleaned up properly, see:ASTERISK~29286. As a
result, the contact has to 'time out' before it will be removed.

ASTERISK-28689

Change-Id: Id050fded2247a04d8f0fc5b8a2cf3e5482cb8cee
res/res_pjsip.c