]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_iax2: Prevent deadlock between hangup and sending lagrq/ping 21/621/1
authorYousf Ateya <y.ateya@starkbits.com>
Mon, 20 Apr 2015 21:00:00 +0000 (23:00 +0200)
committerMark Michelson <mmichelson@digium.com>
Wed, 10 Jun 2015 17:05:43 +0000 (12:05 -0500)
commitcf98c744d5bb7e5f015f201bc79c58462f7aaaed
tree96a82705c877837fbb8381fb759d0f34ef24e981
parentd55d17027c24b611efa33376b5d9f0721aa69eb9
chan_iax2: Prevent deadlock between hangup and sending lagrq/ping

channels/chan_iax.c: Prevent the deadlock between iax2_hangup and send_lagrq/
send_ping. This deadlock happens because the scheduled task send_lagrq(or
send_ping) starts execution after the call hangup procedure starts but before
it deletes the tasks in the scheduler.

The solution is to delete scheduled lagrq (and ping) task asynchronously
(i.e. schedule AST_SCHED_DEL for these tasks); By this, AST_SCHED_DEL will
be called in a new context (doesn't have callno locked).

This commit also cleans up the procedure of sending LAGRQ and PING.

main/sched.c: Do not assert when deleting non existant entry from scheduler.
This assert seems to be the reason for a lot of awkward code to avoid it.

ASTERISK-24983 #close
Reported by: Y Ateya

Change-Id: I03bec1fc8faacb89630269e935fa667c6d6c080c
channels/chan_iax2.c
main/sched.c