]> git.ipfire.org Git - thirdparty/asterisk.git/commit
sla: Prevent deadlock and crash due to autoservicing.
authorNaveen Albert <asterisk@phreaknet.org>
Sat, 24 Sep 2022 10:15:09 +0000 (10:15 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 28 Nov 2022 17:19:19 +0000 (11:19 -0600)
commit79562cf1a5b5b5580a07f7fc1be122b3bf6cf8ea
treefb951172c641f44c8dadd199f26300d10549e947
parent2cfb3df35df7930541177eb32d71afa52cd38899
sla: Prevent deadlock and crash due to autoservicing.

SLAStation currently autoservices the station channel before
creating a thread to actually dial the trunk. This leads
to duplicate servicing of the channel which causes assertions,
deadlocks, crashes, and moreover not the correct behavior.

Removing the autoservice prevents the crash, but if the station
hangs up before the trunk answers, the call hangs since the hangup
was never serviced on the channel.

This is fixed by not autoservicing the channel, but instead
servicing it in the thread dialing the trunk, since it is doing
so synchronously to begin with. Instead of sleeping for 100ms
in a loop, we simply use the channel for timing, and abort
if it disappears.

The same issue also occurs with SLATrunk when a call is answered,
because ast_answer invokes ast_waitfor_nandfds. Thus, we use
ast_raw_answer instead which does not cause any conflict and allows
the call to be answered normally without thread blocking issues.

ASTERISK-29998 #close

Change-Id: Icc237d50354b5910000d2305901e86d2c87bb9d8
apps/app_meetme.c