<DIV>
<DIV>hi,Bogdan</DIV>
<DIV>Thanks for your reply.</DIV>
<DIV>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. </DIV>
<DIV>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?</DIV>
<DIV>
<DIV>Thanks,</DIV>
<DIV> jing </DIV></DIV></DIV><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From:</b> "Bogdan-Andrei Iancu"<bogdan@opensips.org>; </div><div><b>Date:</b> 2014年7月2日(星期三) 晚上6:48</div><div><b>To:</b> "users"<users@lists.opensips.org>; "jing "<605507247@qq.com>; </div><div><b>Subject:</b> Re: [OpenSIPS-Users] maxmum of register AOR</div></div><div><br></div><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" target=_blank>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" target=_blank>Users@lists.opensips.org</A>
<A class=moz-txt-link-freetext href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target=_blank>http://lists.opensips.org/cgi-bin/mailman/listinfo/users</A>
</PRE></BLOCKQUOTE><BR>