%%%-------------------------------------------------------------------
  @author   <  >
   ( C ) 2010 - 2011 , VoIP INC
%%% @doc
%%%
%%% @end
  Created : 27 June 2011 by   <  >
%%%-------------------------------------------------------------------
-module(conference_app).

-behaviour(application).

-include_lib("whistle/include/wh_types.hrl").

-export([start/2, stop/1]).

%%--------------------------------------------------------------------
  @public
%% @doc
%% Implement the application start behaviour
%% @end
%%--------------------------------------------------------------------
-spec start/2 :: (StartType, StartArgs) -> tuple(ok, pid()) | tuple(error, startlink_err()) when
      StartType :: term(),
      StartArgs :: term().
start(_, _) ->
    case conference:start_link() of
	{ok, P} -> {ok, P};
	{error, {already_started, P} } -> {ok, P};
	{error, _}=E -> E
    end.

%%--------------------------------------------------------------------
  @public
%% @doc
%% Implement the application stop behaviour
%% @end
%%--------------------------------------------------------------------
-spec stop/1 :: (State) -> ok when
      State :: term().
stop(_) ->
    ok.

-------------------------------------------------------------------
 @doc

 @end
-------------------------------------------------------------------
--------------------------------------------------------------------
 @doc
 Implement the application start behaviour
 @end
--------------------------------------------------------------------
--------------------------------------------------------------------
 @doc
 Implement the application stop behaviour
 @end
--------------------------------------------------------------------
  @author   <  >
   ( C ) 2010 - 2011 , VoIP INC
  Created : 27 June 2011 by   <  >
-module(conference_app).

-behaviour(application).

-include_lib("whistle/include/wh_types.hrl").

-export([start/2, stop/1]).

  @public
-spec start/2 :: (StartType, StartArgs) -> tuple(ok, pid()) | tuple(error, startlink_err()) when
      StartType :: term(),
      StartArgs :: term().
start(_, _) ->
    case conference:start_link() of
	{ok, P} -> {ok, P};
	{error, {already_started, P} } -> {ok, P};
	{error, _}=E -> E
    end.

  @public
-spec stop/1 :: (State) -> ok when
      State :: term().
stop(_) ->
    ok.
