[OpenSIPS-Users] SNMPStats - openserSIPRegCurrentUsers is always incrementing

John Quick john.quick at smartvox.co.uk
Tue Jul 12 12:16:21 CEST 2011


Hi Bogdan,

If I am able to get some useful debug info or a capture file then I will
send them directly to you.
The version of OpenSIPS that has the problem is 1.6.2-notls (x86_64/linux).

Here is output from successive opensipsctl queries after the Aastra phone
has been connected for about 15 hours:
 [root at centos6v ~]# opensipsctl online
 1003
 [root at centos6v ~]# opensipsctl ul show
 Domain:: location table=512 records=1
        AOR:: 1003
                Contact:: sip:1003 at 192.168.0.67:5060;transport=udp Q=
                        Expires:: 2447
                        Callid:: 1ee42fd1d268fc8c
                        Cseq:: 28298
                        User-agent:: Aastra 6731i/2.6.0.1008
                        State:: CS_SYNC
                        Flags:: 0
                        Cflag:: 0
                        Socket:: udp:192.168.0.116:5060
                        Methods:: 7807
 [root at centos6v ~]# opensipsctl fifo get_statistics usrloc:
 usrloc:registered_users = 16
 usrloc:location-users = 16
 usrloc:location-contacts = 1
 usrloc:location-expires = 15

The stats are incrementing by one every hour – each time the Aastra sends
its registration request. Capturing the SIP messages shows there is a single
request (no auth challenge) and a single 200 Ok, as follows (this capture
was from more than 12 hours ago):

REGISTER sip:192.168.0.116:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.0.67:5060;branch=z9hG4bK3c7a1c6b969da43d5.70cc47d1606bd5f0f;rport
Max-Forwards: 70
From: <sip:1003 at suse-sip.com:5060>;tag=2a3ecdecb3
To: <sip:1003 at suse-sip.com:5060>
Call-ID: 1ee42fd1d268fc8c
CSeq: 28285 REGISTER
Allow:  INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK,
SUBSCRIBE, INFO
Allow-Events: talk, hold, conference, LocalModeStatus
Contact: "1003"
<sip:1003 at 192.168.0.67:5060;transport=udp>;+sip.instance="<urn:uuid:00000000
-0000-1000-8000-00085D23700A>"
Supported: gruu, path
User-Agent: Aastra 6731i/2.6.0.1008
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.0.67:5060;branch=z9hG4bK3c7a1c6b969da43d5.70cc47d1606bd5f0f;rport=50
60
From: <sip:1003 at suse-sip.com:5060>;tag=2a3ecdecb3
To: <sip:1003 at suse-sip.com:5060>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.6663
Call-ID: 1ee42fd1d268fc8c
CSeq: 28285 REGISTER
Contact: <sip:1003 at 192.168.0.67:5060;transport=udp>;expires=3600
Server: OpenSIPS (1.6.2-notls (x86_64/linux))
Content-Length: 0

The record in the location table currently looks like this (the time on the
server is not correct - it is ahead of actual time):

id        username  domain  contact
received  path       expires                          
1079  1003              <null>    sip:1003 at 192.168.0.67:5060;transport=udp
<null>       <null>    2011-07-12 16:09:52

q         callid                             cseq     last_modified
flags  cflags  user_agent                          socket
methods
-1.00  1ee42fd1d268fc8c  28298  2011-07-12 15:09:52  0         0
Aastra 6731i/2.6.0.1008  udp:192.168.0.116:5060  7807     

John Quick


From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org] 
Sent: 11 July 2011 18:16
To: john.quick at smartvox.co.uk
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] SNMPStats - openserSIPRegCurrentUsers is
always incrementing

Hi John,

The stats are kept in memory (and calculate based on the data cached by
opensips) so, the DB should not affect at all the stats.

What is the opensips version where this happens ? if the issue is issue to
reproduce, could you get full debug logs for all registrations ?

Regards,
Bogdan

On 07/10/2011 10:59 PM, John Quick wrote: 
Hi Bogdan,
 
Here is another update:
The problem exists when I register an Aastra 6731i phone, but does not when
I register a Snom 360 phone.
As explained before, it does not happen at all on my Ubuntu test server. It
only happens on my CentOS test server. Both are running the same
opensips.cfg file, but they are running different versions of OpenSIPS. Both
are using a locally hosted MySQL database to store user data
(opensips.subscriber) and location data (opensips.location). I can see no
errors in the log files.
 
Do you have any ideas or suggestions for additional tests? For example,
should I reconfigure the CentOS OpenSIPS to use the Ubuntu MySQL server in
case it is a database problem?
 
John Quick
 
 
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org] 
Sent: 08 July 2011 16:32
To: john.quick at smartvox.co.uk
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] SNMPStats - openserSIPRegCurrentUsers is
always incrementing
 
Hi John,

I tried to reproduce this on live system and I do not see this difference:

tester001:~# opensipsctl fifo get_statistics usrloc:
usrloc:registered_users = 53
usrloc:location-users = 53
usrloc:location-contacts = 56
usrloc:location-expires = 84
tester001:~# opensipsctl ul show --brief  | wc -l
54

Also running with DB mode 2.

The counter is decremented when a contact is removed from memory hash.

Regards,
Bogdan

On 06/27/2011 06:00 PM, John Quick wrote: 
Yes.
 
John
 
-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org] 
Sent: 27 June 2011 14:49
To: john.quick at smartvox.co.uk
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] SNMPStats - openserSIPRegCurrentUsers is
always incrementing
 
Hi John,
 
So you are saying that "opensipsctl ul show" shows only 2 records while the
statistic shows more ??
 
Regards,
Bogdan
 
On 06/25/2011 10:37 PM, John Quick wrote:
Bogdan,
 
Here is a snippet showing the significant parts from the script that I 
use for handling REGISTER requests, but I think there is only one line 
that is unusual.
   
modparam("usrloc", "nat_bflag", 6)
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", 1)
modparam("registrar", "default_q", 800) modparam("registrar", 
"received_avp", "$avp(s:rcv)")
 
     sl_send_reply("100", "Trying");
   
     if (client_nat_test("2")) {
   setbflag(6);
   fix_nated_register();
   force_rport();
     }
     if (!aaa_www_authorize("")) {
         www_challenge("","0");
         exit;
     };
     if (!db_check_to()) {
         sl_send_reply("401", "Unauthorized");
         exit;
     };
 
     consume_credentials();
 
     if (!save("location")) {
         log(1, "***--REGISTER: location save failed!\n");
         sl_reply_error();
     }
 
In case the consume_credentials() function was causing the fault, I 
repeated my tests with that line commented out. However, the counter 
is still going up.
 
There is no "ul dump" option in opensipsctl, but there is a "ul show"
function. It shows the correct information:
[root at centos6v log]# opensipsctl fifo get_statistics usrloc:
usrloc:registered_users = 3
usrloc:aliases-users = 0
usrloc:aliases-contacts = 0
usrloc:aliases-expires = 0
usrloc:location-users = 3
usrloc:location-contacts = 2
usrloc:location-expires = 1
 
[root at centos6v log]# opensipsctl ul show
Domain:: location table=512 records=2
         AOR:: 1002 at suse-sip.com
                 Contact:: sip:1002 at 192.168.0.60:6050 Q=1
                         Expires:: 3551
                         Callid:: 3c2670ace4cd-m9fekwu548ay
                         Cseq:: 6
                         User-agent:: snom360/7.3.30
                         State:: CS_SYNC
                         Flags:: 0
                         Cflag:: 0
                         Socket:: udp:192.168.0.116:5060
                         Methods:: 7999
         AOR:: 1003 at suse-sip.com
                 Contact:: sip:1003 at 192.168.0.67:5060;transport=udp Q=0.8
                         Expires:: 3288
                         Callid:: b939e48a7188d2cf
                         Cseq:: 4400
                         User-agent:: Aastra 6731i/2.6.0.1008
                         State:: CS_SYNC
                         Flags:: 0
                         Cflag:: 0
                         Socket:: udp:192.168.0.116:5060
                         Methods:: 7807
Domain:: aliases table=512 records=0
 
John
 
-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at opensips.org]
Sent: 25 June 2011 12:51
To: users at lists.opensips.org; John Quick
Subject: Re: [OpenSIPS-Users] SNMPStats - openserSIPRegCurrentUsers is 
always incrementing
 
Hi John,
 
As the statistic is know to work well, I suspect something strange 
with your setup (like re-registrations are actually new registers). 
So, in the same time, please check the content of user location via:
          opensipsctl ul dump
 
Just to see the actual records.
 
Regards,
Bogdan
 
On 06/24/2011 06:15 PM, John Quick wrote:
Hi Bogdan
Yes, I can confirm that registered_users shows the same value through 
the fifo get_statistics request and the SNMP MIB value. The statistic 
that appears to show the correct number of registered users is 
usrloc:location-contacts
 
Here is the complete list of usrloc statistics on my test server 
today
- only one UA is registered at the moment:
# opensipsctl fifo get_statistics usrloc:
usrloc:registered_users = 14
usrloc:aliases-users = 0
usrloc:aliases-contacts = 0
usrloc:aliases-expires = 0
usrloc:location-users = 14
usrloc:location-contacts = 1
usrloc:location-expires = 13
 
Sorry I cannot maintain the thread on this reply - I am only 
receiving digests from this forum and have forgotten my login details 
so cannot change it.
 
John Quick
 
Message: 2
Date: Fri, 24 Jun 2011 16:47:12 +0300
From: Bogdan-Andrei Iancu<bogdan at opensips.org>
Subject: Re: [OpenSIPS-Users] SNMPStats - openserSIPRegCurrentUsers is
     always incrementing
To: users at lists.opensips.org
Message-ID:<4E049560.5020706 at opensips.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
Hi John,
 
That stat is related to the internal statistic "registered_users"
provided by the usrloc module. Can you confirm that "opensipsctl fifo 
get_statistics registered_users" gives thesame value as via SNMP ?
 
Regards,
Bogdan
 
 
On 06/23/2011 12:49 PM, John Quick wrote:
Using SNMPStats with version 1.6.2 of OpenSIPS, the value reported 
for openserSIPRegCurrentUsers does not indicate the number of UA's 
currently registered. It shows a value that is always increasing 
over
time.
I am testing with 3 registered devices. There are three records in 
the location table. However, openserSIPRegCurrentUsers now has a 
value of
12 and it increments by 1 approximately every 20 minutes. I would 
guess it is showing the cumulative total number of registrations, 
not the current number of registered users.
 



-- 
Bogdan-Andrei Iancu
OpenSIPS solutions and "know-how"



-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"





More information about the Users mailing list