On Wednesday 04 December 2013 15:27:31 Keith wrote:
Thanks, but I need to restrict based on registered
user, i.e. some users
will be able to dial those numbers others wont.
I'd use a simple route/query for this, the barred attribute in usr_preferences
can contain a full number or prefix.
route[CALLBARRING]
{
if(is_method("INVITE") && $au!=$null)
{
if(avp_db_query("SELECT value FROM usr_preferences WHERE
username='$au' and attribute='barred_prefix' and (value='$rU' or
'$rU' like
concat(value,'%')) ORDER BY value limit 1"))
{
sl_send_reply("403","Call barred");
exit;
}
}
return;
}
--
POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/ -
http://www.sipo.nl/
K.v.K. Eindhoven 17097024