[asterisk-bugs] [Asterisk 0013668]: sip show inuse count is negative

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Oct 22 17:24:21 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13668 
====================================================================== 
Reported By:                mjc
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13668
Category:                   Channels/chan_sip/General
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-10 15:02 CDT
Last Modified:              2008-10-22 17:24 CDT
====================================================================== 
Summary:                    sip show inuse count is negative
Description: 
I have a bunch of snom 360s and asterisk-1.6.0-rc6. The snom BLF LEDs
monitor hints. However, the hints are getting confused and inverting state
sometimes. That is, unused extensions are being shown as in-use, and
vice-versa.

If I run "sip show inuse" during these times, I see entries like this:

steerpike*CLI> sip show inuse
* User name               In use          Limit
mjc_server                0               10
mjc_library               0               10
mjc_lab                   0               10
mjc_office                0               10
mjc_home                  0               10
* Peer name               In use          Limit
mjc_server                0/0/0           10
mjc_library               0/0/0           10
mjc_lab                   -1/0/0          10
mjc_office                0/0/0           10
mjc_home                  0/0/0           10

Note the "-1"! This is nonsense, and results in an "in use" hint:

steerpike*CLI> core show hints
                    601 at internal            : SIP/mjc_office&SIP/m 
State:InUse           Watchers 11

where the defined hint is:

exten =>
601,hint,SIP/mjc_office&SIP/mjc_home&SIP/mjc_lab&SIP/mjc_server&SIP/mjc_library


Somehow, the call count is being decremented by 2 after a hangup (from 1
to -1). Call counts should be clamped at zero, I would suggest.

This problem did not occur on the same system when we had 1.2.x and 1.4.x
running.

- Mike
====================================================================== 

---------------------------------------------------------------------- 
 (0094178) crjw (reporter) - 2008-10-22 17:24
 http://bugs.digium.com/view.php?id=13668#c94178 
---------------------------------------------------------------------- 
I am using 1.6.0-rc6 on Solaris.
I have not tried the trunk version which has a new fix for the negative
counters.
But looking at the new code, it looks like the checking for "less than
zero" happens before the critical section.  Methinks this checking should
be part of the critical section.

I can consistently generate an "inuse" count of "-1" using the following
two line dialplan:
exten => 750,1,Dial(SIP/x300,10);
exten => 750,2,Dial(SIP/x300);

Basically we are dialing an extenstion... timing out after 10 seconds and
then dialing the same extension again.  To make the counters go negative,
the call must be answered sometime after 10 seconds.  If the call is never
answered or it is answered during the first 10 seconds the probelem won't
occur.

### BEFORE THE CALL IS PLACED - Counters all show zero
thrip*CLI> sip show inuse
* User name               In use          Limit
x000                      0               999
x300                      0               999
* Peer name               In use          Limit
x000                      0/0/0           999
x300                      0/0/0           999

### RINGING STATE - 1ST DIAL COMMAND - Counters are correct
thrip*CLI> sip show inuse
* User name               In use          Limit
x000                      0               999
x300                      0               999
* Peer name               In use          Limit
x000                      1/0/0           999
x300                      1/1/0           999


### RINGING STATE - 2nd DIAL COMMAND - Inuse counter for x300 0; it should
be 1.
* User name               In use          Limit
x000                      0               999
x300                      0               999
* Peer name               In use          Limit
x000                      1/0/0           999
x300                      0/1/0           999

### AFTER THE CALL IS ANSWERED - Inuse counter for x300 is 0; it should be
1.
thrip*CLI> sip show  inuse
* User name               In use          Limit
x000                      0               999
x300                      0               999
* Peer name               In use          Limit
x000                      1/0/0           999
x300                      0/0/0           999


### AFTER THE CALL HAS ENDED - Inuse counter for x300 is -1; it should be
0.
* User name               In use          Limit
x000                      0               999
x300                      0               999
* Peer name               In use          Limit
x000                      0/0/0           999
x300                      -1/0/0          999

Note: placing a wait of 0.1 seconds between the two Dial commands usually
makes the problem go away.
e.g.
exten => 750,1,Dial(SIP/x300,10);
exten => 750,2,Wait(.1);
exten => 750,3,Dial(SIP/x300); 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-22 17:24 crjw           Note Added: 0094178                          
======================================================================




More information about the asterisk-bugs mailing list