[OpenSIPS-Users] maxmum of register AOR

jing 605507247 at qq.com
Thu Jul 3 09:48:44 CEST 2014


hi,Liviu
 Thanks for your reply. 
 But it doesn't work.

 I use $stat(registered_users), and the log shows "unknown script variable".
 kind regards
 jing




------------------ Original ------------------
From: "Liviu Chircu"<liviu at opensips.org>; 
Date: 2014年7月3日(星期四) 下午2:16
To: "users"<users at lists.opensips.org>; 
Subject: Re: [OpenSIPS-Users] maxmum of register AOR



Hello jing,

Accessing a statistic is done with the $stat scripting variable. So, in your case, you need to read the value of $stat(registered_users).

Best regards,
Liviu Chircu OpenSIPS Developer http://www.opensips-solutions.comOn 03.07.2014 05:03, jing wrote:

   hi,Bogdan
 Thanks for your reply.
 I made some test on opensips ,and found there would be some errors when I increase too much load. So I want to  limit the maxmum of register AORs  registered overall and the total Concurrent calls in OpenSIPS ,not per user. 5 is the number I used to test, the real number can be set when use. 
 It's written "registered_users:Total number of AOR existing in the USRLOC memory cache for all domains - can not be resetted." in usrloc module ,so I thought "registered_users" can only be read . Is it wrong to use this exported statistics here?Is there other  parameter can be use in opensips to get the registered number? Or should I write a variable to count the registered number?
  Thanks,
  jing 


 

 

 ------------------ Original ------------------
  From: "Bogdan-Andrei Iancu"<bogdan at opensips.org>; 
 Date: 2014年7月2日(星期三) 晚上6:48
 To: "users"<users at lists.opensips.org>; "jing "<605507247 at qq.com>; 
 Subject: Re: [OpenSIPS-Users] maxmum of register AOR

 

 Hi Jing,

For sure it is NULL/0 as you never write into it, you just read it. Who should update that variable ??

Also I'm not sure what you try to achieve - only 5 users (AORs) registered overall in OpenSIPS ? or only 5 contacts per AOR ?

Regards,
Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.comOn 02.07.2014 13:14, jing wrote:

   hi,all
 I want to limit the maxmum of register AOR (for example 5), and I modified part of the opensips.cfg as fllow: 
  
 if (is_method("REGISTER"))
 {
  if ((registered("location"))||($var(registered_users)<= 5)) {
     # authenticate the REGISTER requests
   if (!www_authorize("", "subscriber"))
   {
    www_challenge("", "0");
    exit;
   }
  
   if (!db_check_to()) 
   {
    sl_send_reply("403","Forbidden auth ID");
    exit;
   }
    if ( proto==TCP ||  0 ) setflag(TCP_PERSISTENT);
    if (!save("location"))
    sl_reply_error();
    exit;
  }else{
   xlog("registerednum is $var(accepted_regs)");
   sl_send_reply("403","Forbidden auth ID");
    exit;
   }
 }

  
 But it doesn't work . 
 The log shows that the value of "$var(registered_users)" is null .
 Is it wrong  to use registered_users there? 
 How to use the export parameter?
 Or can anyone help to tell me how to implement the limition ?
  
  
 Thanks
  jing 


  
_______________________________________________ Users mailing list Users at lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

  
_______________________________________________ Users mailing list Users at lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140703/6e557cbb/attachment-0001.htm>


More information about the Users mailing list