Skip to content

Commit

Permalink
Fixing set_cook on both cook and gen_media.
Browse files Browse the repository at this point in the history
This is to fix the case where an agent rejects a call.
  • Loading branch information
lordnull committed Apr 19, 2012
1 parent 37c82a9 commit 52ac4bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cook.erl
Expand Up @@ -145,6 +145,7 @@ init([Call, InRecipe, Queue, Qpid, {_Priority, {MSec, Sec, _MsSec}} = Key]) ->
do_recipe(OptRecipe, 0, Qpid, Call)
end,
State = #state{recipe=Recipe, call=Call, queue=Queue, qpid = Qpid, tref=Tref, key = Key, callid = CallRec#call.id},
gen_media:set_cook(Call,self()),
{ok, State}
catch
Why:Reason ->
Expand Down
2 changes: 1 addition & 1 deletion src/gen_media.erl
Expand Up @@ -875,7 +875,7 @@ inqueue({{'$gen_media', set_cook}, CookPid}, {BaseState, Internal}) ->
Newmon = erlang:monitor(process, CookPid),
NewCall = Call#call{cook = CookPid},
NewInternal = Internal#inqueue_state{cook_mon = Newmon, cook = CookPid},
NewBase = BaseState#base_state{callrec = Call},
NewBase = BaseState#base_state{callrec = NewCall},
{next_state, inqueue, {NewBase, NewInternal}};

inqueue({{'$gen_media', Command}, _}, State) ->
Expand Down

0 comments on commit 52ac4bf

Please sign in to comment.