[Kamailio-Users] Check if a user is calling from aregistered device and if not, deny the call!
Daniel-Constantin Mierla
miconda at gmail.com
Mon Oct 20 11:48:16 CEST 2008
Hello,
On 10/19/08 14:32, Arif-Uz-Zaman wrote:
> Hi,
>
> Here is a tricky sample config to check if a user is calling from a
> registered device and if not, deny the call:
>
> $var(temp) = $ruri;
> $ruri = $fu;
> if(!registered("location")) {
> sl_send_reply("403","Forbidden auth ID");
> xlog("<ARIF> Not Found\n");
> exit;
> }
> $ruri = $var(temp);
>
in the trunk (so available with upcoming 1.5.0) you can do more strict
checks. While you are sure an user is registered, you cannot detect if
he is calling from registered device or a different one. You just know
it has a valid contact in location database.
Here is an example to check Contact address in INVITE is same as one in
location table:
http://openser.blogspot.com/2008/10/registrar-enhancements.html
As you get access to all attributes stored for a location record, you
can do many other tests, like source IP and port, etc.
Cheers,
Daniel
> Thanks,
> ARIF
>
> -----Original Message-----
> From: users-bounces at lists.kamailio.org
> [mailto:users-bounces at lists.kamailio.org] On Behalf Of Juha Heinanen
> Sent: Sunday, October 19, 2008 3:44 PM
> To: users at lists.kamailio.org
> Subject: Re: [Kamailio-Users] Check if a user is calling from
> aregistereddevice and if not, deny the call!
>
> Arif-Uz-Zaman writes:
>
> > I've already tested with the following config but no luck. Since the
> > following config check only whether callee is registered or not. Not the
> > caller.
> >
> > if(!registered("location")) {
> > sl_send_reply("403","Forbidden auth ID");
> > exit;
> > }
>
> indeed the function should take a pseudo variable that contains aor used
> for checking.
>
> > Is there any other suggestions?
>
> save r-uri, store caller's aor to r-uri and call the above function.
> then restore r-uri.
>
> -- juha
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>
>
--
Daniel-Constantin Mierla
http://www.asipto.com
More information about the Users
mailing list