anchor.diff:  -spec request(nksip:request()) ->
       nksip:sipreply().
   
  -request(Request) ->
  +request(Req) ->
       try
  -        process(Request)
  +        {ObProc, Req1} = check_outbound(Req),
  +        process(Req1, ObProc),
  +        #sipmsg{app_id=AppId, to=#uri{scheme=Scheme, user=ToUser, domain=ToDomain}} = Req,
  +        {ok, Regs} = callback_get(AppId, {Scheme, ToUser, ToDomain}),
  +        Contacts1 = [Contact || #reg_contact{contact=Contact} <- Regs],
  +        ObReq = case 
  +            ObProc andalso [true || #reg_contact{index={ob, _, _}} <- Regs] 
  +        of
  +            [_|_] -> [{require, <<"outbound">>}];
  +            _ -> []
  +        end,
  +        {ok, [], <<>>, 
  +            [{contact, Contacts1}, make_date, make_allow, make_supported | ObReq]}
       catch
           throw:Throw -> Throw
       end.
  
positive.code: 
  
  %% @private
  -spec process(nksip:request()) ->
      nksip:sipreply().
  
  process(#sipmsg{
              app_id = AppId, 
              to = #uri{scheme=Scheme, user=ToUser, domain=ToDomain},
              contacts = Contacts
          }=Req) ->
      if
          Scheme==sip; Scheme==sips -> ok;
          true -> throw(unsupported_uri_scheme)
      end,
      AOR = {Scheme, ToUser, ToDomain},
      Expires = case nksip_sipmsg:field(Req, expires) of
          T when is_integer(T) -> T;
          _ -> nksip_config:get(registrar_default_time)
      end,
      case Contacts of
          [] -> ok;
          [#uri{domain=(<<"*">>)}] -> del_all(AppId, AOR, Req);
          _ -> update(Req, AOR, Contacts, Expires)
      end,
      {ok, Regs} = callback_get(AppId, AOR),
      NewContacts = [Contact || #reg_contact{contact=Contact} <- Regs],
      {ok, [], <<>>, [{contact, NewContacts}, make_date, make_allow]}.
  
  
  %% @private
  -spec update(nksip:request(), nksip:aor(), [nksip:uri()], integer()) ->
      ok | no_return().
  
  update(#sipmsg{app_id=AppId}=Req, AOR, Contacts, Default) ->
      Min = nksip_config:get(registrar_min_time),
      Max = nksip_config:get(registrar_max_time),
      Now = nksip_lib:timestamp(),
      Updates = make_updates(Min, Max, Default, Now, Contacts, []),
      {ok, Regs} = callback_get(AppId, AOR),
      OldContacts = [
          RegContact ||
          #reg_contact{expire=Exp} = RegContact <- Regs, Exp > Now],
      case update_iter(Updates, Req, OldContacts) of
          [] -> 
              case callback(AppId, {del, AOR}) of
                  ok -> ok;
                  not_found -> ok;
                  _ -> throw({internal, "Error calling registrar 'del' callback"})
              end;
          NewContacts -> 
              GroupExp0 = lists:max([CExp-Now||#reg_contact{expire=CExp} <- NewContacts]),
              GroupExp1 = max(GroupExp0, 5),
              case callback(AppId, {put, AOR, NewContacts, GroupExp1}) of
                  ok -> ok;
                  _ -> throw({internal, "Error calling registrar 'put' callback"})
              end
  
negative.code:                 _ -> Default
              end
      end,
      Expire = if
          UriExp==0 -> 0;
          UriExp>0, UriExp<3600, UriExp<Min -> throw({interval_too_brief, Min});
          UriExp>Max -> Now+Max;
          true -> Now+UriExp
      end,
      Q = case nksip_lib:get_list(<<"q">>, Opts) of
          [] -> 
  