JSON API » cdrs » cdrs/create
Creates a new completed call. This call will normally have occurred on some external system.
Input parameters
Requires authentication and the system role privilege.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| uniqueid | String | Uniqueid. | Yes | |
| machine | String | Machine. | Yes | |
| start | Integer | Start Unix timestamp. | Yes | |
| scustomer | Integer | ID of customer making call. | Yes | |
| stype | String | Source type. | No | Empty string. |
| snumber | String | Source number. | No | Empty string. |
| spresent | Integer | Source presentation in ISDN format. | No | 0 |
| sname | String | Source caller name. | No | Empty string. |
| ctype | String | Called type. | No | Empty string. |
| cnumber | String | Called number. | No | Empty string. |
| dcustomer | Integer | ID of destination customer. | No | Same as scustomer. |
| dtype | String | Destination type. | No | Empty string. |
| dnumber | String | Destination number. | No | Empty string. |
| callid | String | Callid. | No | Same as uniqueid. |
| channel | String | Channel. | No | Empty string. |
| cost | Decimal | Cost to customer making call. | No | 0.00 |
| currency | String | Currency cost is in. | No | System currency. |
| end | Integer | End Unix timestamp. | No | Same as start. |
| ingroup_time | Integer | ID of ingroup_time. | No | 0 |
| invoice | Integer | ID of invoice. 0 for none. | No | 0 |
| media | String | Media. "fax", "message", or "voice". | No | "voice" |
| messages | Integer | Number of included messages used. | No | 0 |
| note | String | Note to attach to call. | No | Empty string. |
| outgroup_time | Integer | ID of outgroup_time. | No | 0 |
| peer | Integer | ID of peer. 0 for none. | No | 0 |
| recording | String | Recording path. | No | Empty string. |
| status | String | Call status. "answer", "busy", "cancel", "chanunavail", "congestion", "error", "noanswer". | No | "answer" |
| talktime | Integer | Talk time in seconds. | No | end - start |
| taxes | String | Comma separated list of taxes to apply. | No | Empty string. |
| time | Integer | Included time used in seconds. | No | 0 |
| totaltime | Integer | Total time in seconds. | No | end - start |
| update_balance | Integer | 1 to update balance of customer making call, 0 not to. | No | 1 |
| update_invoices | Integer | 1 to update any affected invoices, 0 not to. | No | 1 |
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 |
Responses
| Code | Description |
|---|---|
| 201 | Input passed validation. Only returned if validation=1. |
| 204 | Success. |
| 400 | Invalid input parameters specified. Check the key and message fields for more details. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
Data returned
No data is returned.
Example: With required parameters
http://enswitch.example.com/api/json/cdrs/create/?auth_username=user;auth_password=password;uniqueid=1234567890.123456;machine=1;start=1234567890;scustomer=123{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Change history
| Version | Changes |
|---|---|
| 3.13 | Function added. |
