anchor.diff:  %%====================================================================
   
   %%--------------------------------------------------------------------
  -%% Function: register_contact(LogTag, SipUser, Location, Priority,
  -%%                            ExpireHeader, CallId, CSeq, PathVector)
  -%%           LogTag       = string()
  -%%           SipUser      = string()
  -%%           Location     = contact record()
  -%%           Priority     = integer()
  -%%           ExpireHeader = list() of string(), Expire header from
  -%%                          REGISTER request, or [] if not present
  -%%           CallId       = string(), Call-Id header from REGISTER
  -%%                          request
  -%%           CSeq         = integer(), CSeq number from REGISTER
  -%%                          request
  -%% Descrip.: add or update a Location entry
  +%% Function: register_contact(RegReq, Contact, Expire)
  +%%           RegReq  = reg_request record()
  +%%           Contact = contact record()
  +%%           Expire  = none | integer(), value provided by UA client
  +%% Descrip.: add or update a location database entry
   %% Returns : -
   %%--------------------------------------------------------------------
  -register_contact(LogTag, SipUser, Location, Priority, ExpireHeader, CallId, CSeq, PathVector)
  -  when is_list(SipUser), is_record(Location, contact), is_integer(Priority), is_list(CallId), is_integer(CSeq) ->
  -    Expire = parse_register_expire(ExpireHeader, Location),
  -    logger:log(normal, "~s: REGISTER ~s at ~s (priority ~p, expire in ~p)",
  -	       [LogTag, SipUser, Location#contact.urlstr, Priority, Expire]),
  -    Flags = register_contact_flags(Priority, Location, PathVector),
  +register_contact(RegReq, Contact, ExpireIn) when is_record(RegReq, reg_request), is_record(Contact, contact) ->
  +    #reg_request{logtag		= LogTag,
  +		 sipuser	= SipUser,
  +		 priority	= Priority,
  +		 callid		= CallId,
  +		 cseq		= CSeq,
  +		 path_vector	= PathVector
  +		} = RegReq,
  +
  +    Expire = get_register_expire(ExpireIn),
  +
  +    Flags = register_contact_flags(Priority, Contact, PathVector),
  +
       case lists:keysearch(instance_id, 1, Flags) of
   	{value, {instance_id, Instance_Id}} ->
   	    %% Always generate a GRUU for an instance id if there isn't any yet
  
positive.code: 	_ ->
  	    ok
      end,
      phone:insert_purge_phone(SipUser, Flags, dynamic,
  			     Expire + util:timestamp(),
  			     sipurl:parse(Location#contact.urlstr),
  			     CallId, CSeq).
  
  %%--------------------------------------------------------------------
  
negative.code:     {atomic, ok} = phone:insert_purge_phone(TestUser1, [], static, never,
  					    sipurl:parse("sip:static@example.org"), "", ""),
  
      autotest:mark(?LINE, "process_updates/2 - 20.1"),
      %% verify that the static registration isn't included in REGISTER responses
      PU_Header20 = keylist:set("CSeq", ["2001 REGISTER"], PU_RegReq1#reg_request.header),
      PU_RegReq20 = PU_RegReq1#reg_request{header		= PU_Header20,
  					 do_gruu	= true,
  					 path_ignsup	= true
  					},
      {ok, {200, "OK", [{"Contact",       PU_Contacts20_CRes},
                        {"Date",          _}
                       ]}} = process_updates(PU_RegReq20, []),
  
      autotest:mark(?LINE, "process_updates/2 - 20.2"),
      %% verify the contacts in the response
      ok = test_verify_contacts(15, 20, ["<sip:dynamic@192.0.2.12>"], PU_Contacts20_CRes),
  
      autotest:mark(?LINE, "process_updates/2 - 21"),
      %% test unregistering with wildcard when there are some 'strange' entrys there
      PU_Contacts21 = contact:parse(["*"]),
      PU_Header21 = keylist:set("CSeq", ["2101 REGISTER"], PU_RegReq1#reg_request.header),
      PU_RegReq21 = PU_RegReq1#reg_request{header	= PU_Header21,
  					 do_gruu	= true,
  					 path_ignsup	= true
  					},
      {ok, {200, "OK", [{"Date", _}
  		     ]}} =
  	process_updates(PU_RegReq21, PU_Contacts21),
  
  
  
  