Dead channels

How can I handle dead SIP channels?
Sometimes I have SIP channels with long duration but ‘sip show channelstats’ shows that they don’t send/receive packets.
The channel status is UP.
I have set up in sip.conf

rtptimeout=60 rtpholdtimeout=300

But anyways I have zero-transfer channels.
Is there a way to handle it?

Do you have a valid timing source (e.g. real dahdi channel or dahdi_dummy) and internal timing enabled?

Thanks for reply
I don’t use dahdi channels so I didn’t setup any dahdi settings.
I also have ;internal_timing=yes but it’s commented. Don’t know it’s default value.
Will it help to uncoment it without dahdi setup on SIP channels?

If this is a timing issues, you will need to build and install dahdi_dummy and turn on internal timing. dahdi_dummy is part of the main dahdi package.

The normal symptom is things like tones, music on hold, and voice announcements stall or stutter.

I have installed and configured dahdi
When I started dahdi I got

Loading DAHDI hardware modules: dahdi_dummy: done /usr/share/dahdi/waitfor_xpds: Missing astribank_is_starting No hardware timing source found in /proc/dahdi, loading dahdi_dummy Running dahdi_cfg: done.
Looks like ok.
Should I perform any other dahdi configuration or i can just to setup internal_timing=yes and restart asterisk?

No dahdi configuration needed.

Thank you very much!

I have setup timing but nothing changed. I still have many calls with zero packets.
Maybe I didn’t setup something?

You are going to need to provide details and protocol traces.

What details should I provide?
I can post settings, but I’m afraid sip debug would be a problem: I have ~ 50 concurrent calls and it’s difficult to track the debug.

sip history on the “dead” channels will give some information, but needs to be enabled before they go dead.

Are you sure these are real channels, as sip show channels also shows registrations, etc.?

Yes, sure. They look like ‘alive’. The status is ‘up’.
I have wrote a script parsing ‘sip show channelstats’, invoking ‘zero’ received packets and sending ‘channel request hangup’.
The problem looks like solved, but the way is not clear.
I’ll check how to turn on the history and will post it.

Hello again
I have discovered sip packets exchange and here what i got:

When I detect that the channel is dead (I’m checking with ‘sip show channelstats’ parsing Recv: Pack) i send BYE packet to UAC.
And I receive “200 OK” back. Does it mean, that the caller side still have this call? Or it sends OK even if this call doesn’t exist?

If you get OK to BYE, the other side has either cleared in response to the BYE or it cleared sufficiently recently that it still has a memory of the session.

Incidentally, you cannot send a BYE to a UAC. The UAC/UAS roles can switch during a session. I think you meant you send a BYE to the UA that sent the original INVITE.

Thank you for reply.
Yes, sure I meant UA, u r right.

I also noticed that often BYE comes from UA, so it look like absolutely clear.

So can I trust ‘channelstats’ information then? I still don’t understand the nature of calls with all zero values.
I don’t use reinvite, so UA can send media only through my server.