On 02-07 16:42, Juha Heinanen wrote:
Jan Janak writes:
So, the following example
lookup_domain("$fd", "@from.uri.host");
you didn't answer, can the above be also written as:
lookup_domain("$fd", "$fd");
if not, why?
Yes it can. In this particular case the function will assume that the domain name to be looked up is stored in the AVP $fu.fd. If the AVP identifiers does not contain the flags before the delimiting '.' then 'fu' is assumed. So the function will try to retrieve the domain name from that AVP and if it does not exist (which is likely) then the function returns -1.
Some more examples:
lookup("$fd", "iptel.org") # lookup the iptel.org domain name lookup("$fd", "@to.uri.host") # lookup the hostname part of To header URI
# The following two are equivalent lookup("$fd", "$abcd) # lookup the domain stored in "abcd" AVP lookup("$fd", "$fu.abcd) # lookup the domain stored in "abcd" AVP
Jan.