anchor.diff:  					'Origin-Host' = OHost,
   					'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_AUTHENTICATION_REJECTED',
   					'Origin-Realm' = ORealm },
  -			ok = ocs_log:auth_log(diameter, Server, Subscriber, OHost, ORealm, Type,
  -					?'DIAMETER_BASE_RESULT-CODE_AUTHENTICATION_REJECTED'),
  +			ok = ocs_log:auth_log(diameter, Server, Client, Request, Answer),
   			gen_server:cast(PortServer, {self(), Answer}),
   			{stop, {shutdown, SessionID}, StateData}
   	end.
  
positive.code: 			{stop, {shutdown, SessionID}, StateData}
  	end;
  request(timeout, #statedata{protocol = diameter, session_id = SessionID,
  		server_address = ServerAddress, server_port = ServerPort, subscriber = Subscriber,
  		password = Password, app_id = AppId, auth_request_type = Type,
  		origin_host = OHost, origin_realm = ORealm, diameter_port_server = PortServer
  		} = StateData) ->
  	Server = {ServerAddress, ServerPort},
  	case ocs:authorize(Subscriber, Password) of
  		{ok, _Password, _Attr} ->
  			Answer = #diameter_nas_app_AAA{'Session-Id' = SessionID,
  					'Auth-Application-Id' = AppId, 'Auth-Request-Type' = Type,
  					'Origin-Host' = OHost, 'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_SUCCESS',
  					'Origin-Realm' = ORealm },
  			ok = ocs_log:auth_log(diameter, Server, Subscriber, OHost, ORealm, Type,
  					?'DIAMETER_BASE_RESULT-CODE_SUCCESS'),
  			gen_server:cast(PortServer, {self(), Answer}),
  			{stop, {shutdown, SessionID}, StateData};
  		{error, _Reason} ->
  
negative.code: 		origin_host :: undefined | string(),
  		origin_realm :: undefined | string(),
  		password :: undefined | string(),
  		diameter_port_server :: undefined | pid(),
  		request :: undefined | #diameter_nas_app_AAR{}}).
  
  -type statedata() :: #statedata{}.
  
  