[OpenSIPS-Users] maxmum of register AOR

jing 605507247 at qq.com
Wed Jul 2 12:14:17 CEST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140702/13b309a2/attachment.htm>


More information about the Users mailing list