[Kamailio-Users] Check if a user is calling from a registereddevice and if not, deny the call!

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 20 11:43:23 CEST 2008


Hello,

On 10/19/08 12:43, Juha Heinanen wrote:
> 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.
>   
there is a module parameter that can be used to indicate from where to 
take the AoR:
http://www.kamailio.org/docs/modules/1.4.x/registrar.html#id2467728

However, it is hidden and a bit dangerous as it is used for all 
save/lookup/registerd/ ... functions, so one has to play carefully with 
it. I plan to bring it to light by introducing a new function parameter 
for that purpose. I believe is is more consistent and safer.

Cheers,
Daniel

>  > 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
>
>   

-- 
Daniel-Constantin Mierla
http://www.asipto.com





More information about the Users mailing list