<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><tt>Hi,<br>
<br>
I would rather suggest (instead of using the permissions module)
to put an extra field into the subscriber table and put the IP
over there. You can load that field during auth process via the
"load_credentials" parameter :<br>
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/auth_db.html#id293578">http://www.opensips.org/html/docs/modules/1.11.x/auth_db.html#id293578</a><br>
<br>
After loading the field into an avp, after successful auth you
can simply do:<br>
if ($si!=$avp(loaded_IP)) {<br>
#reject call<br>
}<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 27.07.2014 15:52, Лытаев Антон Викторович wrote:<br>
</div>
<blockquote cite="mid:53D4F608.4080807@ptcomm.ru" type="cite">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<span id="result_box" class="" lang="en"><span class="hps">For
example:</span> <span class="hps">there are</span> <span
class="hps">50</span> <span class="hps">subscribers</span> <span
class="hps">with</span> <span class="hps">IP =</span> <span
class="hps">telephone number</span> <span class="hps">and IP</span>
<br>
<span class="hps">Necessary to register</span> <span
class="hps">the subscriber on</span> <span class="hps">3</span>
<span class="hps">criteria:</span> <span class="hps">number +</span>
<span class="hps">password</span> <span class="hps">+ IP<br>
<br>
</span></span><span id="result_box" class="short_text" lang="en"><span
class="hps">here's what I</span> <span class="hps">found</span>
<span class="hps">as an example:<br>
</span></span>loadmodule "permissions.so" <br>
loadmodule "group.so" <br>
<br>
if(!check_source_address("0")){ <br>
if (!proxy_authorize("", "subscriber")) { <br>
proxy_challenge("", "0"); <br>
exit; <br>
} <br>
if (!idb_check_from()) { <br>
sl_send_reply("403","Forbidden auth ID"); <br>
exit; <br>
} <br>
consume_credentials(); <br>
} <br>
<div id="gt-src-tools">
<div id="gt-src-tools-l">
<div style="display: inline-block;" id="gt-input-tool">
<div id="itamenu"><span class="ita-kd-inputtools-div"></span></div>
</div>
</div>
</div>
<div id="gt-res-content" class="almost_half_cell">
<div dir="ltr" style="zoom:1">
<div id="tts_button"><object
type="application/x-shockwave-flash"
data="//ssl.gstatic.com/translate/sound_player2.swf"
id="tts" height="18" width="18"></object></div>
<span id="result_box" class="" lang="en"><span class="hps"><br>
I</span> <span class="hps">have to link the</span> "<span
class="hps atn">username" (</span><span>from еable</span>
"<span class="hps">Subscriber")</span> <span class="hps">and
IP</span> <span class="hps">from the table</span> "</span><span
id="result_box" class="" lang="en"><span id="result_box"
class="" lang="en"><span class="hps">address </span></span>"....
<span class="hps">This bundle</span> <span class="hps">comes</span>
<span class="hps">group.so</span> <span class="hps">tools</span>
<span class="hps">module</span> <span class="hps">and</span>
<span class="hps">table table</span> <span class="hps">"grp"?<br>
</span></span><span id="result_box" class="" lang="en"><span
class="hps">and how to add</span> <span class="hps">(for
example)</span> <span class="hps">of the</span> <span
class="hps">user using</span> <span class="hps">opensipsctl</span>
<br>
<span class="hps">add ....?</span></span><br>
Thanks!<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>