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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
uniqueidStringUniqueid.Yes
machineStringMachine.Yes
startIntegerStart Unix timestamp.Yes
scustomerIntegerID of customer making call.Yes
stypeStringSource type.NoEmpty string.
snumberStringSource number.NoEmpty string.
spresentIntegerSource presentation in ISDN format.No0
snameStringSource caller name.NoEmpty string.
ctypeStringCalled type.NoEmpty string.
cnumberStringCalled number.NoEmpty string.
dcustomerIntegerID of destination customer.NoSame as scustomer.
dtypeStringDestination type.NoEmpty string.
dnumberStringDestination number.NoEmpty string.
callidStringCallid.NoSame as uniqueid.
channelStringChannel.NoEmpty string.
costDecimalCost to customer making call.No0.00
currencyStringCurrency cost is in.NoSystem currency.
endIntegerEnd Unix timestamp.NoSame as start.
ingroup_timeIntegerID of ingroup_time.No0
invoiceIntegerID of invoice. 0 for none.No0
mediaStringMedia. "fax", "message", or "voice".No"voice"
messagesIntegerNumber of included messages used.No0
noteStringNote to attach to call.NoEmpty string.
outgroup_timeIntegerID of outgroup_time.No0
peerIntegerID of peer. 0 for none.No0
recordingStringRecording path.NoEmpty string.
statusStringCall status. "answer", "busy", "cancel", "chanunavail", "congestion", "error", "noanswer".No"answer"
talktimeIntegerTalk time in seconds.Noend - start
taxesStringComma separated list of taxes to apply.NoEmpty string.
timeIntegerIncluded time used in seconds.No0
totaltimeIntegerTotal time in seconds.Noend - start
update_balanceInteger1 to update balance of customer making call, 0 not to.No1
update_invoicesInteger1 to update any affected invoices, 0 not to.No1
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your 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

VersionChanges
3.13Function added.