[Kamailio-Users] Check if a user is calling from aregistered device and if not, deny the call!
arif.zaman
arif.zaman at brotecs.com
Mon Oct 20 11:58:46 CEST 2008
miconda wrote:
>
> 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
>
Yes, i've tested trunk and it works for me!
if(!reg_fetch_contacts("location", "$fu", "caller")) {
sl_send_reply("403", "Please register first");
exit;
}
Thanks,
ARIF
--
View this message in context: http://www.nabble.com/Re%3A-Check-if-a-user-is-calling-from-a-registereddevice-and-if-not%2C-deny-the-call%21-tp20054989p20066406.html
Sent from the OpenSER Users Mailing List mailing list archive at Nabble.com.
More information about the Users
mailing list