]> 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)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 31 Oct 2022 17:49:40 +0000 (12:49 -0500)
commitb0df75eb0984607bdb20412cbb78d45d3b09363d
treee8331b66a2f6e91f83a731a412b465e5cd79290f
parente0d243396fc9b2fa60fd4c4e3c20e3709e36a96e
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