anchor.diff:  		Discard :: {discard, Reason} | discard,
   		Reason :: term(),
   		PostF :: diameter:evaluable().
  -%% @doc Invoked to return a request for encoding and transport 
  +%% @doc Invoked to return a request for encoding and transport
   prepare_request(#diameter_packet{} = Packet, _ServiceName, _Peer) ->
   	{send, Packet}.
   
  
positive.code: 		#'3gpp_gx_CCR'{'Session-Id' = SId,
  				'Auth-Application-Id' = ?Gx_APPLICATION_ID,
  				'CC-Request-Type' = RequestType,
  				'CC-Request-Number' = RequestNum} = Request, {eof, []}) ->
  	try
  		#'3gpp_gx_CCA'{'Session-Id' = SId,
  				'Result-Code' = [?'DIAMETER_BASE_RESULT-CODE_SUCCESS'],
  				'Origin-Host' = OHost, 'Origin-Realm' = ORealm,
  				'Auth-Application-Id' = ?Gx_APPLICATION_ID,
  				'CC-Request-Type' = RequestType,
  				'CC-Request-Number' = RequestNum}
  	catch
  		_:Reason ->
  			error_logger:warning_report(["Unable to process DIAMETER request",
  					{origin_host, OHost}, {origin_realm, ORealm},
  					{session_id, SId}, {request, Request}, {error, Reason}]),
  			diameter_error(SId, ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  					OHost, ORealm, RequestType, RequestNum)
  	end;
  process_request2(_Address, _Port, _DiameterCaps, _Request, {error, Reason}) ->
  	{error, Reason}.
  
  %% @hidden
  parse_policy_char([#resource_char{name = "name", value = Value} | T], Acc)
  		 when is_list(Value) ->
  	parse_policy_char(T, Acc#'3gpp_gx_Charging-Rule-Definition'{
  				'Charging-Rule-Name' = [Value]});
  parse_policy_char([#resource_char{name = "chargingKey", value = Value} | T],
  		Acc) when is_integer(Value) ->
  	parse_policy_char(T, Acc#'3gpp_gx_Charging-Rule-Definition'{
  
negative.code: 		{ok, #offer{char_value_use = CharValue}}) ->
  	process_request1(Address, Port, DiameterCaps, Request,
  			lists:keyfind("policyTable", #char_value_use.name, CharValue));
  process_request(_Address, _Port, #diameter_caps{origin_host = {OHost, _DHost},
  		origin_realm = {ORealm, _DRealm}},
  		#'3gpp_gx_CCR'{'Session-Id' = SId,
              'CC-Request-Type' = RequestType,
              'CC-Request-Number' = RequestNum} = Request, {error, Reason}) ->
  	error_logger:warning_report(["Unable to process DIAMETER request",
  			{origin_host, OHost}, {origin_realm, ORealm},
  			{request, Request}, {error, Reason}, {stack, erlang:get_stacktrace()}]),
  	diameter_error(SId, ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  			OHost, ORealm, RequestType, RequestNum).
  %% @hidden
  process_request1(Address, Port, DiameterCaps, Request,
  		#char_value_use{name = "policyTable",
  		values = [#char_value{value = PolicyTable}]}) ->
  	process_request2(Address, Port, DiameterCaps, Request,
  			ocs:query_resource(start, '_', '_', '_', {exact, PolicyTable}));
  process_request1(_Address, _Port, #diameter_caps{origin_host = {OHost, _DHost},
  		origin_realm = {ORealm, _DRealm}} = _DiameterCaps,
  		#'3gpp_gx_CCR'{'Session-Id' = SId,
  				'Auth-Application-Id' = ?Gx_APPLICATION_ID,
  				'CC-Request-Type' = RequestType,
  				'CC-Request-Number' = RequestNum} = Request, false) ->
  	error_logger:warning_report(["Unable to process DIAMETER request",
  			{origin_host, OHost}, {origin_realm, ORealm},
  			{session_id, SId}, {request, Request}, {error, policy_not_found}]),
  	diameter_error(SId, ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  			OHost, ORealm, RequestType, RequestNum).
  
  %% @hidden
  process_request2(_Address, _Port, #diameter_caps{origin_host = {OHost, _DHost},
  		origin_realm = {ORealm, _DRealm}} = _DiameterCaps,
  