Skip to content

Commit

Permalink
handle CHANNEL_HOLD/UNHOLD on both legs (2600hz#2866)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo authored and k-anderson committed Dec 5, 2016
1 parent f30e1d3 commit f9e28ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions applications/ecallmgr/src/ecallmgr_fs_channel_hold.erl
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@ process_event(UUID, Props, Node) ->
process_specific_event(EventName, UUID, Props, Node).

-spec process_specific_event(ne_binary(), api_binary(), kz_proplist(), atom()) -> any().
process_specific_event(<<"CHANNEL_HOLD">>, UUID, _Props, _Node) ->
ecallmgr_fs_channels:update(UUID, #channel.is_onhold, 'true');
process_specific_event(<<"CHANNEL_UNHOLD">>, UUID, _Props, _Node) ->
ecallmgr_fs_channels:update(UUID, #channel.is_onhold, 'false');
process_specific_event(<<"CHANNEL_HOLD">>, UUID, Props, _Node) ->
ecallmgr_fs_channels:update(UUID, #channel.is_onhold, 'true'),
ecallmgr_call_events:process_channel_event([UUID | Props]);
process_specific_event(<<"CHANNEL_UNHOLD">>, UUID, Props, _Node) ->
ecallmgr_fs_channels:update(UUID, #channel.is_onhold, 'false'),
ecallmgr_call_events:process_channel_event([UUID | Props]);
process_specific_event(_Event, _UUID, _Props, _Node) ->
lager:debug("event ~s for callid ~s not handled in channel hold (~s)", [_Event, _UUID, _Node]).
4 changes: 4 additions & 0 deletions applications/ecallmgr/src/ecallmgr_fs_event_stream.erl
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ process_stream(<<"sofia::intercepted">> = EventName, UUID, Props, Node) ->
end,
maybe_send_event(EventName, UUID, Props, Node),
process_event(EventName, UUID, Props, Node);
process_stream(<<"CHANNEL_HOLD">> = EventName, UUID, Props, Node) ->
gproc:send({'p', 'l', ?FS_EVENT_REG_MSG(Node, EventName)}, {'event', [UUID | Props]});
process_stream(<<"CHANNEL_UNHOLD">> = EventName, UUID, Props, Node) ->
gproc:send({'p', 'l', ?FS_EVENT_REG_MSG(Node, EventName)}, {'event', [UUID | Props]});
process_stream(EventName, UUID, EventProps, Node) ->
maybe_send_event(EventName, UUID, EventProps, Node),
process_event(EventName, UUID, EventProps, Node).
Expand Down

0 comments on commit f9e28ba

Please sign in to comment.