Skip to content

Commit

Permalink
WHISTLE-1441: compact heap when clearing a call
Browse files Browse the repository at this point in the history
  • Loading branch information
James Aimonetti committed Dec 18, 2012
1 parent 4439c57 commit 1aafed1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions whistle_apps/apps/acdc/src/acdc_agent_fsm.erl
Expand Up @@ -524,7 +524,7 @@ ready({route_req, Call}, #state{agent_proc=Srv

acdc_agent:outbound_call(Srv, Call),
acdc_stats:agent_oncall(AcctId, AgentId, CallId),
{next_state, outbound, State#state{outbound_call_id=CallId}};
{next_state, outbound, State#state{outbound_call_id=CallId}, hibernate};

ready(_Evt, State) ->
lager:debug("unhandled event: ~p", [_Evt]),
Expand Down Expand Up @@ -807,7 +807,7 @@ wrapup({route_req, Call}, #state{agent_proc=Srv
acdc_agent:outbound_call(Srv, Call),
acdc_stats:agent_oncall(AcctId, AgentId, CallId),

{next_state, outbound, State#state{outbound_call_id=CallId}};
{next_state, outbound, State#state{outbound_call_id=CallId}, hibernate};

wrapup(_Evt, State) ->
lager:debug("unhandled event: ~p", [_Evt]),
Expand Down Expand Up @@ -885,7 +885,7 @@ paused({route_req, Call}, #state{agent_proc=Srv
acdc_agent:outbound_call(Srv, Call),
acdc_stats:agent_oncall(AcctId, AgentId, CallId),

{next_state, outbound, State#state{outbound_call_id=CallId}};
{next_state, outbound, State#state{outbound_call_id=CallId}, hibernate};

paused(_Evt, State) ->
lager:debug("unhandled event: ~p", [_Evt]),
Expand All @@ -904,7 +904,7 @@ outbound({channel_hungup, CallId}, #state{agent_proc=Srv
lager:debug("outbound channel ~s hungup", [CallId]),
acdc_agent:channel_hungup(Srv, CallId),
acdc_stats:agent_ready(AcctId, AgentId),
{next_state, ready, clear_call(State)};
{next_state, ready, clear_call(State), hibernate};

outbound({leg_destroyed, CallId}, #state{agent_proc=Srv
,outbound_call_id=CallId
Expand All @@ -914,7 +914,7 @@ outbound({leg_destroyed, CallId}, #state{agent_proc=Srv
lager:debug("outbound leg ~s destroyed", [CallId]),
acdc_agent:channel_hungup(Srv, CallId),
acdc_stats:agent_ready(AcctId, AgentId),
{next_state, ready, clear_call(State)};
{next_state, ready, clear_call(State), hibernate};

outbound({member_connect_win, JObj}, #state{agent_proc=Srv}=State) ->
lager:debug("agent won, but can't process this right now (on outbound call)"),
Expand Down

0 comments on commit 1aafed1

Please sign in to comment.