Skip to content

Commit

Permalink
HELP-43766: added opt-in setting to permit custom callflow in cf_dyna…
Browse files Browse the repository at this point in the history
…mic_cid (2600hz#5727)

update docs, fix description

fixed invalid thing in swagger
  • Loading branch information
swysor authored and jamesaimonetti committed Apr 26, 2019
1 parent 169d95c commit 4b93468
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applications/callflow/doc/dynamic_cid.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Key | Description | Type | Default | Required
`caller_id.name` | caller id name for `static` action | `string` | | `false`
`caller_id.number` | caller id number for `static` action | `string` | | `false`
`enforce_call_restriction` | in `list` and `lists` action mode, should call be restricted by number classification | `boolean` | `true` | `false`
`permit_custom_callflow` | Permit a custom callflow to be accepted instead of restricting to no_match only when looking up callflows | `boolean()` | `false` | `false` |
`id` | The id of document in database that holds the new Caller ID when action is set to `list` or `lists` | `string` | | `false`
`interdigit_timeout` | The amount of time (in milliseconds) to wait for the caller to press the next digit after pressing a digit | `integer` | 2000 | `false`
`max_digits` | maximum digits length to collect for `manual` action | `integer` | 10 | `false`
Expand Down Expand Up @@ -134,3 +135,7 @@ In this method the new Caller ID number and name would be set to `caller_id` val
"module": "dynamic_cid"
}
```

## Permit Custom Callflow

The config parameter `permit_custom_callflow` is used in the `lists` action type case. When attempting to fetch the callflow, the default behavior is to reject any callflow returned which is not the `no_match` callflow. If a callflow is defined which matches the resultant destination number, this setting allows that callflow to be used, bypassing the `no_match` restriction.
1 change: 1 addition & 0 deletions applications/callflow/doc/ref/dynamic_cid.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Key | Description | Type | Default | Required | Support Level
`max_digits` | Max number of digits allowed when collecting Caller ID Number | `integer()` | | `false` |
`media_id` | Prompt to play to caller to enter Caller ID Number | `string()` | | `false` |
`min_digits` | Minimum number of digits that must match the regex to collected DTMF | `integer()` | | `false` |
`permit_custom_callflow` | Permit a custom callflow to be accepted instead of restricting to no_match only when looking up callflows | `boolean()` | `false` | `false` |
`skip_module` | When set to true this callflow action is skipped, advancing to the wildcard branch (if any) | `boolean()` | | `false` |
`whitelist_regex` | Regex to match collected Caller ID Number | `string()` | | `false` |

Expand Down
12 changes: 12 additions & 0 deletions applications/callflow/src/module/cf_dynamic_cid.erl
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ maybe_route_to_callflow(_, Call, _, <<"static">>) ->
maybe_route_to_callflow(_, Call, 'undefined', <<"lists">>) ->
cf_exe:continue(Call);
maybe_route_to_callflow(Data, Call, Number, <<"lists">>) ->
PermitCustomCallflow = permit_custom_callflow(Data),
case cf_flow:lookup(Number, kapps_call:account_id(Call)) of
{'ok', Flow, 'false'} when PermitCustomCallflow ->
maybe_restrict_call(Data, Call, Number, Flow);
{'ok', Flow, 'true'} ->
maybe_restrict_call(Data, Call, Number, Flow);
_ ->
Expand All @@ -212,6 +215,15 @@ maybe_route_to_callflow(Data, Call, Number, <<"lists">>) ->
cf_exe:stop(Call)
end.


%%------------------------------------------------------------------------------
%% @doc
%% @end
%%------------------------------------------------------------------------------
-spec permit_custom_callflow(kz_json:object()) -> boolean().
permit_custom_callflow(Data) ->
kz_json:is_true(<<"permit_custom_callflow">>, Data, 'false').

%%------------------------------------------------------------------------------
%% @doc
%% @end
Expand Down
5 changes: 5 additions & 0 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,11 @@
"description": "Minimum number of digits that must match the regex to collected DTMF",
"type": "integer"
},
"permit_custom_callflow": {
"default": false,
"description": "Permit a custom callflow to be accepted instead of restricting to no_match only when looking up callflows",
"type": "boolean"
},
"skip_module": {
"description": "When set to true this callflow action is skipped, advancing to the wildcard branch (if any)",
"type": "boolean"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
"description": "Minimum number of digits that must match the regex to collected DTMF",
"type": "integer"
},
"permit_custom_callflow": {
"default": false,
"description": "Permit a custom callflow to be accepted instead of restricting to no_match only when looking up callflows",
"type": "boolean"
},
"skip_module": {
"description": "When set to true this callflow action is skipped, advancing to the wildcard branch (if any)",
"type": "boolean"
Expand Down

0 comments on commit 4b93468

Please sign in to comment.