anchor.diff:  %%           to do some logging first.
   %% Returns : Pid | {error, E}
   %%--------------------------------------------------------------------
  -start_client_transaction(Request, Dst, Branch, Timeout) ->
  +start_client_transaction(Request, Dst, Branch, Timeout, LogFun) ->
       %% Logging
       BinLine1 = list_to_binary([Request#request.method, " ", sipurl:print(Dst#sipdst.uri), " SIP/2.0"]),
       BinMsg = siprequest:binary_make_message(BinLine1, Request#request.header, <<>>),
  -    io:format("Sending :~n~s~n", [binary_to_list(BinMsg)]),
  +    log(LogFun, extra_verbose, "Sending :~n~s", [binary_to_list(BinMsg)]),
   
       transactionlayer:start_client_transaction(Request, Dst, Branch, Timeout, self()).
   
   
   %%--------------------------------------------------------------------
  -%% Function: wait_for_pids(PidList)
  +%% Function: wait_for_pids(PidList, LogFun)
   %%           PidList = list() of pid()
  +%%           LogFun  = undefined | function()
   %% Descrip.: Wait until none of the pids in PidList is alive amymore.
   %% Returns : {ok, Msg}
   %%           Msg = string()
   %%--------------------------------------------------------------------
  -wait_for_pids(PidList) ->
  +wait_for_pids(PidList, LogFun) ->
       case any_alive(PidList) of
   	true ->
   	    receive
   		M ->
  -		    io:format("DIALOG CONTROLLER ~p GOT SIGNAL ~p~n", [self(), M])
  +		    log(LogFun, error, "DIALOG CONTROLLER ~p GOT SIGNAL ~p", [self(), M])
   	    after 1000 ->
   		    ok
   	    end,
  -	    wait_for_pids(PidList);
  +	    wait_for_pids(PidList, LogFun);
   	false ->
   	    {ok, "All processes terminated"}
       end.
  
positive.code: 		end
  	end,
  
      io:format("~n~nDIALOG DUMP :~n~s~n~n", [sipdialog:dialog2str(NewDialog)]),
      case Action of
  	noreply ->
  	    {noreply, State#state{dialog = NewDialog}};
  
negative.code: %% Returns : NewState = state record()
  %%--------------------------------------------------------------------
  received_invite_2xx(Response, State) when is_record(Response, response), is_record(State, state) ->
      Dialog =
  	case State#state.dialog of
  	    undefined ->
  