anchor.diff:  	 lookup_address_to_users/1,
   	 lookupdefault/1,
   	 lookuppotn/1,
  +	 lookupnumber/1,
   	 lookupenum/1,
   	 lookuppstn/1,
   	 isours/1,
  
positive.code: 	    case DefaultRoute of
  		none ->
  		    logger:log(debug, "Lookup: No default route - dropping request"),
  		    {response, 500, "Can't route request"};	% XXX rtt error-code?
  		Hostname ->
  		    {Host, Port} = sipurl:parse_hostport(Hostname),
  		    NewURI = {User, none, Host, Port, []},
  		    logger:log(debug, "Lookup: Default-routing to ~s", [sipurl:print(NewURI)]),
  		    % XXX we should preserve the Request-URI by proxying this as a loose router.
  		    % It is almost useless to only preserve the User-info IMO. We can do this
  		    % by returning {forward, Host, Port} instead.
  		    {proxy, NewURI}
  	    end
      end.
  
  lookuppotn("+" ++ E164) ->
      Loc1 = case util:isnumeric(E164) of
  	true ->
  	    Res1 = lookupenum("+" ++ E164),
      	    logger:log(debug, "Lookup: ENUM lookup on ~s -> ~p", ["+" ++ E164, Res1]),
  	    case Res1 of
  	    	none ->
      		    Res2 = lookuppstn("+" ++ E164),
      		    logger:log(debug, "Lookup: PSTN lookup on ~s -> ~p", ["+" ++ E164, Res2]),
  	    	    Res2;
      		Res1 ->
  		    Res1
  	    end;
  	_ ->
  	    none
      end;
  lookuppotn(Number) ->
      Res = rewrite_potn_to_e164(Number),
      case Res of
          none ->
              none;
          "+" ++ E164 ->
  	    lookuppotn("+" ++ E164);
  	_ ->
  	    none
      end.	    
  
  
  lookupenum("+" ++ E164) ->
      case dnsutil:enumlookup("+" ++ E164) of
  	none ->
  
negative.code: 	URL ->
  	    {E164User, _, E164Host, _, _} = sipurl:parse(URL),
  	    IsMe = homedomain(E164Host),
  	    %% Try to rewrite the userpart of the returned URL into a E164 number
  	    %% to make sure it is not a loop back to this proxy. If it is a remote
  	    %% domain, the username comparison test does not have any effect, so
  	    %% a remote URL with the E164 number as uesrname is OK.
  	    NewE164 = rewrite_potn_to_e164(E164User),
  	    SameE164 = util:casecompare(NewE164, "+" ++ E164),
  	    if
  		IsMe /= true ->
  		    logger:log(debug, "Lookup: ENUM lookup resulted in remote URL ~p, relaying", [URL]),
  		    {relay, sipurl:parse(URL)};
  		NewE164 == error ->
  		    logger:log(debug, "Lookup: ENUM lookup resulted in a homedomain but not E.164 URL ~p, proxying", [URL]),
  		    {proxy, sipurl:parse(URL)};
  		SameE164 == true ->
  		    logger:log(debug, "Lookup: ENUM lookup resulted in a homedomain (~p) and the same E.164 number (~p == ~p), avoiding loop",
  			       [E164Host, E164User, "+" ++ E164]),
  		    none;
  		true ->
  		    logger:log(debug, "Lookup: ENUM lookup resulted in homedomain E.164 URL ~p, proxying", [URL]),
  