On Tuesday 19 February 2008, Phil D'Amore wrote:
It looks like you may have settled on a solution
already but I'd like
to add that carrierroute will do what you are looking for as well with
a little work, as I do exactly this already. I have some customers
that are only allowed to call certain prefixes (more specific than
entire countries, but same principle).
What you do is create a route tree for every unique situation you
have, and then add the allowed routes to each tree. For your example
it would look something like this (requires openser 1.3):
route_tree table:
[...]
# HEre's a cheap way to do a blackhole route using this stuff.
# You create a carrierroute entry and instead of a gateway host in the
rewrite_host
# column, just us ethe string "blackhole". Then you can do something like
this: if($rd == "blackhole") {
acc_db_request("403 Blackhole route", "acc");
sl_send_reply("403", "Forbidden");
}
Hi Phil,
just to give a little bit more informations, the solution you use if of course
also valid.. If you want to blacklist some prefixes on a global level then
you could also use something like this approaches:
1.
- use a sufficient long strip value
- add a prefix, e.g. "blacklist"
- set rewrite_host to some asterisk box
This way the the resulting URI will transformed like this:
4912(a)proxy.domain -> blacklist(a)asterisk.domain
The call will be routed to a asterisk box, where you could play some user
information matching to the prefix.
2.
- use a empty rewrite_host string
This way the resulting URI will be invalid, and not routed.
Cheers,
Henning