This chapter provides a description of the database schema and instructions for provisioning the CC databases through both the web UI and the API.
The CSV files to be imported for any administrator account should have the following format:
Column |
Value |
|---|---|
1 |
Username |
2 |
Role ID |
3 |
First Name |
4 |
Last Name |
5 |
|
6 |
Permissions |
A unique string that is the username for this user. Limit 64 characters.
The {role_id} defines the type of administrator that is being created. The following can be used as {role_id}:
platform_owner
service_provider:<service_provider_name>
A string that is the first name of this user. Limit 250 characters.
A string that is the last name of this user. Limit 250 characters.
A string that is the email address for this user. Limit 250 characters.
An array of permission groups that this user is a member of. Permissions are dependent on the {role_id} of the created administrator.
The CSV files to be imported for Service Providers should have the following format:
Column |
Value |
|---|---|
1 |
Name |
2 |
Display Name |
3 |
First Name |
4 |
Last Name |
5 |
|
6 |
Address |
7 |
Phone |
8 |
Notes |
A unique string that is the name of this Service Provider. Limit 64 characters.
An unconstrained string used as a display name. Limit 250 characters.
A string that is the first name of a contact for this Service Provider. Limit 250 characters.
A string that is the last name of a contact for this Service Provider. Limit 250 characters.
A string that is the email address of this Service Provider. Limit 250 characters.
A string that is the physical address of this Service Provider. Use | to represent line breaks. Limit 250 characters.
A string that is the phone number, excluding hyphens and parentheses, of this Service Provider. Limit 250 characters.
A string that is a free-form notes field. Limit 2048 characters.
The CSV files to be imported for lots should have the following format:
Column |
Description |
|---|---|
1 |
Number |
2 |
PIN |
3 |
Initial Balance |
4 |
Current Balance |
5 |
Status |
6 |
Activation Date |
7 |
Default Expiration Type |
8 |
Expiration Date |
9 |
First Use Expiration Duration |
10 |
First Use Activation Type |
11 |
One Step Numbers |
12 |
Phone Me Numbers |
13 |
Speed Dial Numbers |
14 |
Constraint Overrides |
15 |
First Name |
16 |
Last Name |
17 |
|
18 |
Product Offering Name |
19 |
Product Offering Service Provider Name |
20 |
Service Provider Name |
An 8 to 14-digit string of integers that represents the number printed on the card.
A unique string of integers that indicates the personal identification number used to access this account.
A 3 to 8-digit string of integers, with a decimal point before final two digits, indicating the initial balance of funds on this account.
A 3 to 8-digit string of integers, with a decimal point before final two digits, indicating the current balance of funds on this account.
The status of this account. Accepted values are activated, blocked, empty, expired, generated, or uploaded.
The date and time this account was activated.
The type of expiration for this account. Accepted values are No_Expiration, Fixed_Expiration, or Days_From_First_Use.
The date and time this account expires when the expiration type is Fixed_Expiration.
Identifys the duration, in days or years, that the account will expire after the specified type of first use.
The type of use that will cause account expiration when the expiration type is Days From First Use. Accepted values are FIRST_USE_IVR or FIRST_BILLED_CALL.
A list of valid phone numbers separated by commas.
A list of valid phone numbers separated by commas.
An array of speed dial numbers followed by valid phone numbers.
Set of instructions that block or require the call destination constraint value in regex format.
A string that is the first name of a contact for this account. Limit 250 characters.
A string that is the last name of a contact for this account. Limit 250 characters.
A string that is the email address of this account. Limit 250 characters.
A string indicating the name of the product offering associated with this account.
A unique string that is the name of the Service Provider who owns the product offering associated with this account. Must match an existing Service Provider.
A unique string that is the name of the Service Provider who uses this account. Must match an existing Service Provider.
The CSV files to be imported for rates should have the following format:
Column |
Value |
|---|---|
1 |
Service Provider Name |
2 |
Display Name |
3 |
Name |
4 |
Description |
5 |
Type |
6 |
Effective Date |
7 |
End Date |
8 |
Charge Method |
9 |
Amount |
10 |
Surcharge |
11 |
If No Sub Rates Exist |
12 |
Child Rates |
The CSV files to be imported for rate plans should have the following format:
Column |
Value |
|---|---|
1 |
Display Name |
2 |
Name |
3 |
Description |
4 |
Modifier Schedule |
5 |
Rates |
6 |
Service Provider Name |
The CSV files to be imported for calling services should have the following format:
Column |
Value |
|---|---|
1 |
Name |
2 |
Display Name |
3 |
Description |
4 |
Rate Plans |
5 |
Minimum Billing |
6 |
Default Rounding Interval |
7 |
Rounding Threshold |
8 |
Call Markup |
9 |
Service Provider Name |
10 |
Promotion Active |
11 |
Promotion Duration |
12 |
Promotion Start |
13 |
Promotion End |
14 |
Promotion Discount |
The CSV files to be imported for product offerings should have the following format:
Column |
Value |
|---|---|
1 |
Name |
2 |
Display Name |
3 |
Description |
4 |
Type |
5 |
Default Expiration Type |
6 |
Default Expiration Date |
7 |
First Use Expiration Duration |
8 |
First Use Activation Type |
9 |
Access Numbers |
10 |
Maximum Call Duration |
11 |
Limit Simultaneous Calls |
12 |
Maximum Simultaneous Calls |
13 |
Allow One Step List |
14 |
Maximum One Step Numbers |
15 |
Allow Speed Dial List |
16 |
Allow Phone Me List |
17 |
Maximum Phone Me Numbers |
18 |
Carrier Selection |
19 |
Nature of Carrier |
20 |
Carrier Digits |
21 |
Minimum Balance |
22 |
Maximum Balance |
23 |
Allow Balance Transfer |
24 |
Disable Account After Transfer |
25 |
Sweep Balance |
26 |
Constraints |
27 |
Calling Services |
28 |
Service Provider Name |
A CSV file can be used to import large amounts of information into a database. Importing data appends the new information to the existing database, and any conflicting records are not overwritten. Each table has at least one unique column that is used to determine if there are conflicting records. Any database entries that are not in the CSV file remain unchanged in the database after the file has been imported.
Note
All columns must be included. If the field is blank, make sure that the column is still included in the CSV file.
Note
When importing CSV files into CC, do not log off until the import is complete. Logging off before the import is complete will cause the entire import of data to fail.
Import Using the Web UI
Whether the database operation to import records from a file is available depends on which page is currently displayed.
Click Import on the task bar.
Click Choose File to browse for a CSV file to import.
Click Start Import.
The file is uploaded and the import begins and runs in the background.
Note
Click Cancel at any time to close the window and stop the import.
The status of an import can be found on the My Account page under Job Logs.
Import Using the API
To import data with the API, the user sends a POST command to the specific object.
The example below shows a Service Provider importing a Subscriber.
curl -X POST \
-H "Content-Type:cc/json" localhost/cc/api/job/service_provider:cc_service_provider?executable=restworkx-cc \
-H "Authorization:Basic <secure-access-token>" \
-d '{"job_type":"import","in_file":"/var/opt/xpressworkx/app-manager/cc/media/upload/subscriber-import.csv","object":"subscriber","service_provider_name":"cc_service_provider"}'
Which would return a message such as:
"meta": {
"executable": "restworkx-cc",
"code": 200,
"encoding": "ascii",
"scope": "success",
"records_shown": 1,
"message": "",
"authorization": "Basic <secure-access-token>"
},
"data": [{
"scope": "job",
"meta": {
"modified_by": "system",
"txnid": null,
"modified": "2022-04-07 11:39:44.724128",
"created_by": "system",
"created": "2022-04-07 11:39:44.724102"
},
"links": {
"self": {
"scope": "job",
"identifier": {
"job_id": 104,
"out_file": "/var/opt/xpressworkx/app-manager/cc/media/download/subscriber-import-2022-04-07-23770cb05d.csv"
},
"uri": "/job"
},
},
"attributes": {
"status": "processing",
"out_file": "/var/opt/xpressworkx/app-manager/cc/media/download/subscriber-import-2022-04-07-23770cb05d.csv",
"pid": null,
"object": "subscriber",
"job_type": "import",
"job_id": 104,
"elapsed": "0",
"in_file": "/var/opt/xpressworkx/app-manager/cc/media/upload/subscriber-import.csv",
"kwargs": null,
"progress": null,
"role_id": "service_provider:cc_service_provider",
"output_hash": null
},
}],
"jsonapi": {
"version": "2.2-17",
"name": "Calling Card",
"short_name": "cc",
"author": "IMSWorkX, Inc."
}
Note
The parameter executable=restworkx-cc is required to import an object.
Information can be exported from the database, saved, and then imported to restore a database.
Export Using the Web UI
Whether the database operation to export records to a file is available depends on which page is currently displayed.
Click Export on the task bar.
Click Start Export.
The output CSV file can be found on the My Account page under Job Logs.
Export Using the API
To export data with the API, the user sends a POST command to the specific object.
The example below shows a Platform Owner exporting Service Providers.
curl -X POST \
-H "Content-Type:cc/json" localhost/cc/api/job/platform_owner?executable=restworkx-cc \
-H "Authorization:Basic <secure-access-token>" \
-d '{"job_type": "export","object": "service_provider"}'
Which would return a message such as:
"meta": {
"executable": "restworkx-cc",
"code": 200,
"encoding": "ascii",
"scope": "success",
"records_shown": 1,
"message": "",
"authorization": "Basic <secure-access-token>"
},
"data": [{
"scope": "job",
"meta": {
"modified_by": "system",
"txnid": null,
"modified": "2022-04-07 13:50:20.834266",
"created_by": "system",
"created": "2022-04-07 13:50:20.834246"
},
"links": {
"self": {
"scope": "job",
"identifier": {
"job_id": 109,
"out_file": "/var/opt/xpressworkx/app-manager/cc/media/download/service_provider-export-2022-04-07-e996a4f9dc.csv"
},
"uri": "/job"
},
},
"attributes": {
"status": "processing",
"out_file": "/var/opt/xpressworkx/app-manager/cc/media/download/service_provider-export-2022-04-07-e996a4f9dc.csv",
"pid": null,
"object": "service_provider",
"job_type": "export",
"job_id": 109,
"elapsed": "0",
"in_file": null,
"kwargs": null,
"progress": null,
"role_id": "platform_owner",
"output_hash": null
},
}],
"jsonapi": {
"version": "2.2-17",
"name": "Calling Card",
"short_name": "cc",
"author": "IMSWorkX, Inc."
}
Note
The parameter executable=restworkx-cc is required to export an object.
CC does not have an explicit delete function for any of its data. Instead, CC has the ability to archive data that is not in use.
Archived data remains in the CC application, but this data is not used when routing calls. Archived data can then be returned to the live data by restoring or can be removed completely by purging. When viewing data through the web UI or with an API request, the user can switch between the live and archived database to see all data.
Note
By default, CC permanently purges archived data after seven days. This can be changed by a Platform Owner in Settings.
Data that is not currently in use by the CC application can be removed from the live database by archiving the data. Provisioned data can be archived in the web UI or through the API.
Archive a Single Object Using the Web UI
Navigate to the object that you want to archive.
Right-click on the object to be archived.
Click Archive.
The object will be moved to the archive database.
Archive Multiple Objects Using the Web UI
Navigate to the objects that you want to archive.
Select the objects by clicking on the first object then:
Hold the Shift key and click another object to select everything between and including the two selected objects.
Hold the Ctrl key and click the other objects you want.
Click Archive Selected on the bottom of the page.
The objects will be moved to the archive database.
Archive Using the API
To archive an object with the API, the user sends a DELETE command to the specific object.
The example below shows a user archiving a Subscriber object called new_subscriber.
curl -X DELETE \
-H "Authorization:Basic <secure-access-token>" \
-d 'localhost/cc/api/subscriber/service_test/new_subscriber'
Which would return a message such as:
"meta": {
"encoding": "ascii",
"records_shown": 0,
"message": "Record successfully archived or restored.",
"code": "205",
"scope": "success"
},
"data": [],
"jsonapi": {
"version": "2.2-17",
"name": "Calling Card",
"short_name": "cc",
"author": "IMSWorkX, Inc."
}
Restoring data will move data from the archive database to the live database. Restoring data can be done through the web UI or the API.
Restore a Single Object Using the Web UI
Switch to the archive view by toggling Live / Archive Database in the task bar.
Navigate to the object that you want to restore.
Right-click on the object to be restored.
Click Restore.
The object will be moved to the live database.
Restore Multiple Objects Using the Web UI
Switch to the archive view by toggling Live / Archive Database in the task bar.
Navigate to the objects that you want to restore.
Select the objects by clicking on the first object then:
Hold the Shift key and click another object to select everything between and including the two selected objects.
Hold the Ctrl key and click the other objects you want.
Click Restore Selected on the bottom of the page.
The objects will be moved to the live database.
Restore Using the API
To restore an object with the API, the user sends a DELETE command to the specific object.
The example below shows a user restoring a Subscriber object called new_subscriber.
curl -X DELETE \
-H "Authorization:Basic <secure-access-token>" \
-d 'localhost/cc/api/subscriber/service_test/new_subscriber?archive=true&restore=true'
Which would return a message such as:
"meta": {
"encoding": "ascii",
"records_shown": 0,
"message": "Record successfully archived or restored.",
"code": "205",
"scope": "success"
},
"data": [],
"jsonapi": {
"version": "2.2-14",
"name": "Calling Card",
"short_name": "cc",
"author": "IMSWorkX, Inc."
}
Note
The parameters archive=true&restore=true are required to restore an object.
Purging data permanently removes the data from the archived database. Purging data can be done through the API, web UI, or the Maximum Inactive Days for Records setting in the web UI.
Warning
Once data has been purged from the database, it cannot be restored.
Purge a Single Object Using the Web UI
Switch to the archive view by toggling Live / Archive Database in the task bar.
Navigate to the object that you want to purge.
Right-click on the object to be purged.
Click Purge.
The object will be permanently removed from the database.
Purge Multiple Objects Using the Web UI
Switch to the archive view by toggling Live / Archive Database in the task bar.
Navigate to the objects that you want to purge.
Select the objects by clicking on the first object then:
Hold the Shift key and click another object to select everything between and including the two selected objects.
Hold the Ctrl key and click the other objects you want.
Click Purge Selected on the bottom of the page.
The objects will be permanently removed from the database.
Purge Using the Maximum Inactive Days Setting
CC will remove records that have been archived longer than the value specified by this setting every night at midnight, which is determined by the time on the active NIU. A value of zero will always keep archived records in the database.
This setting can be found in the Settings page when the user is logged in as a Platform Owner.
Purge Using the API
To purge an object with the API, the user sends a DELETE command to the specific object.
The example below shows a user purging a Subscriber object called new_subscriber.
curl -X DELETE \
-H "Authorization:Basic <secure-access-token>" \
-d 'localhost/cc/api/subscriber/service_test/new_subscriber?archive=true'
Which would return a message such as:
"meta": {
"encoding": "ascii",
"records_shown": 0,
"message": "Record successfully archived or restored.",
"code": "205",
"scope": "success"
},
"data": [],
"jsonapi": {
"version": "2.2-14",
"name": "Calling Card",
"short_name": "cc",
"author": "IMSWorkX, Inc."
}
Note
The parameter archive=true is required to purge an object.