anchor.diff:  			{ok, Password, _, Balance, true} ->
   				case ocs:authorize(Subscriber, Password) of
   					{ok, _, _} ->
  -						request1(RequestType, SId, RequestNum, Subscriber, Balance, OHost, ORealm, State);
  +						request1(RequestType, Request, SId, RequestNum, Subscriber, Balance, OHost, ORealm, State);
   					{error, _} ->
   						send_error(SId, Subscriber, Balance, ?'DIAMETER_BASE_RESULT-CODE_AUTHORIZATION_REJECTED',
   								OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  
positive.code: 			Subscriber, Balance, ResultCode),
  	{reply, Reply, State}.
  
  
negative.code: 
  %% @hidden
  request1(?'DIAMETER_CC_APP_CC-REQUEST-TYPE_INITIAL_REQUEST' = RequestType,
  		_Request, SId, RequestNum, Subscriber, Balance, OHost, ORealm, State) ->
  	send_answer(SId, Subscriber, Balance, ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  			OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  			RequestNum, State);
  request1(?'DIAMETER_CC_APP_CC-REQUEST-TYPE_UPDATE_REQUEST' = RequestType,
  		Request, SId, RequestNum, Subscriber, Balance, OHost, ORealm, State) ->
  	try
  		UsedUnits = Request#'diameter_cc_app_CCR'.'Used-Service-Unit',
  		#'diameter_cc_app_Used-Service-Unit'{'CC-Total-Octets' = Total,
  				'CC-Input-Octets' = In, 'CC-Output-Octets' = Out} = UsedUnits,
  		Usage = case Total of
  			Total when is_integer(Total) ->
  				Total;
  			_ ->
  				case {In, Out} of
  					{In, Out} when is_integer(In), is_integer(Out) ->
  						In + Out;
  					_ ->
  						throw(no_diameter_accounting_usage_information)
  				end
  		end,
  		case decrement_balance(Subscriber, Usage) of
  			{ok, OverUsed, false} when OverUsed =< 0 ->
  				send_answer(SId, Subscriber, Balance, ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  						OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  						RequestNum, State);
  			{ok, _SufficientBalance, _Flags} ->
  				send_answer(SId, Subscriber, Balance, ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  						OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  						RequestNum, State);
  			{error, not_found} ->
  				error_logger:warning_report(["diameter accounting subscriber not found",
  						{module, ?MODULE}, {subscriber, Subscriber},
  						{origin_host, OHost}]),
  				send_error(SId, Subscriber, Balance, ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  						OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  						RequestNum, State)
  		end
  	catch
  		_:_ ->
  			send_error(SId, Subscriber, Balance, ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  					OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  					RequestNum, State)
  	end;
  request1(?'DIAMETER_CC_APP_CC-REQUEST-TYPE_TERMINATION_REQUEST' = RequestType,
  		_Request, SId, RequestNum, Subscriber, Balance, OHost, ORealm, State) ->
  	F = fun() ->
  		case mnesia:read(subscriber, Subscriber, write) of
  			[#subscriber{disconnect = false} = Entry] ->
  