Jan Janak writes:
route[DOMAIN]
{
# Check whether the caller is from a local domain.
lookup_domain("$fd", "(a)from.uri.host")ost");
# Check whether the callee is at a local domain
lookup_domain("$td", "(a)ruri.host")ost");
}
The first call will store the did of the domain in $fd.did if it finds a
match. The second call will store the did in $td.did.
jan,
i start to get it, although i'm not familiar with ser's avp naming
system. can each avp name be followed by .something? what does @ sign
mean in front of ruri.host in above? can the same call be written as:
lookup_domain("$td", "$rd") ?
Well, if we adopt SER version then we only have to
update the README. If you
want to implement your own version then you have to write the code *and*
update the README.
if ser's domain module does what i'm after, then it makes sense to adopt
it and update the doc.
Internally, domain module maintains a set of
attributes in shared memory for
each virtual domain. If the script calls lookup_domain and a match is found,
then the function, in addition to storing the did of the domain in an AVP,
also makes all the AVPs for that virtual domain available to the
script.
so if i have in domain_attrs table an attribute "foo" for a domain,
i can get the value of the attribute after the above lookup_domain call
as $td.foo? can the attribute name be an int or only a string?
-- juha