Can't hangup an existing channel - Asterisk 16,27.0

Hi list,
I have a zombie channel

Channel Context Extension Prio State Application Data CallerID Duration Accountcode PeerAccount BridgeID
Message/ast_msg_queu DialCHANNEL s 7 Up Dial PJSIP/0033xxxxxxxxx@10174 0033yyyyyyyyy 248:13:5 Customer2

and can’t find any way to hang it up. Any clue ?

The Message channel can’t be hung up, it’s an internal channel used for messaging support and sticks around.

Thanks, but is this normal ?

It is normal for the Message channel to remain.

Is there a way to tell to a channel to hangup after x hours/minutes/seconds being up ?

Not for the one in question. For normal channels, you set TIMEOUT(absolute) from the dialplan currently running on it. I don’t think that will work if it gets lost, as most operations on channels requires someone to have ownership of it and not to have stalled. In particular, if you have a deadlock, the last thing you probably want to do is to remove a channel owned by one of the deadlocked threads, as that can turn deadlock into a segmentation fault.

Setting the timeout is not, I believe, a one off operation,so it doesn’t protect against a dialplan that subsequently extends the timeout.

We set the call timeout whenever we dial a number but have still occasionally had calls that ‘hang’ for a variety of reasons. None of these reasons are typically an Asterisk bug though, but we run the following on an hourly basis to force channels to hangup if they have been active for more than 3 hours:

#!/bin/sh
asterisk -rx "core show channels concise" | grep '\!' | awk -F\! '{print $12" "$1}' | while read duration channel; do
  [ $duration -gt 10800 ] && asterisk -rx "hangup request $channel";
done

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.