Merge "chan_dahdi: set CHANNEL(hangupsource) when a PRI channel hangs up"

pull/15/head
Friendly Automation 6 years ago committed by Gerrit Code Review
commit bf63dcab6c

@ -1391,14 +1391,25 @@ 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) static void sig_pri_queue_hangup(struct sig_pri_span *pri, int chanpos)
{ {
struct ast_channel *owner;
if (sig_pri_callbacks.queue_control) { if (sig_pri_callbacks.queue_control) {
sig_pri_callbacks.queue_control(pri->pvts[chanpos]->chan_pvt, AST_CONTROL_HANGUP); sig_pri_callbacks.queue_control(pri->pvts[chanpos]->chan_pvt, AST_CONTROL_HANGUP);
} }
sig_pri_lock_owner(pri, chanpos); sig_pri_lock_owner(pri, chanpos);
if (pri->pvts[chanpos]->owner) { owner = pri->pvts[chanpos]->owner;
ast_queue_hangup(pri->pvts[chanpos]->owner); if (owner) {
ast_channel_unlock(pri->pvts[chanpos]->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);
} }
} }

Loading…
Cancel
Save