anchor.diff:  	    siprequest:send_auth_req(Header, Socket, sipauth:get_challenge(), false)
       end;
   
  -request(Method, {User, Pass, "kth.se", Port, Parameters}, Header, Body, Socket) ->
  +request(Method, URL, Header, Body, Socket) ->
       logger:log(normal, "~s ~s~n",
  -	       [Method, sipurl:print({User, Pass, "kth.se", Port, Parameters})]),
  -    Location = lookupphone(User),
  +	       [Method, sipurl:print(URL)]),
  +    Location = lookupphone(URL),
       logger:log(debug, "Location: ~p", [Location]),
       case Location of
   	none ->
  
positive.code: 	    end
      end.
  
  globalrewrite("0000" ++ Number) ->
      "+" ++ Number;
  globalrewrite("000" ++ Number) ->
      "+46" ++ Number;
  globalrewrite("00" ++ Number) ->
      "+468" ++ Number;
  globalrewrite("0" ++ Number) ->
      none;
  globalrewrite(Number) ->
      "+468790" ++ Number.
  
  lookupdefault(User) ->
      case util:isnumeric(User) of
  	true ->
  	    case dnsutil:enumlookup(globalrewrite(User)) of
  		none ->
  		    {proxy, {User, none, sipserver:get_env(defaultroute), none, []}};
  		URL ->
  
negative.code: 	    none
      end.
  
  homedomain(Domain) ->
      util:casecompare(sipserver:get_env(homedomain), Domain).
  
  lookupphone(URL) ->
      {User, Pass, Host, Port, Parameters} = URL,
      case homedomain(Host) of
  	true ->
  	    Loc1 = lookuproute(User),
  	    Loc2 = case Loc1 of
  		       none ->
  			   lookupmail(User);
  		       Loc1 ->
  			   Loc1
  		   end,
  	    case Loc2 of
  		none ->
  		    lookupdefault(User);
  		Loc2 ->
  		    Loc2
  	    end;
  	_ ->
  	    {redirect, URL}
      end.
  
  request("REGISTER", URL, Header, Body, Socket) ->
  