anchor.diff:  
   %% return = ok       | wildcard processed
   %%          SipError   db error
  -%% unregister all SipUser entries
  -unregister(LogTag, Header, _SipUser, Locations) ->
  +%% unregister all location entries for a sipuser
  +unregister(LogTag, Header, Locations) ->
       %% unregister all Locations entries
       F = fun() ->
   		unregister_contacts(LogTag, Header, Locations)
  
positive.code: %% REGISTER request had no contact header
  process_updates(_LogTag, _Header, SipUser, []) ->
      %% RFC 3261 chapter 10.3 - Processing REGISTER Request - step 8
      {ok, {200, "OK", [{"Contact", fetch_contacts(SipUser)}]}};
  
  process_updates(LogTag, Header, SipUser, Contacts) ->
      %% Processing REGISTER Request - step 6
  
negative.code: 		    end;
  		{atomic, _ResultOfFun} ->
  		    %% RFC 3261 chapter 10.3 - Processing REGISTER Request - step 8
  		    {ok, create_process_updates_response(SipUser)}
  	    end;
  	ok ->
  	    %% wildcard found and processed
  	    %% RFC 3261 chapter 10.3 - Processing REGISTER Request - step 8
  	    {ok, create_process_updates_response(SipUser)};
  	SipError ->
  	    SipError
      end.
  
  %% part of process_updates/4. Returns {200, "OK", []} | {200, "OK", ExtraHeaders}
  create_process_updates_response(SipUser) ->
      case fetch_contacts(SipUser) of
  	[] ->
  	    {200, "OK", []};
  	NewContacts when is_list(NewContacts) ->
  	    {200, "OK", [{"Contact", NewContacts}]}
      end.
  
  
  