forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Voxbone as a carrier module (2600hz#5884)
- iso3166 utilities for a2 to a3 conversion - auto generate knm_iso3166_util - Updated system configuration section `carrier_modules` example to include more thorough real world config block. - Add http_method type to enumerate supported HTTP methods by Voxbone API - Fixup spec on build_uri/2 - Fixed erroroneous binary creation in to_voxbone_pattern/1 - Add tickies to showEmpty value in required_params/0 - Fixed voxbone_request/3, voxbone_request/4 to use http_method in spec - Added addtional doc headers and reformatting - Added handler for HTTP 500 - Add knm_voxbone to number provider quantifiers - number release / disconnect implemented - fetch_did API request implemented - missing period in handle_error - added voxbone number find test fixtures - added inital voxbone test suite with number find - wrapped voxbone_request in preprocessor to wire up fixtures for test
- Loading branch information
1 parent
171efb6
commit abbffd8
Showing
26 changed files
with
2,866 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
applications/crossbar/priv/couchdb/schemas/system_config.number_manager.voxbone.json
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,33 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"_id": "system_config.number_manager.voxbone", | ||
"description": "Schema for number_manager.voxbone system_config", | ||
"properties": { | ||
"api_password": { | ||
"default": "", | ||
"description": "number_manager voxbone api_password", | ||
"type": "string" | ||
}, | ||
"api_username": { | ||
"default": "", | ||
"description": "number_manager voxbone api_username", | ||
"type": "string" | ||
}, | ||
"environment": { | ||
"default": "sandbox", | ||
"description": "number_manager voxbone environment", | ||
"enum": [ | ||
"sandbox", | ||
"production", | ||
"beta" | ||
], | ||
"type": "string" | ||
}, | ||
"max_page_size": { | ||
"default": 20, | ||
"description": "number_manager voxbone max_page_size", | ||
"type": "integer" | ||
} | ||
}, | ||
"type": "object" | ||
} |
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,85 @@ | ||
|
||
# knm_voxbone integration | ||
|
||
## Documentation | ||
* [voxbone Inventory API Reference](https://docs.voxbone.com/#/reference/inventory) | ||
* [voxbone Invetory Ordering API Reference](https://docs.voxbone.com/#/reference/ordering/get-update-or-delete-carts/list-number-inventory) | ||
|
||
## system_config | ||
#### Configuring number manager | ||
|
||
To enable kazoo number manager to use the voxbone module you will need to first update the `number_manager` document in the `system_config` database. | ||
|
||
In the configuration section that applies to your crossbar servers (or the default) add `"knm_voxbone"` to the `carrier_modules` parameter. | ||
|
||
For example: | ||
|
||
```json | ||
"carrier_modules": [ | ||
"knm_local", | ||
"knm_inventory", | ||
"knm_managed", | ||
"knm_reserved", | ||
"knm_reserved_reseller" | ||
"knm_voxbone" | ||
] | ||
``` | ||
|
||
The voxbone integration requires making multiple requests to the customer portal so you experience search timeouts you may want to tune the `number_search_timeout_ms` value in `number_manager` document as well. | ||
|
||
```json | ||
"number_search_timeout_ms": 10000, | ||
``` | ||
|
||
### Configuring the voxbone module | ||
```json | ||
{ | ||
"default": { | ||
"username": "{USERNAME}", | ||
"password": "{PASSWORD}", | ||
"api_key": "{API KEY}", | ||
"environment": "production | sandbox | beta", | ||
"page_size": 20 | ||
}, | ||
"pvt_type": "config", | ||
"pvt_account_id": "system_config", | ||
"pvt_account_db": "system_config" | ||
} | ||
``` | ||
|
||
## Integration | ||
### Environments | ||
|
||
#### Production | ||
Interacts with the production Voxbone platform. Uses Basic Authentication. | ||
|
||
#### Sandbox | ||
Intended for simulating ordering and address verification specifically. You can test ordering without being charged and the sandbox resets and resyncs to your production data each night. | ||
|
||
#### Beta(Coming Soon) | ||
Intended for new and upcoming functionality on Voxbone platform. APIs coming soon are : Emergency Service Activation, Number Porting, real-time CDRs. These endpoints use key based authentication. | ||
|
||
|
||
#### URIs | ||
|
||
BaseURL = https://{ENVIRONMENT_URI}/ws-voxbone/services/rest/ | ||
|
||
* Production - api.voxbone.com | ||
* Sandbox - sandbox.voxbone.com | ||
* Beta - beta.voxbone.com | ||
|
||
#### Sample Request | ||
|
||
```shell | ||
curl -u username:password -H "Content-type: application/json" -H "Accept: application/json" "https://api.voxbone.com/ws-voxbone/services/rest/inventory/country?countryCodeA3=BEL&pageNumber=0&pageSize=1" | ||
|
||
``` | ||
|
||
|
||
### Error Codes | ||
#### HTTP Error Codes | ||
|
||
voxbone rate limits to 20 req/s by IP Address and will return one of the following codes on limit: | ||
|
||
* 509 - Bandwidth Exceeded | ||
* 429 - Too Many Requests |
8 changes: 8 additions & 0 deletions
8
core/kazoo_number_manager/priv/fixtures/voxbone_account_balance.json
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,8 @@ | ||
{ | ||
"accountBalance": { | ||
"active": true, | ||
"balance": 500.0, | ||
"currency": "USD", | ||
"threshold": 100.0 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
core/kazoo_number_manager/priv/fixtures/voxbone_add_to_cart.json
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,3 @@ | ||
{ | ||
"status": "SUCCESS" | ||
} |
20 changes: 20 additions & 0 deletions
20
core/kazoo_number_manager/priv/fixtures/voxbone_cart_detail.json
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,20 @@ | ||
{ | ||
"carts": [ | ||
{ | ||
"cartIdentifier": 3312757, | ||
"customerReference": "{ACCOUNT-ID}", | ||
"dateAdded": "2019-07-22 17:16:37", | ||
"description": "DID Order", | ||
"orderProducts": [ | ||
{ | ||
"didgroupId": 1196, | ||
"orderProductId": 4410885, | ||
"productDescription": "[UNITED STATES] BIRMINGHAM (205)", | ||
"productType": "DID", | ||
"quantity": 15 | ||
} | ||
] | ||
} | ||
], | ||
"resultCount": 1 | ||
} |
11 changes: 11 additions & 0 deletions
11
core/kazoo_number_manager/priv/fixtures/voxbone_checkout.json
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,11 @@ | ||
{ | ||
"productCheckoutList": [ | ||
{ | ||
"message": null, | ||
"orderReference": "50898DS3919643", | ||
"productType": "DID", | ||
"status": "SUCCESS" | ||
} | ||
], | ||
"status": "SUCCESS" | ||
} |
3 changes: 3 additions & 0 deletions
3
core/kazoo_number_manager/priv/fixtures/voxbone_delete_cart.json
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,3 @@ | ||
{ | ||
"status": "SUCCESS" | ||
} |
3 changes: 3 additions & 0 deletions
3
core/kazoo_number_manager/priv/fixtures/voxbone_disconnect.json
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,3 @@ | ||
{ | ||
"numberCancelled": 1 | ||
} |
Oops, something went wrong.