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
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);
Thanks, ARIF
-----Original Message----- From: users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] On Behalf Of Juha Heinanen Sent: Sunday, October 19, 2008 3:44 PM To: users@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@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
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@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users