anchor.diff:  %% @@see //stdlib/gen_fsm:StateName/2
   %% @private
   %%
  -send_response(timeout, StateData)->
  -	{stop, shutdown, StateData};
  -send_response({#radius{code = ?AccessRequest, id = RadiusID,
  -		authenticator =  RequestAuthenticator,
  -		attributes = Attributes}, RadiusFsm},
  -		#statedata{session_id = SessionID, secret = Secret} = StateData) ->
  -	Subscriber = radius_attributes:fetch(?UserName, Attributes),
  -	NewStateData = StateData#statedata{subscriber = Subscriber},
  +request(timeout, #statedata{req_attr = Attributes,
  +		session_id = SessionID} = StateData) ->
  +	case radius_attributes:find(?UserName, Attributes) of
  +		{ok, Subscriber} ->
  +			request1(StateData#statedata{subscriber = Subscriber});
  +		{error, not_found} ->
  +			response(?AccessReject, [], StateData),
  +			{stop, {shutdown, SessionID}, StateData}
  +	end.
  +%% @hidden
  +request1(#statedata{req_attr = Attributes,
  +		req_auth = Authenticator, session_id = SessionID} = StateData) ->
  +	case radius_attributes:find(?UserPassword, Attributes) of
  +		{ok, Hidden} ->
  +			Password = radius_attributes:unhide(Secret, Authenticator, Hidden),
  +			request2(list_to_binary(Password), StateData);
  +		{error, not_found} ->
  +			response(?AccessReject, [], StateData),
  +			{stop, {shutdown, SessionID}, StateData}
  +	end.
  +%% @hidden
  +request2(Password, #statedata{subscriber = Subscriber,
  +		session_id = SessionID} = StateData) ->
   	case ocs:find_subscriber(Subscriber) of
  -		{ok, [], Attr, _} ->
  -			send_response(?AccessAccept, RadiusID, Attr, RequestAuthenticator,
  -						Secret, RadiusFsm),
  -			{stop, {shutdown, SessionID}, NewStateData };
  +		{ok, Password, ResponseAttributes, Balance} when Balance > 0 ->
  +			response(?AccessAccept, ResponseAttributes, StateData),
  +			{stop, {shutdown, SessionID}, StateData};
  +		{ok, Password, _, _} ->
  +			RejectAttributes = [{?RelyMessage, "Out of Credit"}],
  +			response(?AccessReject, RejectAttributes, StateData),
  +			{stop, {shutdown, SessionID}, StateData};
  +		{ok, _, _, _} ->
  +			RejectAttributes = [{?RelyMessage, "Bad Password"}],
  +			response(?AccessReject, RejectAttributes, StateData),
  +			{stop, {shutdown, SessionID}, StateData};
   		{error, not_found} ->
  -			send_response(?AccessReject, RadiusID, Attributes, RequestAuthenticator,
  -					Secret, RadiusFsm),
  -			{stop, {shutdown, SessionID}, NewStateData }
  +			RejectAttributes = [{?RelyMessage, "Unknown Username"}],
  +			response(?AccessReject, RejectAttributes, StateData),
  +			{stop, {shutdown, SessionID}, StateData}
   	end.
   
   -spec handle_event(Event :: term(), StateName :: atom(),
  
positive.code: -record(statedata,
  		{address :: inet:ip_address(),
  		port :: pos_integer(),
  		secret :: binary(),
  		session_id:: {NAS :: inet:ip_address() | string(),
  				Port :: string(), Peer :: string()},
  		socket :: term(),
  		subscriber :: binary()}).
  
  -define(TIMEOUT, 30000).
  
negative.code: %% @see //stdlib/gen_fsm:init/1
  %% @private
  %%
  init([Address, Port, RadiusFsm, Secret, SessionID,
  		#radius{code = ?AccessRequest, id = ID,
  		authenticator = Authenticator, attributes = Attributes] = _Args) ->
  	StateData = #statedata{address = Address, port = Port,
  		radius_fsm = RadiusFsm, secret = Secret, session_id = SessionID,
  		req_auth = Authenticator, req_attr = Attributes},
  	process_flag(trap_exit, true),
  	{ok, request, StateData, 0}.
  
  -spec request(Event :: timeout | term(), StateData :: #statedata{}) ->
  	Result :: {next_state, NextStateName :: atom(), NewStateData :: #statedata{}}
  		| {next_state, NextStateName :: atom(), NewStateData :: #statedata{},
  		Timeout :: non_neg_integer() | infinity}
  