anchor.diff:  -include("nksip.hrl").
   -include("nksip_call.hrl").
   
  --export([method/1, header_uris/2, header_dates/2, header_integers/2]).
  --export([header_tokens/2]).
  --export([scheme/1, uri2ruri/1, aors/1, uris/1, ruris/1, vias/1, tokens/1, transport/1]).
  --export([integers/1, dates/1]).
  +-export([method/1, scheme/1, uri2ruri/1, aors/1, uris/1, ruris/1, vias/1]).
  +-export([tokens/1, integers/1, dates/1, transport/1]).
   -export([packet/3, raw_sipmsg/1]).
   
   -export_type([msg_class/0]).
  
positive.code:     #sipmsg{} | {error, term()}.
  
  get_sipmsg(Headers, Body, Proto) ->
      case header_uris(<<"From">>, Headers) of
          [#uri{} = From] -> ok;
          _ -> From = throw({400, <<"Invalid From">>})
      end,
      case header_uris(<<"To">>, Headers) of
          [#uri{} = To] -> ok;
          _ -> To = throw({400, <<"Invalid To">>})
      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;
  