Hello Bogdan,<div><div>I followed your instruction and It works!</div><div>Thanks a lot!!</div><div><br></div><div>This is what I did</div><div>----</div><div><div><div>modparam("auth_db", "load_credentials", "$avp(i:56)=host_ip_address")</div>
<div><br></div><div><br></div><div>if (is_method("REGISTER")||is_method("SUBSCRIBE")) {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!www_authorize("", "extensions")) {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>www_challenge("", "0");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>exit;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>};</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>if ($avp(i:56)!= $si) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>sl_send_reply("401","Unauthorized");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>xlog("EVENT: Unauthorized IP\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>exit;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>save("location");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>xlog("EVENT: Client IP : $avp(i:56)\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>exit;</div><div>};</div></div></div><div>----</div><div><br></div><div>one more thing.... could you please tell me how can I add MemCache support for this config.</div>
<div><br></div><div>I followed this <a href="http://www.opensips.org/Resources/DocsTutMemcache">http://www.opensips.org/Resources/DocsTutMemcache</a></div><div>but I stuck at "modparam("auth_db", "load_credentials", "$avp(i:55)=password")" because I already used "modparam("auth_db", "load_credentials", "$avp(i:56)=host_ip_address")"</div>
<div><br></div><div>Thank you!</div><div><br></div><div>Sujeev</div><div><br><div class="gmail_quote">On Mon, Aug 9, 2010 at 2:46 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Sujeev,<br>
<br>
You to first do standard digest authentication of the user (using the<br>
proxy_auth() function) - to also check the IP, add a new column in<br>
subscriber table (to keep the IP address) and load that column (during<br>
digest auth) using the load_credentials (see<br>
<a href="http://www.opensips.org/html/docs/modules/1.6.x/auth_db.html#id228201)." target="_blank">http://www.opensips.org/html/docs/modules/1.6.x/auth_db.html#id228201).</a>..<br>
<br>
So, once the digent auth was successfully validated, you will have the<br>
provisioned IP loaded into a script variable, so you can easyly check it<br>
against $si (source IP of the message).<br>
<br>
Regards,<br>
Bogdan<br>
<div><div></div><div class="h5"><br>
Sujeev wrote:<br>
> Hi everyone,<br>
> I've a small OpenSIPs setup with 1500 ATAs. those ATAs are on a LAN<br>
> and have a static IP address(Private).<br>
> I want to authenticate those ATAs with a combination of username +<br>
> password + IP of ATA on MySQL or Postgresql database.<br>
><br>
> example;<br>
> ATA 1<br>
> ------<br>
> IP : 10.2.222.4<br>
> Username : 10001<br>
> Password : 10001<br>
><br>
> I added these info into a DB. When ATA 1 uses IP address "10.2.222.4"<br>
> ATA can register with my OpenSIPs server.<br>
> When ATA 1 uses IP address 10.2.222.5 the registration should be failed.<br>
> Is that possible? if yes please tell me how.<br>
><br>
><br>
> Thank you.<br>
><br>
> Sujeev<br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
<div class="im">><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
<br>
<br>
</div><font color="#888888">--<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Bootcamp<br>
20 - 24 September 2010, Frankfurt, Germany<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div></div>