anchor.diff:  	    end
       end.
   
  +get_flag_value(Key, #phone{flags = Flags}) ->
  +    case lists:keysearch(Key, 1, Flags) of
  +	{value, {Key, PriorityV}} ->
  +	    PriorityV;
  +	false ->
  +	    undefined
  +    end.
  +
   
   %%====================================================================
   %% Test functions
  
positive.code: %%           authenticated in register_authenticate(...).
  %% Returns :
  %%--------------------------------------------------------------------
  register_require_supported(Request, LogStr, THandler, LogTag, AppName) ->
      Header = Request#request.header,
      %% RFC 3261 chapter 10.3 - Processing REGISTER Request - step 2
      case is_valid_register_request(Header) of
  	true ->
  	    register_authenticate(Request, LogStr, THandler, LogTag, AppName);
  	{siperror, Status, Reason, ExtraHeaders} ->
  	    transactionlayer:send_response_handler(THandler, Status, Reason, ExtraHeaders)
      end.
  
  %% part of process_register/6
  register_authenticate(Request, LogStr, THandler, LogTag, AppName) ->
      Header = Request#request.header,
      logger:log(debug, "~p: ~s -> processing", [AppName, LogStr]),
      %% delete any present Record-Route header (RFC3261, #10.3)
      NewHeader = keylist:delete("Record-Route", Header),
      {_, ToURL} = sipheader:to(Header),
      %% RFC 3261 chapter 10.3 - Processing REGISTER Request - step 3, step 4 and step 5
      %% authenticate UAC
      case local:can_register(NewHeader, ToURL) of
  
negative.code: %% determine expiration time for a specific contact. Use default
  %% value if contact/header supplies no expiration period.
  %% Returns : integer(), time in seconds
  get_register_expire(Expire) ->
      case Expire of
  	none ->
  	    %% no expire - use default
  	    3600;
  	Expire when is_integer(Expire) ->
  	    %% expire value supplied by request - we can choose to accept,
  	    %% change (shorten/increase expire period) or reject too short expire
  	    %% times with a 423 (Interval Too Brief) error.
  	    %% Currently implementation only limits the max expire period
  	    {ok, MaxRegisterTime} = yxa_config:get_env(max_register_time),
  
  	    lists:min([MaxRegisterTime, Expire])
      end.
  
  
  