Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into embeddable_build

  • Loading branch information...
commit 2fd41f82a5f5cc8d1a60c190d3447ae24d83d0e1 2 parents 8b795e9 + 52ac4bf
@lordnull lordnull authored
View
4 include_apps/oacd_freeswitch/src/freeswitch_media.erl
@@ -316,7 +316,7 @@ handle_ring_stop(_StateName, Callrec, _GenMedia, #state{xferchannel = RingChanne
freeswitch_ring:hangup(RingChannel),
{ok, State#state{xferchannel = undefined, xferuuid = undefined}};
-handle_ring_stop(_StateName, Callrec, _GenMedia, State) ->
+handle_ring_stop(StateName, Callrec, _GenMedia, State) ->
?DEBUG("hanging up ring channel for ~p", [Callrec#call.id]),
case State#state.ringchannel of
undefined ->
@@ -327,7 +327,7 @@ handle_ring_stop(_StateName, Callrec, _GenMedia, State) ->
% in our mailbox
freeswitch_ring:hangup(RingChannel)
end,
- NewStatename = case State#state.statename of
+ NewStatename = case StateName of
inqueue_ringing -> inqueue;
oncall_ringing -> oncall
end,
View
8 include_apps/oacd_freeswitch/src/freeswitch_ring_transient.erl
@@ -169,7 +169,13 @@ handle_event("CHANNEL_BRIDGE", _Data, {Fsnode, _UUID}, #state{call = #call{type
freeswitch:api(Fsnode, uuid_park, Call#call.id),
{stop, normal, State}
end;
-handle_event(_, _, _, State) ->
+
+handle_event("CHANNEL_HANGUP", _Data, _Fsref, State) ->
+ ?WARNING("Hangup event, stopping", []),
+ {stop,agent_hangup,State};
+
+handle_event(Event, _, _, State) ->
+ ?DEBUG("Ignoring event ~p", [Event]),
{noreply, State}.
%% =====
View
1  src/cook.erl
@@ -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 ->
View
2  src/gen_media.erl
@@ -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) ->
Please sign in to comment.
Something went wrong with that request. Please try again.