anchor.diff:  	{response, Status, Reason} ->
   	    logger:log(normal, "~s: incomingproxy: Response ~p ~s", [LogTag, Status, Reason]),
   	    transactionlayer:send_response_handler(THandler, Status, Reason);
  -	{proxy, Loc} when record(Loc, sipurl) ->
  +	{proxy, Loc} when is_record(Loc, sipurl) ->
   	    logger:log(normal, "~s: incomingproxy: Proxy ~s -> ~s", [LogTag, Method, sipurl:print(Loc)]),
   	    proxy_request(THandler, Request, Loc);
  -	{redirect, Loc} when record(Loc, sipurl) ->
  +	{redirect, Loc} when is_record(Loc, sipurl) ->
   	    logger:log(normal, "~s: incomingproxy: Redirect ~s", [LogTag, sipurl:print(Loc)]),
  -	    Contact = [{none, Loc}],
  +	    Contact = [contact:new(none, Loc, [])],
   	    ExtraHeaders = [{"Contact", sipheader:contact_print(Contact)}],
   	    transactionlayer:send_response_handler(THandler, 302, "Moved Temporarily", ExtraHeaders);
   	{relay, Loc} ->
   	    relay_request(THandler, Request, Loc, Origin, LogTag);
  -	{forward, FwdURL} when record(FwdURL, sipurl), FwdURL#sipurl.user == none, FwdURL#sipurl.pass == none ->
  +	{forward, FwdURL} when is_record(FwdURL, sipurl), FwdURL#sipurl.user == none, FwdURL#sipurl.pass == none ->
   	    logger:log(normal, "~s: incomingproxy: Forward ~s ~s to ~s",
  -			[LogTag, Method, sipurl:print(URI), sipurl:print(FwdURL)]),
  +		       [LogTag, Method, sipurl:print(URI), sipurl:print(FwdURL)]),
   	    {ok, _, ApproxMsgSize} = siprequest:check_proxy_request(Request),
   	    case sipdst:url_to_dstlist(FwdURL, ApproxMsgSize, URI) of
   		{error, nxdomain} ->
  -		    logger:log(debug, "incomingproxy: Failed resolving FwdURL : NXDOMAIN (responding '604 Does Not Exist Anywhere')"),
  +		    logger:log(debug, "incomingproxy: Failed resolving FwdURL : NXDOMAIN"
  +			       " (responding '604 Does Not Exist Anywhere')"),
                       transactionlayer:send_response_handler(THandler, 604, "Does Not Exist Anywhere"),
                       error;
   		{error, What} ->
   		    logger:log(normal, "incomingproxy: Failed resolving FwdURL : ~p", [What]),
                       transactionlayer:send_response_handler(THandler, 500, "Failed resolving forward destination"),
                       error;
  -		DstList when list(DstList) ->
  +		DstList when is_list(DstList) ->
   		    proxy_request(THandler, Request, DstList)
   	    end;
   	{me} ->
  
positive.code: 		true ->
  		    do_request(Request, Origin);
  		false ->
  		    logger:log(normal, "~s: incomingproxy: Not authorized to use this From: -> 403 Forbidden", [LogTag]),
  		    transactionlayer:send_response_handler(THandler, 403, "Forbidden");
  		drop ->
  		    ok;
  		Unknown ->
  		    logger:log(error, "~s: Unknown result from verify_homedomain_user() :~n~p",
  		    		[LogStr, Unknown]),
  		    transactionlayer:send_response_handler(THandler, 500, "Server Internal Error")
  	    end;
  	_ ->
  	    do_request(Request, Origin)
      end.
  
  
  %% Function: response/3
  %% Description: Yxa applications must export an response/3 function.
  %% Returns: See XXX
  %%--------------------------------------------------------------------
  response(Response, Origin, LogStr) when record(Response, response), record(Origin, siporigin) ->
      {Status, Reason} = {Response#response.status, Response#response.reason},
      logger:log(normal, "incomingproxy: Response to ~s: ~p ~s, no matching transaction - proxying statelessly", [LogStr, Status, Reason]),
      transportlayer:send_proxy_response(none, Response).
  
  
  %%--------------------------------------------------------------------
  %%% Internal functions
  %%--------------------------------------------------------------------
  
  
  %% Function: verify_homedomain_user/2
  %% Description: If a request has a From: matching our homedomains,
  %%              this function is called to make sure the user really
  %%              is who it says it is, and not someone else forging
  %%              our users identity.
  %% Returns: true  |
  %%          false |
  %%          drop
  %%--------------------------------------------------------------------
  verify_homedomain_user(Request, LogTag) when record(Request, request) ->
      Method = Request#request.method,
      Header = Request#request.header,
      case sipserver:get_env(always_verify_homedomain_user, true) of
  	true ->
  	    {_, FromURI} = sipheader:from(keylist:fetch("From", Header)),
  	    % Request has a From: address matching one of my domains.
  	    % Verify sending user.
  	    case local:get_user_verified_proxy(Header, Method) of
  		{authenticated, SIPUser} ->
  		    case local:can_use_address(SIPUser, sipurl:print(FromURI)) of
  			true ->
  			    logger:log(debug, "Request: User ~p is allowed to use From: address ~p",
  			    		[SIPUser, sipurl:print(FromURI)]),
  			    true;
  			false ->
  			    logger:log(error, "Authenticated user ~p may NOT use address ~p",
  			    		[SIPUser, sipurl:print(FromURI)]),
  			    false
  		    end;
  		stale ->
  
negative.code: 	    transactionlayer:send_response_handler(THandler, 500, "Server Internal Error")
      end.
  
  relay_dst2str(URI) when is_record(URI, sipurl) ->
      sipurl:print(URI);
  relay_dst2str(route) ->
      "according to Route header";
  