Skip to content

Commit

Permalink
3.06: support versions of kazoo-freeswitch without the channels binding
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anderson committed Jan 30, 2014
1 parent 919e157 commit 3fe115e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions applications/ecallmgr/src/ecallmgr_fs_channel.erl
Expand Up @@ -248,13 +248,15 @@ handle_call(_Request, _From, State) ->
%% @end
%%--------------------------------------------------------------------
handle_cast('bind_to_events', #state{node=Node}=State) ->
case gproc:reg({'p', 'l', {'event', Node, <<"CHANNEL_DATA">>}}) =:= 'true'
andalso gproc:reg({'p', 'l', {'event', Node, <<"CHANNEL_CREATE">>}}) =:= 'true'
andalso gproc:reg({'p', 'l', {'event', Node, <<"CHANNEL_DESTROY">>}}) =:= 'true'
andalso gproc:reg({'p', 'l', {'event', Node, <<"CHANNEL_ANSWER">>}}) =:= 'true'
andalso gproc:reg({'p', 'l', {'event', Node, <<"CHANNEL_BRIDGE">>}}) =:= 'true'
andalso gproc:reg({'p', 'l', {'event', Node, <<"CHANNEL_UNBRIDGE">>}}) =:= 'true'
andalso freeswitch:bind(Node, 'channels') =:= 'ok'
%% If the freeswitch version is updated so Kazoo can
%% support for nightmare transfer bind for channel queries
_ = (catch freeswitch:bind(Node, 'channels')),
case gproc:reg({'p', 'l', ?FS_EVENT_REG_MSG(Node, <<"CHANNEL_DATA">>)}) =:= 'true'
andalso gproc:reg({'p', 'l', ?FS_EVENT_REG_MSG(Node, <<"CHANNEL_CREATE">>)}) =:= 'true'
andalso gproc:reg({'p', 'l', ?FS_EVENT_REG_MSG(Node, <<"CHANNEL_DESTROY">>)}) =:= 'true'
andalso gproc:reg({'p', 'l', ?FS_EVENT_REG_MSG(Node, <<"CHANNEL_ANSWER">>)}) =:= 'true'
andalso gproc:reg({'p', 'l', ?FS_EVENT_REG_MSG(Node, <<"CHANNEL_BRIDGE">>)}) =:= 'true'
andalso gproc:reg({'p', 'l', ?FS_EVENT_REG_MSG(Node, <<"CHANNEL_UNBRIDGE">>)}) =:= 'true'
of
'true' -> {'noreply', State};
'false' -> {'stop', 'gproc_badarg', State}
Expand Down

0 comments on commit 3fe115e

Please sign in to comment.