%%%-------------------------------------------------------------------
  @author   <  >
   ( C ) 2011 , VoIP INC
%%% @doc
%%% Start SHOUT servers to receive data from FreeSWITCH after a "record"
%%% finishes.
%%% @end
  Created :   4 May 2011 by   <  >
%%%-------------------------------------------------------------------
-module(ecallmgr_shout_sup).

-behaviour(supervisor).

%% API
-export([start_link/0, start_srv/1, start_recv/1]).

%% Supervisor callbacks
-export([init/1]).

-define(SERVER, ?MODULE).

%%%===================================================================
%%% API functions
%%%===================================================================

%%--------------------------------------------------------------------
%% @doc
%% Starts the supervisor
%%
    ( ) - > { ok , Pid } | ignore | { error , Error }
%% @end
%%--------------------------------------------------------------------
start_link() ->
    supervisor:start_link({local, ?SERVER}, ?MODULE, []).

start_recv(FilePath) ->
    supervisor:start_child(?SERVER, [FilePath, recv]).

start_srv(FilePath) ->
    supervisor:start_child(?SERVER, [FilePath, srv]).

%%%===================================================================
%%% Supervisor callbacks
%%%===================================================================

%%--------------------------------------------------------------------
  @private
%% @doc
%% Whenever a supervisor is started using supervisor:start_link/[2,3],
%% this function is called by the new process to find out about
%% restart strategy, maximum restart frequency and child
%% specifications.
%%
    ) - > { ok , { SupFlags , [ ChildSpec ] } } |
%%                     ignore |
%%                     {error, Reason}
%% @end
%%--------------------------------------------------------------------
init([]) ->
    Restart = temporary,
    Shutdown = 2000,
    Type = worker,

    AChild = {ecallmgr_shout, {ecallmgr_shout, start_link, []},
	      Restart, Shutdown, Type, [ecallmgr_shout]},

    {ok, {{simple_one_for_one, 5, 10}, [AChild]}}.

%%%===================================================================
  Internal functions
%%%===================================================================

-------------------------------------------------------------------
 @doc
 Start SHOUT servers to receive data from FreeSWITCH after a "record"
 finishes.
 @end
-------------------------------------------------------------------
 API
 Supervisor callbacks
===================================================================
 API functions
===================================================================
--------------------------------------------------------------------
 @doc
 Starts the supervisor

 @end
--------------------------------------------------------------------
===================================================================
 Supervisor callbacks
===================================================================
--------------------------------------------------------------------
 @doc
 Whenever a supervisor is started using supervisor:start_link/[2,3],
 this function is called by the new process to find out about
 restart strategy, maximum restart frequency and child
 specifications.

                     ignore |
                     {error, Reason}
 @end
--------------------------------------------------------------------
===================================================================
===================================================================
  @author   <  >
   ( C ) 2011 , VoIP INC
  Created :   4 May 2011 by   <  >
-module(ecallmgr_shout_sup).

-behaviour(supervisor).

-export([start_link/0, start_srv/1, start_recv/1]).

-export([init/1]).

-define(SERVER, ?MODULE).


    ( ) - > { ok , Pid } | ignore | { error , Error }
start_link() ->
    supervisor:start_link({local, ?SERVER}, ?MODULE, []).

start_recv(FilePath) ->
    supervisor:start_child(?SERVER, [FilePath, recv]).

start_srv(FilePath) ->
    supervisor:start_child(?SERVER, [FilePath, srv]).


  @private
    ) - > { ok , { SupFlags , [ ChildSpec ] } } |
init([]) ->
    Restart = temporary,
    Shutdown = 2000,
    Type = worker,

    AChild = {ecallmgr_shout, {ecallmgr_shout, start_link, []},
	      Restart, Shutdown, Type, [ecallmgr_shout]},

    {ok, {{simple_one_for_one, 5, 10}, [AChild]}}.

  Internal functions
