anchor.diff:  		lists:foreach(Update, A)
   	end,
       mnesia:transaction(F).
  +
  +fetch_dialogue({CallID, FromTag, none}, Type) ->
  +    case get_call_type({CallID, FromTag, none}, Type) of
  +	{atomic, [Record]} ->
  +	    {{CallID, FromTag, none}, Record};
  +	{atomic, []} ->
  +	     nomatch
  +    end;
  +fetch_dialogue(DialogueID, Type) ->
  +    case database_call:get_call_type(DialogueID, Type) of
  +	{atomic, [Record]} ->
  +	    {DialogueID, Record};
  +	{atomic, []} ->
  +	    {CallID, FromTag, _} = DialogueID,
  +	    fetch_dialogue({CallID, FromTag, none}, Type)
  +    end.
  +        
  +fetch_call(Header, Type) ->
  +    DialogueID = sipheader:dialogueid(Header),
  +    case fetch_dialogue(DialogueID, Type) of
  +	{_, Call} ->
  +	    Call;
  +	_ ->
  +	    nomatch
  +    end.
  +
  
positive.code: -module(database_call).
  -export([create_call/0, insert_call/4, get_call/1, list_calls/0,
  	 insert_call_unique/4, set_data/2, delete_call_type/2, get_call_type/2]).
  
  -include("database_call.hrl").
  
  
negative.code: 	    end,
      mnesia:transaction(F).
  
  delete_all_calls() ->
      F = fun() ->
  		Q = query
  			[E || E <- table(call)]
  		    end,
  		    A = mnemosyne:eval(Q),
  		    Delete = fun(O) ->
  				   mnesia:delete_object(O)
  			   end,
  		    lists:foreach(Delete, A)
  	end,
      mnesia:transaction(F).
  
  list_calls() ->
      F = fun() ->
  		Q = query
  