mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
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
This commit is contained in:
12
main/sched.c
12
main/sched.c
@@ -513,16 +513,8 @@ int _ast_sched_del(struct ast_sched_context *con, int id, const char *file, int
|
||||
|
||||
if (!s && *last_id != id) {
|
||||
ast_debug(1, "Attempted to delete nonexistent schedule entry %d!\n", id);
|
||||
#ifndef AST_DEVMODE
|
||||
ast_assert(s != NULL);
|
||||
#else
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
snprintf(buf, sizeof(buf), "s != NULL, id=%d", id);
|
||||
_ast_assert(0, buf, file, line, function);
|
||||
}
|
||||
#endif
|
||||
/* Removing nonexistent schedule entry shouldn't trigger assert (it was enabled in DEV_MODE);
|
||||
* because in many places entries is deleted without having valid id. */
|
||||
*last_id = id;
|
||||
return -1;
|
||||
} else if (!s) {
|
||||
|
Reference in New Issue
Block a user