anchor.diff:          cseq = CSeqInt,
           cseq_method = CSeqMethod,
           forwards = Forwards,
  -        routes = header_uris(<<"Route">>, Headers),
  -        contacts = header_uris(<<"Contact">>, Headers),
  +        routes = Routes,
  +        contacts = Contacts,
           headers = Headers1,
           content_type = ContentType,
           body = Body1,
  
positive.code:         "PRACK" -> 'PRACK';
          "UPDATE" -> 'UPDATE';
          _ -> list_to_binary(Method) 
      end.
  
  
  %% @doc Parses all `Name' headers of a request or response and gets a list 
  %% of `nksip:uri()'. If non-valid values are found, `[]' is returned.
  -spec header_uris(binary(), nksip:request()|nksip:response()|[nksip:header()]) -> 
      [nksip:uri()].
  
  header_uris(Name, #sipmsg{headers=Headers}) ->
      header_uris(Name, Headers);
  
  header_uris(Name, Headers) when is_list(Headers) ->
      case uris(nksip_lib:bjoin(header_values(Name, Headers))) of
          error -> [];
          UriList -> UriList
      end.
  
  
  %% @doc Parse all `Name' headers of a request or response and get a list of `integer()'.
  %% If non-valid values are found, `[]' is returned.
  -spec header_integers(binary(), nksip:request()|nksip:response()|[nksip:header()]) -> 
      [integer()].
  
  header_integers(Name, #sipmsg{headers=Headers}) ->
      header_integers(Name, Headers);
  
  header_integers(Name, Headers) when is_list(Headers) ->
      case integers(header_values(Name, Headers)) of
          error -> [];
          Integers -> Integers
      end.
  
  
  %% @doc Parse all `Name' headers of a request or response and get a list of dates. 
  %% If non-valid values are found, `[]' is returned.
  -spec header_dates(binary(), nksip:request()|nksip:response()|[nksip:header()]) -> 
      [calendar:datetime()].
  
  header_dates(Name, #sipmsg{headers=Headers}) ->
      header_dates(Name, Headers);
  
  header_dates(Name, Headers) when is_list(Headers) ->
      case dates(header_values(Name, Headers)) of
          error -> [];
          Dates -> Dates
      end.
  
  
  %% @doc Parse all `Name' headers of a request or response and get a list of tokens.
  %% If non-valid values are found, `[]' is returned.
  -spec header_tokens(binary(), nksip:request()|nksip:response()|[nksip:header()]) -> 
      [nksip_tokenizer:token()].
  
  header_tokens(Name, #sipmsg{headers=Headers}) ->
      header_tokens(Name, Headers);
  
  header_tokens(Name, Headers) when is_list(Headers) ->
      case tokens(header_values(Name, Headers)) of
          error -> [];
          Tokens -> Tokens
      end.
  
  
  
negative.code:         true -> throw({400, <<"Invalid CSeq">>});
          false -> ok
      end,
      case integers(proplists:get_all_values(<<"Max-Forwards">>, Headers)) of
          [] -> Forwards = 70;
          [0] -> Forwards=throw({483, "Too Many Hops"});
          [Forwards] when is_integer(Forwards), Forwards>0, Forwards<300 -> ok;
          _ -> Forwards = throw({400, <<"Invalid Max-Forwards">>})
      end,
      case uris(proplists:get_all_values(<<"Route">>, Headers)) of
          error -> Routes = throw({400, <<"Invalid Route">>});
          Routes -> ok
      end,
      case uris(proplists:get_all_values(<<"Contact">>, Headers)) of
          error -> Contacts = throw({400, <<"Invalid Contact">>});
          Contacts -> ok
      end,
      case tokens(proplists:get_all_values(<<"Content-Type">>, Headers)) of
          error -> ContentType = throw({400, <<"Invalid Content-Type">>});
          ContentType -> ok
      end,
      case header_values(<<"Content-Length">>, Headers) of
          [] when Proto=/=tcp, Proto=/=tls -> 
              ok;
  