anchor.diff:  	    throw({sipparseerror, Type, Header, 400, "Missing or invalid " ++ Name ++ ": header"})
       end.
   
  +%% part of sanity_check_contact/4
   sanity_check_uri(Type, Desc, URI, Header)  when is_record(URI, sipurl), URI#sipurl.host == none ->
       throw({sipparseerror, Type, Header, 400, "No host part in " ++ Desc ++ " URL"});
   sanity_check_uri(_Type, _Desc, URI, _Header) when is_record(URI, sipurl) ->
       ok.
   
  -check_supported_uri_scheme({unparseable, URIstr}, Header) ->
  +%%--------------------------------------------------------------------
  +%% Function: check_supported_uri_scheme(URI, Header)
  +%%           URI    = sipurl record() | {unparseable, URIstr}
  +%%           Header = keylist record()
  +%% Descrip.: Check if we supported the URI scheme of a request. If
  +%%           we didn't support the URI scheme, sipurl:parse(...) will
  +%%           have failed, and we just format the 416 error response.
  +%% Returns : true | throw({sipparseerror, ...})
  +%%--------------------------------------------------------------------
  +check_supported_uri_scheme({unparseable, URIstr}, Header) when is_record(Header, keylist) ->
       case string:chr(URIstr, $:) of
   	0 ->
   	    throw({sipparseerror, request, Header, 416, "Unsupported URI Scheme"});
  
positive.code: %% Returns : true  |
  %%           throw(), {sipparseerror, request, Header, Status, Reason}
  %%--------------------------------------------------------------------
  check_for_loop(Header, URI, Origin) when record(Origin, siporigin) ->
      LoopCookie = siprequest:get_loop_cookie(Header, URI, Origin#siporigin.proto),
      ViaHostname = siprequest:myhostname(),
      ViaPort = sipserver:get_listenport(Origin#siporigin.proto),
  
negative.code: %% Descrip.: Look at the first Route header element in Header (if any)
  %%           and see if it matches this proxy. If so, remove the first
  %%           element and return a new Header.
  %% Returns : NewHeader = keylist record()
  %%--------------------------------------------------------------------
  remove_route_matching_me(Header) ->
      case keylist:fetch('route', Header) of
          [FirstRoute | RouteRest] ->
  	    [FirstRouteParsed] = contact:parse([FirstRoute]),
  	    case route_matches_me(FirstRouteParsed) of
  		true ->
  		    logger:log(debug, "Sipserver: First Route ~p matches me, removing it.",
  			       [FirstRoute]),
  		    case RouteRest of
  			[] ->
  			    keylist:delete('route', Header);
  			_ ->
  			    keylist:set("Route", RouteRest, Header)
  		    end;
  		false ->
  		    Header
  	    end;
  	_ ->
  	    %% No Route header
  	    Header
      end.
  
  %%--------------------------------------------------------------------
  %% Function: route_matches_me(Route)
  %%           Route = contact record()
  %% Descrip.: Helper function for remove_route_matching_me/1. Check if
  %%           an URL matches this proxys name (or address) and port.
  %% Returns : true  |
  %%           false
  %%--------------------------------------------------------------------
  route_matches_me(Route) when is_record(Route, contact) ->
      URL = sipurl:parse(Route#contact.urlstr),
      MyPorts = sipserver:get_all_listenports(),
      Port = siprequest:default_port(URL#sipurl.proto, sipurl:get_port(URL)),
      PortMatches = lists:member(Port, MyPorts),
      HostnameList = lists:append(get_env(myhostnames, []), siphost:myip_list()),
      HostnameMatches = util:casegrep(URL#sipurl.host, HostnameList),
      if
  	HostnameMatches /= true -> false;
  	PortMatches /= true -> false;
  