anchor.diff:  			'Auth-Application-Id' = AuthAppId, 'CC-Request-Type' = RequestType,
   			'CC-Request-Number' = RequestNum, 'Granted-Service-Unit' = GrantedUnits},
   	Server = {Address, Port},
  -	ok = ocs_log:acct_log(diameter, Server, OHost, ORealm, accounting_event_type(RequestType),
  -			Subscriber, Balance, ResultCode),
  +	ok = ocs_log:acct_log(diameter, Server, accounting_event_type(RequestType), Request),
   	{reply, Reply, State}.
   
  --spec send_error(SessionId, Subscriber, Balance, ResultCode, OriginHost, OriginRealm,
  +-spec send_error(Request, SessionId, Subscriber, Balance, ResultCode, OriginHost, OriginRealm,
   		AuthAppId, RequestType, RequestNum, State) -> Result
   			when
  +				Request ::#diameter_cc_app_CCR{},
   				SessionId :: string(),
   				Subscriber :: undefined | string() | binary(),
   				Balance :: undefined | integer(),
  
positive.code: 			{ok, Password, _, Balance, true} ->
  				case ocs:authorize(Subscriber, Password) of
  					{ok, _, _} ->
  						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,
  								RequestNum, State)
  				end;
  			{error, _} ->
  				send_error(SId, undefined, undefined, ?'DIAMETER_BASE_RESULT-CODE_AUTHORIZATION_REJECTED',
  					OHost, ORealm, ?CC_APPLICATION_ID, RequestType,
  						RequestNum, State)
  		end
  	catch
  		_:_ ->
  			send_error(SId, undefined, undefined,
  					?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY', OHost, ORealm,
  					?CC_APPLICATION_ID, RequestType, RequestNum, State)
  	end.
  
  %% @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,
  
negative.code: 				Reply :: #diameter_cc_app_CCA{}.
  %% @doc Send CCA to Diameter client indicating a successful operation.
  %% @hidden
  send_answer(Request, SId, _Subscriber, Balance, ResultCode, OHost, ORealm, AuthAppId, RequestType,
  		RequestNum, #state{address = Address, port = Port} = State) ->
  	GrantedUnits = #'diameter_cc_app_Granted-Service-Unit'{'CC-Total-Octets' = Balance},
  	Reply = #diameter_cc_app_CCA{'Session-Id' = SId, 'Result-Code' = ResultCode,
  