From b4dbe90a2d0b9f6d79eb13a726952227cec4828f Mon Sep 17 00:00:00 2001 From: lazedo Date: Fri, 9 Jun 2017 21:11:40 +0100 Subject: [PATCH] spawn router processes (#3810) --- applications/ecallmgr/src/ecallmgr_fs_route.erl | 6 +++--- applications/ecallmgr/src/ecallmgr_fs_router_call.erl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/ecallmgr/src/ecallmgr_fs_route.erl b/applications/ecallmgr/src/ecallmgr_fs_route.erl index 49b98f507d4..fc71f28aefc 100644 --- a/applications/ecallmgr/src/ecallmgr_fs_route.erl +++ b/applications/ecallmgr/src/ecallmgr_fs_route.erl @@ -145,7 +145,7 @@ handle_info({'fetch', Section, Tag, Key, Value, FSId, FSData} catch _E:_R -> lager:warning("failed to include switch_url/uri for node ~s : ~p : ~p", [Node, _E, _R]), - {'noreply', State, 'hibernate'} + {'noreply', State} end; handle_info({'fetch', Section, _Tag, _Key, _Value, FSId, [CallId | FSData]} ,#state{node=Node @@ -160,8 +160,8 @@ handle_info({'fetch', Section, _Tag, _Key, _Value, FSId, [CallId | FSData]} ,{<<"Switch-Nodename">>, kz_term:to_binary(Node)} ]) ++ FSData, - handle_fetch(Section, FSId, CallId, Props, Node), - {'noreply', State, 'hibernate'}; + kz_util:spawn(fun handle_fetch/5, [Section, FSId, CallId, Props, Node]), + {'noreply', State}; handle_info({'EXIT', _, 'noconnection'}, State) -> {stop, {'shutdown', 'noconnection'}, State}; handle_info({'EXIT', _, Reason}, State) -> diff --git a/applications/ecallmgr/src/ecallmgr_fs_router_call.erl b/applications/ecallmgr/src/ecallmgr_fs_router_call.erl index 372a0cb2eb9..7307ec92aac 100644 --- a/applications/ecallmgr/src/ecallmgr_fs_router_call.erl +++ b/applications/ecallmgr/src/ecallmgr_fs_router_call.erl @@ -145,7 +145,7 @@ interaction_props(Node, CallId, FSData) -> case props:get_value(?GET_CCV(<>), FSData) of 'undefined' -> InterActionId = props:get_value(?GET_CUSTOM_HEADER(<<"Call-Interaction-ID">>), FSData, ?CALL_INTERACTION_DEFAULT), - ecallmgr_fs_command:set(Node, CallId, [{<>, InterActionId}]), + kz_util:spawn(fun ecallmgr_fs_command:set/3, [Node, CallId, [{<>, InterActionId}]]), [{?GET_CCV(<>), InterActionId}]; _InterActionId -> [] end.