<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><tt>Hi Jing,<br>
<br>
For sure it is NULL/0 as you never write into it, you just read
it. Who should update that variable ??<br>
<br>
Also I'm not sure what you try to achieve - only 5 users (AORs)
registered overall in OpenSIPS ? or only 5 contacts per AOR ?<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 02.07.2014 13:14, jing wrote:<br>
</div>
<blockquote cite="mid:tencent_0A5EFE6144195BEC05B71F80@qq.com"
type="cite">
<div>
<div>hi,all</div>
<div>I want to limit the maxmum of register AOR (for example 5),
and I modified part of the opensips.cfg as fllow: </div>
<div> </div>
<div>if (is_method("REGISTER"))<br>
{<br>
if ((registered("location"))||($var(registered_users)<=
5)) {<br>
# authenticate the REGISTER requests<br>
if (!www_authorize("", "subscriber"))<br>
{<br>
www_challenge("", "0");<br>
exit;<br>
}<br>
<br>
if (!db_check_to()) <br>
{<br>
sl_send_reply("403","Forbidden auth ID");<br>
exit;<br>
}</div>
<div> if ( proto==TCP || 0 ) setflag(TCP_PERSISTENT);</div>
<div> if (!save("location"))<br>
sl_reply_error();</div>
<div> exit;<br>
}else{<br>
xlog("registerednum is $var(accepted_regs)");<br>
sl_send_reply("403","Forbidden auth ID");<br>
exit;<br>
}<br>
}<br>
</div>
<div> </div>
<div>But it doesn't work . </div>
<div>The log shows that the value of "$var(registered_users)" is
null .</div>
<div>Is it wrong to use registered_users there? </div>
<div>How to use the export parameter?</div>
<div>Or can anyone help to tell me how to implement the limition
?</div>
<div> </div>
<div> </div>
<div>Thanks</div>
<div> jing </div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>