-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add stubs for carrier modules (#6400)
- Loading branch information
1 parent
bd168f6
commit f1278c1
Showing
30 changed files
with
1,183 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
%%%----------------------------------------------------------------------------- | ||
%%% @copyright (C) 2015-2020, 2600Hz | ||
%%% @doc Handle client requests for phone number | ||
%%% @end | ||
%%%----------------------------------------------------------------------------- | ||
-module(knm_didww). | ||
-behaviour(knm_gen_carrier). | ||
|
||
-export([info/0]). | ||
-export([is_local/0]). | ||
-export([find_numbers/3]). | ||
-export([acquire_number/1]). | ||
-export([disconnect_number/1]). | ||
-export([is_number_billable/1]). | ||
-export([should_lookup_cnam/0]). | ||
-export([check_numbers/1]). | ||
|
||
-include("knm.hrl"). | ||
|
||
-define(KNM_CARRIER_NAME, "didww"). | ||
-define(KNM_CARRIER_CONFIG_CAT, <<(?KNM_CONFIG_CAT)/binary, ".", ?KNM_CARRIER_NAME>>). | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec info() -> map(). | ||
info() -> | ||
#{?CARRIER_INFO_MAX_PREFIX => 3 | ||
}. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Is this carrier handling numbers local to the system? | ||
%% | ||
%% <div class="notice">A non-local (foreign) carrier module makes HTTP requests.</div> | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec is_local() -> boolean(). | ||
is_local() -> 'false'. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Check with carrier if these numbers are registered with it. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec check_numbers(kz_term:ne_binaries()) -> {'ok', kz_json:object()} | | ||
{'error', 'not_implemented'}. | ||
check_numbers(_Numbers) -> {'error', 'not_implemented'}. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Query carrier for available numbers. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec find_numbers(kz_term:ne_binary(), pos_integer(), knm_carriers:options()) -> | ||
{'ok', knm_number:knm_numbers()}. | ||
find_numbers(_Prefix, _Quantity, _Options) -> | ||
{'ok', []}. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Acquire a given number from carrier. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec acquire_number(knm_number:knm_number()) -> no_return(). | ||
acquire_number(Number) -> | ||
knm_errors:by_carrier(?MODULE, 'not_implemented', Number). | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Return number back to carrier. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec disconnect_number(knm_number:knm_number()) -> | ||
no_return(). | ||
disconnect_number(Number) -> | ||
knm_errors:by_carrier(?MODULE, 'not_implemented', Number). | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec is_number_billable(knm_phone_number:knm_phone_number()) -> boolean(). | ||
is_number_billable(_Number) -> 'true'. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec should_lookup_cnam() -> boolean(). | ||
should_lookup_cnam() -> 'true'. | ||
|
||
%%%============================================================================= | ||
%%% Internal functions | ||
%%%============================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
%%%----------------------------------------------------------------------------- | ||
%%% @copyright (C) 2015-2020, 2600Hz | ||
%%% @doc Handle client requests for phone number | ||
%%% @end | ||
%%%----------------------------------------------------------------------------- | ||
-module(knm_flowroute). | ||
-behaviour(knm_gen_carrier). | ||
|
||
-export([info/0]). | ||
-export([is_local/0]). | ||
-export([find_numbers/3]). | ||
-export([acquire_number/1]). | ||
-export([disconnect_number/1]). | ||
-export([is_number_billable/1]). | ||
-export([should_lookup_cnam/0]). | ||
-export([check_numbers/1]). | ||
|
||
-include("knm.hrl"). | ||
|
||
-define(KNM_CARRIER_NAME, "flowroute"). | ||
-define(KNM_CARRIER_CONFIG_CAT, <<(?KNM_CONFIG_CAT)/binary, ".", ?KNM_CARRIER_NAME>>). | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec info() -> map(). | ||
info() -> | ||
#{?CARRIER_INFO_MAX_PREFIX => 3 | ||
}. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Is this carrier handling numbers local to the system? | ||
%% | ||
%% <div class="notice">A non-local (foreign) carrier module makes HTTP requests.</div> | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec is_local() -> boolean(). | ||
is_local() -> 'false'. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Check with carrier if these numbers are registered with it. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec check_numbers(kz_term:ne_binaries()) -> {'ok', kz_json:object()} | | ||
{'error', 'not_implemented'}. | ||
check_numbers(_Numbers) -> {'error', 'not_implemented'}. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Query carrier for available numbers. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec find_numbers(kz_term:ne_binary(), pos_integer(), knm_carriers:options()) -> | ||
{'ok', knm_number:knm_numbers()}. | ||
find_numbers(_Prefix, _Quantity, _Options) -> | ||
{'ok', []}. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Acquire a given number from carrier. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec acquire_number(knm_number:knm_number()) -> | ||
no_return(). | ||
acquire_number(Number) -> | ||
knm_errors:by_carrier(?MODULE, 'not_implemented', Number). | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc Return number back to carrier. | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec disconnect_number(knm_number:knm_number()) -> | ||
no_return(). | ||
disconnect_number(Number) -> | ||
knm_errors:by_carrier(?MODULE, 'not_implemented', Number). | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec is_number_billable(knm_phone_number:knm_phone_number()) -> boolean(). | ||
is_number_billable(_Number) -> 'true'. | ||
|
||
%%------------------------------------------------------------------------------ | ||
%% @doc | ||
%% @end | ||
%%------------------------------------------------------------------------------ | ||
-spec should_lookup_cnam() -> boolean(). | ||
should_lookup_cnam() -> 'true'. | ||
|
||
%%%============================================================================= | ||
%%% Internal functions | ||
%%%============================================================================= |
Oops, something went wrong.