anchor.diff:  locations_to_contacts([]) ->
       [];
   locations_to_contacts([{Location, Flags, Class, Expire} | Rest]) ->
  -    lists:append([print_contact(Location, Expire)], locations_to_contacts(Rest)).
  +    lists:append(print_contact(Location, Expire), locations_to_contacts(Rest)).
   
   print_contact(Location, Expire) ->
  -    % make sure we don't end up with a negative Expires
  -    NewExpire = lists:max([0, Expire - util:timestamp()]),
       [C] = sipheader:contact_print([{none, Location}]),
  -    C ++ ";expires=" ++ integer_to_list(NewExpire).
  +    case Expire of
  +	never ->
  +	    logger:log(debug, "Not adding permanent contact ~p to REGISTER response", [C]),
  +	    [];
  +	_ ->
  +	    % make sure we don't end up with a negative Expires
  +	    NewExpire = lists:max([0, Expire - util:timestamp()]),
  +	    [C ++ ";expires=" ++ integer_to_list(NewExpire)]
  +    end.
   
   process_register_wildcard_isauth(Header, Socket, Phone, Auxphones, Contacts) ->
       case is_valid_wildcard_request(Header, Contacts) of
  
positive.code:         [{_, NewDest} | NewRoute1] ->
  	    case route_matches_me({none, NewDest}) of
  		true ->
  		    logger:log(debug, "First Route ~p matches me, removing it.", sipheader:contact_print([{none, NewDest}])),
  		    case NewRoute1 of
  			[] ->
  			    rewrite_route(keylist:delete("Route", Header), URI);
  
negative.code:     end.
  
  route_matches_me(Route) ->
      {_, {_, _, Host, RoutePort, _}} = Route,
      Port = default_port(RoutePort),
      HostnameList = lists:append(sipserver:get_env(myhostnames, []), [siphost:myip()]),
      HostnameIsMyHostname = util:casegrep(Host, HostnameList),
      MyPort = default_port(sipserver:get_env(listenport, none)),
      if
  	Port /= MyPort -> false;
  	HostnameIsMyHostname /= true -> false;
  	true ->	true
      end.	   
  
  