anchor.diff:  		UserName:: string(),
   		Password :: string(),
   		State :: state(),
  -		Result :: {reply, Answer, State},
  -		Answer :: #diameter_nas_app_AAA{}.
  +		NewState :: state() | {Fsm, State},
  +		Fsm :: undefined | pid().
   start_fsm(AuthSup, AppId, SessId, Type, OHost, ORealm, UserName,
  -			Password, State) ->
  +			Password, #state{handlers = Handlers} = State) ->
   	StartArgs = [diameter, SessId, AppId, Type, OHost, ORealm, UserName, Password],
   	ChildSpec = [StartArgs, []],
   	case supervisor:start_child(AuthSup, ChildSpec) of
   		{ok, Fsm} ->
  -			Answer = gen_fsm:sync_send_all_state_event(Fsm, diameter_request),
  -			{reply, Answer, State};
  -		{error, _Reason} ->
  -			Answer = #diameter_nas_app_AAA{'Session-Id' = SessId,
  -					'Auth-Application-Id' = 1, 'Auth-Request-Type' = 1,
  -					'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  -					'Origin-Host' = OHost, 'Origin-Realm' = ORealm },
  -			{reply, Answer, State}
  +			link(Fsm),
  +			NewHandlers = gb_trees:enter(SessId, Fsm, Handlers),
  +			State#state{handlers = NewHandlers},
  +			{Fsm, State};
  +		{error, Reason} ->
  +			error_logger:error_report(["Error starting session handler",
  +					{error, Reason}, {supervisor, AuthSup},{session_id, SessId}]),
  +		%	Answer = #diameter_nas_app_AAA{'Session-Id' = SessId,
  +		%			'Auth-Application-Id' = 1, 'Auth-Request-Type' = 1,
  +		%			'Result-Code' = ?'DIAMETER_BASE_RESULT-CODE_UNABLE_TO_COMPLY',
  +		%			'Origin-Host' = OHost, 'Origin-Realm' = ORealm },
  +			{undefined, State}
   	end.
   
  +-spec get_session_id(Request) -> SessionId
  +	when
  +		Request :: #diameter_nas_app_AAR{},
  +		SessionId :: string().
  +%% @doc Return value for session id in Diameter Request.
  +%% @hidden
  +get_session_id(Request) when is_record(Request, diameter_nas_app_AAR) ->
  +	Request#diameter_nas_app_AAR.'Session-Id'.
  +
  
positive.code: %% @see //stdlib/gen_server:handle_call/3
  %% @private
  handle_call({diameter_request, Caps, Request}, _From, State) ->
  	#diameter_caps{origin_host = {OHost,_}, origin_realm = {ORealm,_}} = Caps,
  	request(OHost, ORealm, Request, State).
  
  -spec handle_cast(Request, State) -> Result
  	when
  
negative.code: 	Children = supervisor:which_children(AuthPortSup),
  	{_, SimpleAuthSup, _, _} = lists:keyfind(ocs_simple_auth_fsm_sup, 1, Children),
  	NewState = State#state{simple_auth_sup = SimpleAuthSup},
  	{noreply, NewState};
  handle_info({'EXIT', Fsm, {shutdown, SessionId}},
  		#state{handlers = Handlers} = State) ->
  	case gb_trees:lookup(SessionId, Handlers) of
  		{value, Fsm} ->
  			NewHandlers = gb_trees:delete(SessionId, Handlers),
  			{noreply, State#state{handlers = NewHandlers}};
  		none ->
  			{noreply, State}
  	end;
  handle_info({'EXIT', Fsm, _Reason},
  		#state{handlers = Handlers} = State) ->
  	Fdel = fun(_F, {Key, {Pid, _Identity}, _Iter}) when Pid == Fsm ->
  				Key;
  			(F, {_Key, _Val, Iter}) ->
  				F(F, gb_trees:next(Iter));
  			(_F, none) ->
  				none
  	end,
  	Iter = gb_trees:iterator(Handlers),
  	case Fdel(Fdel, gb_trees:next(Iter)) of
  		none ->
  			{noreply, State};
  		Key ->
  			NewHandlers = gb_trees:delete(Key, Handlers),
  			NewState = State#state{handlers = NewHandlers},
  			{noreply, NewState}
  	end.
  
  -spec terminate(Reason, State) -> any()
  	when
  