api:tce:create
Table of Contents
API : TCE box Create
Introduction
This request will create a new TCE box.
Request
| URL | https://api.telecomx.dk/tce | ||
|---|---|---|---|
| Method | POST | ||
| Access level | MANAGER, OWNER, RESELLER or ADMIN | ||
| Body | _id | String | MAC address of the TCE box. |
| ipMode | String | IP mode: DHCP (IP address is assigned by DHCP server - default) or MANUEL (specified). | |
| ipAddress | String | IP address (if ipMode is MANUEL). | |
| ipSubnet | String | IP Subnet IP subnet mask (if ipMode is MANUEL). | |
| ipGateway | String | IP default gateway address (if ipMode is MANUEL). | |
| ipDns | String | IP address of DNS server (id ipMode is MANUEL). | |
| pbxIp | String | IP address of PBX. | |
| pbxUsername | String | Username for PBX. | |
| pbxPassword | String | Password for PBX. | |
| rma | Boolean | True if box is defective and an RMA case has been opened (ADMIN only). | |
| tunnel | Number | Management tunnel port (ADMIN only). | |
| debug | Boolean | True to enable debug logging from Call Enhancer and PC clients. | |
| conflictDetection | Boolean | True to enable conflict resolution when multiple calls from same number entered different digits. | |
| apps | Array | Array of apps - see definition below. | |
| apps[x]._id | Id | Unique ID of the app. | |
| apps[x].type | String | Type of app: CPR - Entry of digits for use by PC client. N2N - Number to number conversion (e.g. zip to extension). A2N - Maps callers number to a number (extension). URL - Send callers number to a URL and get the extension to transfer to back. |
|
| apps[x].inboundNumber | String | Extension number to dial to call into this app. | |
| apps[x].returnNumber | String | Extension number to redirect back to when done (CPR only). | |
| apps[x].errorNumber | String | Extension number to redirect back to on error/missing input. | |
| apps[x].initialDelay | Number | Number of seconds to wait after receiving call, before playing beep and receiving digits. Default 1 second, increase for PBX'es that needs more time to setup audio e.g. due to re-invites. | |
| apps[x].timeout | Number | Number of seconds to wait for entry of CPR or number before transferring to errorNumber, default 15 (CPR, N2N only). | |
| cprLength | Number | Number of digits to be entered, 0-25. If 0 then no entry is required, instead callers a-number is auto-entered (CPR only). | |
| apps[x].n2nLength | Number | Number of digits to be entered (N2N only). | |
| apps[x].n2nTable | Array | Array of number to number conversions (N2N only). | |
| apps[x].n2nTable[x].from | String | Number to convert… (N2N only). | |
| apps[x].n2nTable[x].to | String | Number/extension to convert to (N2N only). | |
| apps[x].a2nTable | Array | Array of A-number to number conversions (A2N only). | |
| apps[x].a2nTable[x].from | String | A-Number to convert… (A2N only). | |
| apps[x].a2nTable[x].to | String | Number/extension to convert to (A2N only). | |
| apps[x].url | String | URL to call to retreive the number/extension to transfer the caller to. Inject the callers phone number as '{NUMBER}' into the URL. | |
Query examples
{
_id: '123456789012',
ipMode: 'DHCP',
pbxIp: '192.168.2.20',
pbxUsername: 'wehou1hw8fnjcks',
pbxPassword: 'e83ufu48vj29vjd',
debug: false,
conflictDetection: true,
apps: [
{
_id: '12345678901234567890ABCD',
type: 'CPR',
inboundNumber: '200',
returnNumber: '201',
errorNumber: '202',
initialDelay: 1,
timeout: 15,
cprLength: 10
},
{
_id: '12345678901234567890ABCE',
type: 'N2N',
inboundNumber: '210',
errorNumber: '211',
initialDelay: 1,
timeout: 15,
n2nLength: 4,
n2nTable: [
{ from: '1000-1999', to: '250' },
{ from: '2000', to: '251' },
{ from: '2300', to: '252' }
]
},
{
_id: '12345678901234687890ABCF',
type: 'A2N',
inboundNumber: '220',
errorNumber: '221',
a2nTable: [
{ from: '70305050', '843' },
{ from: '81808888', '742' }
]
},
{
_id: '12345678901234567890ABC0',
type: 'URL',
inboundNumber: '230',
errorNumber: '231',
url: 'http://myserver.domain.com?username=donald&password=duck&number={NUMBER}'
]
}
Response
The created TCE box.
| JSON object | ||
|---|---|---|
| _id | String | MAC address of the TCE box. |
| publicIp | String | Public IP address the box is located at, as reported by the box. |
| lastSeen | Date | Time and date when the TCE box was last seen. |
| ipMode | String | IP mode: DHCP (IP address is assigned by DHCP server - default) or MANUEL (specified). |
| ipAddress | String | Local IP address the box is assigned. |
| ipSubnet | String | IP Subnet IP subnet mask (if ipMode is MANUEL). |
| ipGateway | String | IP default gateway address (if ipMode is MANUEL). |
| ipDns | String | IP address of DNS server (id ipMode is MANUEL). |
| pbxIp | String | IP address of PBX. |
| pbxUsername | String | Username for PBX. |
| pbxPassword | String | Password for PBX. |
| rma | Boolean | True if box is defective and an RMA case has been opened. |
| tunnel | Number | Management tunnel port. |
| debug | Boolean | True to enable debug logging from Call Enhancer and PC clients. |
| conflictDetection | Boolean | True to enable conflict resolution when multiple calls from same number entered different digits. |
| apps | Array | Array of apps - see definition below. |
| TCE box app object (JSON) | ||
|---|---|---|
| _id | Id | Unique ID of the app. |
| type | String | Type of app: CPR - Entry of digits for use by PC client. N2N - Number to number conversion (e.g. zip to extension). A2N - Maps callers number to a number (extension). URL - Send callers number to a URL and get the extension to transfer to back. |
| inboundNumber | String | Extension number to dial to call into this app. |
| returnNumber | String | Extension number to redirect back to when done (CPR only). |
| errorNumber | String | Extension number to redirect back to on error/missing input. |
| initialDelay | Number | Number of seconds to wait after receiving call, before playing beep and receiving digits. Default 1 second, increase for PBX'es that needs more time to setup audio e.g. due to re-invites. |
| timeout | Number | Number of seconds to wait for entry of CPR or number before transferring to errorNumber, default 15 (CPR, N2N only). |
| cprLength | Number | Number of digits to be entered, 0-25. If 0 then no entry is required, instead callers a-number is auto-entered (CPR only). |
| n2nLength | Number | Number of digits to be entered (N2N only). |
| n2nTable | Array | Array of number to number conversions (N2N only). |
| n2nTable[x].from | String | Number to convert… (N2N only). |
| n2nTable[x].to | String | Number/extension to convert to (N2N only). |
| a2nTable | Array | Array of A-number to number conversions (A2N only). |
| a2nTable[x].from | String | A-Number to convert… (A2N only). |
| a2nTable[x].to | String | Number/extension to convert to (A2N only). |
| url | String | URL to call to retreive the number/extension to transfer the caller to. Inject the callers phone number as '{NUMBER}' into the URL. |
Note that properties holding no value may be omitted from the object.
Example
{ _id: '1234567890AB', publicIp: '213.83.176.254', lastSeen: '2016-03-01T12:23:45', ipMode: 'MANUEL', ipAddress: '192.168.1.23', ipSubnet: '255.255.255.0', ipGateway: '192.168.1.1', ipDns: '8.8.8.8', pbxIp: '192.168.1.20', pbxUsername: 'fhe6482gdhrt4628', pbxPassword: '2hg586uejr465jfn', debug: false, conflictDetection: true, apps: [ { _id: '12345678901234567890ABCD', type: 'CPR', inboundNumber: '501', returnNumber: '352', errorNumber: '300', cprLength: 10 }, { _id: '12345678901234567890ABCE', type: 'N2N', inboundNumber: '502', errorNumber: '301', n2nLength: 4, n2nTable: [ { from: '2300', to: '370' }, { from: '4300', to: '371' }, { from: '1000-2999', to: '372' } ] } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 403 | access_denied | Insufficient access level |
| 404 | tce | MAC address is not authorized |
| 409 | tce | MAC address is already in use |
| 422 | _id | Not a valid MAC address |
| 422 | ipAddress | Not a valid IP address |
| 422 | ipSubnet | Not a valid IP subnet |
| 422 | ipGateway | Not a valid IP address |
| 422 | ipDns | Not a valid IP address |
| 422 | pbxIp | Not a valid IP address |
| 422 | pbxUsername | PBX username is invalid |
| 422 | pbxPassword | PBX password is invalid |
| 409 | apps[x].inboundNumber | Number used by multiple apps |
| 422 | apps[x].inboundNumber | Not a valid number |
| 422 | apps[x].returnNumber | Not a valid number |
| 422 | apps[x].errorNumber | Not a valid number |
| 422 | apps[x].n2nLength | Invalid length - only 1-99 |
| 422 | apps[x].n2nTable | Table contains invalid from |
| 422 | apps[x].n2nTable | Table contains invalid from range |
| 422 | apps[x].n2nTable | Table contains invalid to |
| 422 | apps[x].a2nTable | Table contains invalid from |
| 422 | apps[x].a2nTable | Table contains invalid to |
| 422 | apps[x].url | URL is invalid |
| 422 | apps[x].url | URL is missing {NUMBER} |
| 422 | apps[x].type | App type is unknown |
| 500 | internal_error | <Unspecified> |
api/tce/create.txt · Last modified: 2016/11/01 13:00 by Per Møller