anchor.diff:  %%--------------------------------------------------------------------
   %% Include files
   %%--------------------------------------------------------------------
  -
   -include("database_forward.hrl").
  +-include("siprecords.hrl").
  +-include("sipproxy.hrl").
   
   %%--------------------------------------------------------------------
   %% Records
  
positive.code: %%====================================================================
  
  
  
  
negative.code: 				 ]).
  
  %%--------------------------------------------------------------------
  %% Function: insert(Number, Forwards, Timeout, Localring)
  %%           Number    = string(), arbitrary number or SIP username
  %%           Forwards  = list() of sipurl record()
  %%           Timeout   = integer(), wait timeout - timeout for wait
  %%                       sipproxy_action placed after the call
  %%                       sipproxy_actions generated for Forwards
  %%           LocalRing = whether to ring on location database entrys
  %%                       at the same time as the forward destinations
  %%                       or not
  %% Descrip.: Store Forwards for Number.
  %% Returns : mnesia:transactions()
  %%--------------------------------------------------------------------
  insert(Number, Forwards, Timeout, Localring) when is_list(Number), is_list(Forwards), is_integer(Timeout),
  						  Localring == true; Localring == false ->
      ForwardStrings = sipurls_to_strings(Forwards),
      db_util:insert_record(#forward{number = Number,
  				   forwards = ForwardStrings,
  				   timeout = Timeout,
  				   localring = Localring}).
  
  %%--------------------------------------------------------------------
  %% Function: list()
  %% Descrip.: List all forwards in the database.
  %% Returns : list() of forward record()
  %%--------------------------------------------------------------------
  list() ->
      db_util:tab_to_list(forward).
  
  %%--------------------------------------------------------------------
  %% Function: fetch(Number)
  %%           Number = string(), arbitrary number or SIP username
  %% Descrip.: Fetch all forwards for Number.
  %% Returns : {ok, Forwards}
  %%           Forwards = list() of sipproxy_forward record()
  %%--------------------------------------------------------------------
  fetch(Number) ->
      F = fun() ->
  		MatchSpec = [{#forward{number = Number, _ = '_'},
  			      [],
  			      [{{{element, #forward.forwards, '$_'},
  				 {element, #forward.timeout, '$_'},
  				 {element, #forward.localring, '$_'}
  				}}]
  			     }],
  		mnesia:select(forward, MatchSpec)
  	end,
      {atomic, L} = mnesia:transaction(F),
      Rewrite = fun(Entry) ->
  		      {Fwds, Timeout, LRing} = Entry,
  		      FwdURIs = strings_to_sipurls(Fwds),
  		      #sipproxy_forward{user      = Number,
  					forwards  = FwdURIs,
  					timeout   = Timeout,
  					localring = LRing
  				       }
  	      end,
      {ok, lists:map(Rewrite, L)}.
  
  %%--------------------------------------------------------------------
  %% Function: delete(Number)
  %%           Number = string(), arbitrary number or SIP username
  %% Descrip.: Delete all forwards for Number.
  %% Returns : mnesia:transaction()
  %%--------------------------------------------------------------------
  delete(Number) when is_list(Number) ->
      db_util:delete_with_key(forward, Number).
  
  
  