Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.3] Add missing fields from resources schema #6444

Merged
merged 2 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions applications/callflow/src/cf_exe.erl
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@ handle_cast({'gen_listener', {'is_consuming', 'true'}}
) ->
lager:debug("ready to recv events, launching the callflow"),
{'noreply', launch_cf_module(State#state{status = 'running'})};
handle_cast({'gen_listener', {'is_consuming', 'true'}}, State) ->
lager:info("consuming AMQP events"),
{'noreply', State};
handle_cast({'gen_listener', {'is_consuming', 'false'}}, State) ->
lager:info("no longer consuming AMQP events"),
{'noreply', State};
handle_cast(_Msg, State) ->
lager:debug("unhandled cast: ~p", [_Msg]),
{'noreply', State}.
Expand Down
12 changes: 12 additions & 0 deletions applications/crossbar/doc/ref/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ Schema for resources

Key | Description | Type | Default | Required | Support Level
--- | ----------- | ---- | ------- | -------- | -------------
`caller_id_options.type` | Caller ID type to choose | `string('internal' | 'external' | 'emergency')` | | `false` |
`caller_id_options` | Caller ID options | `object()` | | `false` |
`cid_rules.[]` | | `string()` | | `false` |
`cid_rules` | Regexps to match against caller ID | `array(string())` | | `false` |
`classifiers.emergency` | Determines if the resource represents emergency services | `boolean()` | `false` | `false` |
`classifiers.enabled` | Determines if the resource is currently enabled | `boolean()` | `true` | `false` |
`classifiers.prefix` | A string to prepend to the dialed number or capture group of the matching rule | `string(0..64)` | | `false` |
`classifiers.regex` | regexp to match against dialed number | `string()` | | `false` |
`classifiers.suffix` | A string to append to the dialed number or capture group of the matching rule | `string(0..64)` | | `false` |
`classifiers.weight_cost` | A value between 0 and 100 that determines the order of resources when multiple can be used | `integer()` | `50` | `false` |
`classifiers` | Resource classifiers to use as rules when matching against dialed numbers | `object()` | | `false` |
`emergency` | Determines if the resource represents emergency services | `boolean()` | `false` | `false` |
`enabled` | Determines if the resource is currently enabled | `boolean()` | `true` | `false` |
`flags.[]` | | `string()` | | `false` |
Expand All @@ -18,6 +29,7 @@ Key | Description | Type | Default | Required | Support Level
`flat_rate_whitelist` | Regex for determining if the number is eligible for flat-rate trunking | `string()` | | `false` |
`format_from_uri` | When set to true requests to this resource will have a reformatted SIP From Header | `boolean()` | | `false` |
`formatters` | Schema for request formatters | `object()` | | `false` |
`from_account_realm` | When formatting SIP From on outbound requests, use the calling account's SIP realm | `boolean()` | `false` | `false` |
`from_uri_realm` | When formatting SIP From on outbound requests this can be used to override the realm | `string()` | | `false` |
`gateway_strategy` | The strategy of choosing gateways from list: sequential or random | `string('sequential' | 'random')` | | `false` |
`gateways.[].bypass_media` | The resource gateway bypass media mode | `boolean()` | | `false` |
Expand Down
12 changes: 12 additions & 0 deletions applications/crossbar/doc/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ Schema for resources

Key | Description | Type | Default | Required | Support Level
--- | ----------- | ---- | ------- | -------- | -------------
`caller_id_options.type` | Caller ID type to choose | `string('internal' | 'external' | 'emergency')` | | `false` |
`caller_id_options` | Caller ID options | `object()` | | `false` |
`cid_rules.[]` | | `string()` | | `false` |
`cid_rules` | Regexps to match against caller ID | `array(string())` | | `false` |
`classifiers.emergency` | Determines if the resource represents emergency services | `boolean()` | `false` | `false` |
`classifiers.enabled` | Determines if the resource is currently enabled | `boolean()` | `true` | `false` |
`classifiers.prefix` | A string to prepend to the dialed number or capture group of the matching rule | `string(0..64)` | | `false` |
`classifiers.regex` | regexp to match against dialed number | `string()` | | `false` |
`classifiers.suffix` | A string to append to the dialed number or capture group of the matching rule | `string(0..64)` | | `false` |
`classifiers.weight_cost` | A value between 0 and 100 that determines the order of resources when multiple can be used | `integer()` | `50` | `false` |
`classifiers` | Resource classifiers to use as rules when matching against dialed numbers | `object()` | | `false` |
`emergency` | Determines if the resource represents emergency services | `boolean()` | `false` | `false` |
`enabled` | Determines if the resource is currently enabled | `boolean()` | `true` | `false` |
`flags.[]` | | `string()` | | `false` |
Expand All @@ -36,6 +47,7 @@ Key | Description | Type | Default | Required | Support Level
`flat_rate_whitelist` | Regex for determining if the number is eligible for flat-rate trunking | `string()` | | `false` |
`format_from_uri` | When set to true requests to this resource will have a reformatted SIP From Header | `boolean()` | | `false` |
`formatters` | Schema for request formatters | `object()` | | `false` |
`from_account_realm` | When formatting SIP From on outbound requests, use the calling account's SIP realm | `boolean()` | `false` | `false` |
`from_uri_realm` | When formatting SIP From on outbound requests this can be used to override the realm | `string()` | | `false` |
`gateway_strategy` | The strategy of choosing gateways from list: sequential or random | `string('sequential' | 'random')` | | `false` |
`gateways.[].bypass_media` | The resource gateway bypass media mode | `boolean()` | | `false` |
Expand Down
65 changes: 65 additions & 0 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -27879,6 +27879,66 @@
"resources": {
"description": "Schema for resources",
"properties": {
"caller_id_options": {
"description": "Caller ID options",
"properties": {
"type": {
"description": "Caller ID type to choose",
"enum": [
"internal",
"external",
"emergency"
],
"type": "string"
}
},
"type": "object"
},
"cid_rules": {
"description": "Regexps to match against caller ID",
"items": {
"description": "Regexp to match against caller ID",
"type": "string"
},
"type": "array"
},
"classifiers": {
"description": "Resource classifiers to use as rules when matching against dialed numbers",
"properties": {
"emergency": {
"default": false,
"description": "Determines if the resource represents emergency services",
"type": "boolean"
},
"enabled": {
"default": true,
"description": "Determines if the resource is currently enabled",
"type": "boolean"
},
"prefix": {
"description": "A string to prepend to the dialed number or capture group of the matching rule",
"maxLength": 64,
"type": "string"
},
"regex": {
"description": "regexp to match against dialed number",
"type": "string"
},
"suffix": {
"description": "A string to append to the dialed number or capture group of the matching rule",
"maxLength": 64,
"type": "string"
},
"weight_cost": {
"default": 50,
"description": "A value between 0 and 100 that determines the order of resources when multiple can be used",
"maximum": 100,
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"emergency": {
"default": false,
"description": "Determines if the resource represents emergency services",
Expand Down Expand Up @@ -27913,6 +27973,11 @@
"$ref": "#/definitions/formatters",
"type": "object"
},
"from_account_realm": {
"default": false,
"description": "When formatting SIP From on outbound requests, use the calling account's SIP realm",
"type": "boolean"
},
"from_uri_realm": {
"description": "When formatting SIP From on outbound requests this can be used to override the realm",
"type": "string"
Expand Down
65 changes: 65 additions & 0 deletions applications/crossbar/priv/couchdb/schemas/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,66 @@
"_id": "resources",
"description": "Schema for resources",
"properties": {
"caller_id_options": {
"description": "Caller ID options",
"properties": {
"type": {
"description": "Caller ID type to choose",
"enum": [
"internal",
"external",
"emergency"
],
"type": "string"
}
},
"type": "object"
},
"cid_rules": {
"description": "Regexps to match against caller ID",
"items": {
"description": "Regexp to match against caller ID",
"type": "string"
},
"type": "array"
},
"classifiers": {
"description": "Resource classifiers to use as rules when matching against dialed numbers",
"properties": {
"emergency": {
"default": false,
"description": "Determines if the resource represents emergency services",
"type": "boolean"
},
"enabled": {
"default": true,
"description": "Determines if the resource is currently enabled",
"type": "boolean"
},
"prefix": {
"description": "A string to prepend to the dialed number or capture group of the matching rule",
"maxLength": 64,
"type": "string"
},
"regex": {
"description": "regexp to match against dialed number",
"type": "string"
},
"suffix": {
"description": "A string to append to the dialed number or capture group of the matching rule",
"maxLength": 64,
"type": "string"
},
"weight_cost": {
"default": 50,
"description": "A value between 0 and 100 that determines the order of resources when multiple can be used",
"maximum": 100,
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"emergency": {
"default": false,
"description": "Determines if the resource represents emergency services",
Expand Down Expand Up @@ -37,6 +97,11 @@
"$ref": "formatters",
"type": "object"
},
"from_account_realm": {
"default": false,
"description": "When formatting SIP From on outbound requests, use the calling account's SIP realm",
"type": "boolean"
},
"from_uri_realm": {
"description": "When formatting SIP From on outbound requests this can be used to override the realm",
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions applications/jonny5/src/j5_flat_rate.erl
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ maybe_get_resource_flat_rate(Request, 'true') ->
ResourceId = j5_request:resource_id(Request),
case kz_datamgr:open_cache_doc(?KZ_OFFNET_DB, ResourceId) of
{'ok', JObj} ->
{kzd_resource:flat_rate_whitelist(JObj, ?WHITELIST)
,kzd_resource:flat_rate_blacklist(JObj, ?BLACKLIST)
{kzd_resources:flat_rate_whitelist(JObj, ?WHITELIST)
,kzd_resources:flat_rate_blacklist(JObj, ?BLACKLIST)
};
{'error', _E} ->
{?WHITELIST, ?BLACKLIST}
Expand Down
Loading