How To Detect Hung Channels

Is there a way to efficiently monitor Asterisk for hung channels? In addition, is it possible to receive an e-mail notification immediately after a channel enters the hung state?

We currently monitor for hung channels by querying for the list of active channels and sending a report every 2 hours. The reports for the day are manually compared for differences. If the same channel appears on the Active channel Report multiple times with the same status, we consider the channel hung. This process is very inefficient as it relies on a human to compare the reports and hung channels are often missed.

Below is the last report we received when a channel was hung. It does not say on which application is hanging the channel, but is usually hangs with a, “BYE” message. We are running Asterisk with Aastra 6757 SIP phones.

Peer User/ANR Call ID Format Hold Last Message Expiry Peer 204 605120d506d95b5 0x0 (nothing) No Rx: BYE 204

1 active SIP dialog