<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
We do this using two different tables and two different kinds of checks
in the SER.cfg<br>
<br>
Keep in mind, this code is all SER 0.9.6 specific. There may be easier
ways to do this in SER 2.0<br>
<br>
For the sake of making things less messy (the idea of storing EVERY
check in one usr_preferences table for ALL functions in SER is an ugly
use of the database), we have a callblock table that stores per-user
blocked numbers via the web interface or a phone keypad entry scheme.
It has the same format as the usr_preferences table:<br>
<br>
<tt>+-----------+--------------+------+-----+-------------------+-------+<br>
| Field | Type | Null | Key | Default | Extra |<br>
+-----------+--------------+------+-----+-------------------+-------+<br>
| uuid | varchar(64) | NO | | | | <br>
| username | varchar(100) | NO | | 0 | | <br>
| domain | varchar(128) | NO | | | | <br>
| attribute | varchar(32) | NO | | | | <br>
| value | varchar(128) | NO | | | | <br>
| type | int(11) | NO | | 0 | | <br>
| modified | timestamp | NO | | CURRENT_TIMESTAMP | | <br>
+-----------+--------------+------+-----+-------------------+-------+<br>
</tt><br>
Into the attribute column goes the attribute 'callblock' and into the
value goes the URI you wish to block. <br>
<br>
Then, in the code, some sort of check like:<br>
<tt>if(avp_db_load("$ruri/username","s:callblock/callblock")<br>
)<br>
{<br>
if(avp_check("s:callblock","eq/$from/gi"))<br>
{<br>
log(1, "CallblkVM\n");<br>
sl_send_reply("603", "Call
denied");<br>
break;<br>
};<br>
};</tt><br>
<br>
<br>
<br>
For blocking ALL numbers instead of a per-user numbering scheme, we
another separate table that looks like usr_preferences; however, an
entry for that table might look like:<br>
<br>
insert into blocked_numbers(username,domain,attribute,value,modified)
values('6667778888','local.domain','block','Blocked',now());<br>
<br>
This stores the number to block as the username instead of as a URI int
he value column. This makes the check in the SER.cfg code a little
easier: <br>
<br>
if(avp_db_load("$to/username", "s:block/blocked_numbers"))<br>
{<br>
sl_send_reply("603", "Number is blocked");<br>
break;<br>
};<br>
<br>
Place that near the top of your invite block and all calls to 666 777
8888 from ANY user will be blocked. <br>
<br>
<br>
N.<br>
<br>
<br>
<br>
Jai Rangi wrote:
<blockquote
cite="mid:eb007ec0707181427u43d1541i651d8edec68c2069@mail.gmail.com"
type="cite">Hello All,<br>
<br>
Does any one know what module can be used to block calls from some
particular phone numbers. I want to store those numbers in the
database. I am looking for these possibilities,<br>
<br>
1. We want to block all the calls from some phone number 666 777 8888
<br>
<br>
2. One of the user agent wants to block the call from some phone number
444 444 4444. <br>
<br>
<br>
Thank you,<br>
-Jai<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Serusers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Serusers@lists.iptel.org">Serusers@lists.iptel.org</a>
<a class="moz-txt-link-freetext" href="http://lists.iptel.org/mailman/listinfo/serusers">http://lists.iptel.org/mailman/listinfo/serusers</a>
</pre>
</blockquote>
<br>
</body>
</html>