]> 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)
committerMichael Bradeen <mbradeen@sangoma.com>
Mon, 31 Oct 2022 15:09:24 +0000 (10:09 -0500)
commitd7dae7b1fcc177d37e57a3013291a06fdae19eee
treef9dbdbb1cb86add9a09ca72a079da4b15db53fbd
parent09af7e0acacec7df57ae00b7a40acf167ca7361a
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