From: George Joseph Date: Wed, 18 Dec 2019 14:30:50 +0000 (-0700) Subject: Revert "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up" X-Git-Tag: 17.1.0-rc2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a76d3103fb4aa420d9cb7af8cfc5b384d30d6658;p=thirdparty%2Fasterisk.git Revert "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up" There are reports that this commit causes deadlocks when issuing a "pri show" CLI command and a channel is in the process of being hung up. Further work is in progress to determine the cause of the deadlock and provide a permanent fix. ASTERISK~28605 #keeping open Reported by: Dirk Wendland This reverts commit c6b17b521231dde9da890d95ee705c93953bab8c. Change-Id: Iddd900c1abdd5074ff39c17cdce855f2f436cef9 --- diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 4c70c6beaa..8dd3207762 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -1391,25 +1391,14 @@ static void pri_queue_control(struct sig_pri_span *pri, int chanpos, int subclas */ static void sig_pri_queue_hangup(struct sig_pri_span *pri, int chanpos) { - struct ast_channel *owner; - if (sig_pri_callbacks.queue_control) { sig_pri_callbacks.queue_control(pri->pvts[chanpos]->chan_pvt, AST_CONTROL_HANGUP); } sig_pri_lock_owner(pri, chanpos); - owner = pri->pvts[chanpos]->owner; - if (owner) { - ao2_ref(owner, +1); - ast_queue_hangup(owner); - ast_channel_unlock(owner); - - /* Tell the CDR this DAHDI channel hung up */ - sig_pri_unlock_private(pri->pvts[chanpos]); - ast_set_hangupsource(owner, ast_channel_name(owner), 0); - sig_pri_lock_private(pri->pvts[chanpos]); - - ao2_ref(owner, -1); + if (pri->pvts[chanpos]->owner) { + ast_queue_hangup(pri->pvts[chanpos]->owner); + ast_channel_unlock(pri->pvts[chanpos]->owner); } }