[Home]

Summary:ASTERISK-11099: Sip channels lock
Reporter:Alisher (licedey)Labels:
Date Opened:2007-12-21 21:47:58.000-0600Date Closed:2008-01-19 11:09:14.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 1_4_16_2.txt
( 1) deadlock_trunk_94741.txt
( 2) deadlock2_trunk_94741.txt
( 3) locks.txt
( 4) locks2_svn.txt
( 5) messages.txt
Description:When I type "show channels", I can see many locked sip channels, that never hangup. The "soft hangup" command doesn't work.

[macro-TRUNK0]
exten => s,1,NoOp()
exten => s,2,MixMonitor(${CDR(uniqueid)}.wav,v(3)V(3))
exten => s,3,Dial(${ARG1}${ARG2},80,kKftThH)
exten => s,4,Hangup()

exten => h,1,Hangup
Comments:By: Alisher (licedey) 2007-12-21 21:53:03.000-0600

If you check the attached log file, you can see the output of "show channels concise"

Ring!Dial!SIP/02353388201/0634452122|80|kKftThH!3020!!3!489!(None)

Where 80 is dial time out and 439 is the duration time. The duration time is not supposed to be longer than dial time out when the call in Ring state.

So this call is locked.

In the core show locks output, I can see that mixmonitor applications holds many locks. But I think the problem is in the chan_sip.

By: Olle Johansson (oej) 2007-12-22 00:55:39.000-0600

If you think it's a sip bug, you need to try to capture SIP debug output and SIP history on those channels, so we see what happens. Thanks.

By: Alisher (licedey) 2007-12-22 01:16:23.000-0600

- This is a bug, if you look at show channels output you can see, the extension 3021 holds 6 channels.

- There are 16 agents, so max simultaneous should be 16, but there are 33.

- The problem is , when such garbage channels pile up, they take the system resources and rtp bandwidth. So later it becomes impossible to make a stable call. It's possible dial a number but when line is bridged there is no audio.

- These locked channels cannot be cleaned. even with "soft hangup" command.
The only way to return back system is to restart the asterisk.

- So this problem is somehow related to similar bug ASTERISK-10613:



By: Olle Johansson (oej) 2007-12-22 02:14:17.000-0600

I never disagreed with it being a bug, I just said that I need more details if you think the bug is within the SIP channel.

By: Alisher (licedey) 2007-12-24 00:13:14.000-0600

I upgraded to latest SVN trunk and replaced MixMonitor with Monitor. The problem still remained. SIP channels were piled within an hour.

Then I removed the call recording from dial plan. And I got a deadlock. I attached the log file with core show locks, and sip show channels.

When I type sip show history "deadlocked_channel", asterisk says there is no such channel, but I can see it in the "show channels" list.



By: Alisher (licedey) 2007-12-24 00:30:02.000-0600

After 20 minutes deadlocked again. I will try to revert back to asterisk 1.4.16.1 version.



By: Tilghman Lesher (tilghman) 2007-12-24 16:01:34.000-0600

Instead of reverting to a previous version, please try updating to the latest 1.4 SVN.

By: Alisher (licedey) 2007-12-26 02:19:47.000-0600

Both 1.4.16 and 1.4.16.1 caused crashes.

Ok, I will install, the latest SVN version, without Monitor application.



By: Dmitry Andrianov (dimas) 2007-12-26 02:31:13.000-0600

licedey, I guess Corydon asked you to test latest 1.4 branch from SVN not a trunk.
From your notes it looks like you only tested 1.4 releases, not version from SVN.

By: Alisher (licedey) 2007-12-26 02:37:01.000-0600

sorry dimas, I made a mistake. you are right I have installed SVN 94773

By: Raj Jain (rjain) 2007-12-26 09:17:23.000-0600

licedey,

You may want to give SIP session-timers branch a try:
$ svn co http://svn.digium.com/svn/asterisk/team/group/sip_session_timers [^]

Set the following parameters in your sip.conf:
session-timers=originate
session-expires=600

The session-timers feature will clean up your defunct SIP sessions. It will not solve the root of the problem, but can provide you some relief while the root cause is being investigated. You should continue to chase the issue and provide debug logs so a proper fix can be implemented.

For more information on SIP session-timers:
http://bugs.digium.com/view.php?id=10665

By: Alisher (licedey) 2007-12-28 08:22:42.000-0600

rjain, I have installed the latest SVN version and added

session-timers=originate
session-expires=600

options to sip.conf

The production server is working fine for two days, I will run it one week then I will try to add call recording.

I attached locks.txt from another server. It has a deadlock issue too, whenever I try to dial out from Cisco G7912 ip phone with SIP firmaware, which is behind NAT.I can reproduce this deadlock.

If you look at the log, you can see that session-timers feature is not working when channel is deadlocked.

I can reproduce this deadlock.



By: Alisher (licedey) 2008-01-19 11:01:16.000-0600

I cannot reproduce this bug, with the latest svn. We can close this bug.



By: Michiel van Baak (mvanbaak) 2008-01-19 11:09:11.000-0600

Closed on reporters request.
The merge of sip session timers seems to fix this one