mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-28 23:15:59 +00:00
Fix deadlock between bridged channels that attempt to set the hangup source
Calling ast_set_hangupsource with the channel lock held can result in a deadlock because the function also locks the bridged channel. (issue AST-891) git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/1.8.11@369848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3607,7 +3607,18 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
|
||||
f = &p->subs[idx].f;
|
||||
return f;
|
||||
}
|
||||
|
||||
f = __analog_handle_event(p, ast);
|
||||
if (!f) {
|
||||
const char *name = ast_strdupa(ast->name);
|
||||
|
||||
/* Tell the CDR this DAHDI device hung up */
|
||||
analog_unlock_private(p);
|
||||
ast_channel_unlock(ast);
|
||||
ast_set_hangupsource(ast, name, 0);
|
||||
ast_channel_lock(ast);
|
||||
analog_lock_private(p);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user