PhoneCall resource
A phone call is represented by UnifiedAPI as a PhoneCall resource and contains the PhoneCallView components which describes the phone call from the perspective of the parties involved in the phone call.
JSON representation
The example below contains the PhoneCall in JSON representation. All fields are fictitious.
{ "id": "b817d2618fe6f1804333", "nonce": "130c5a97768be67df6543b5f5fa3cc51", "extension": "0003*210", "ownerId": "53tete535", "ownerName": "53tete535", "published": "2011-02-10T15:04:55Z", "answered": "2011-02-10T15:10:55Z", "phoneCallView": [ { "id":"00", "extension":"0003*210", "source":["0003*211","0003*210"], "destination":["3334444"], "flow":4, "status":3, "ringing":"2011-02-10T15:04:55Z", "callerID":"John Doe <3332222>", }, { "id":"01", "extension":"0003*211", "source":["0003*211","0003*210"], "destination":["3334444"], "flow":4, "status":3, "ringing":"2011-02-10T15:04:55Z", "callerID":"John Doe <3332222>", } ], "links": { "self": "..." } }
When a HTTP response is returned by the Service, the fields that are NULL are not included in the response!
PhoneCall specific fields
The table below describes the fields that are specific to the PhoneCall resource and are not to be found in the PhoneCallView or PhoneCallLink.
Name | Type | Can be NULL | Description |
---|---|---|---|
id | Object-Id | No | The Id of the PhoneCall as saved in the system. The Id is generated by the Service and can be later used to list or edit the PhoneCall details. |
extension | UAPI-Extension-Number | No | The number of the Extension that is charged for the phone call. This Extension might not be a party of the phone call. |
ownerId | User-Id | No | The Id of the Organization that owns the PhoneCall. |
ownerName | String | No | The name of the Organization that owns the PhoneCall. |
published | Date | No | The date the phone call entered the system. |
answered | Date | Yes | The date the phone call was answered. |
nonce | String | No | A unique string which allows to identify the call created based on the request. |
PhoneCallView fields
The table below describes the fields of a PhoneCallView component.
Name | Type | Can be NULL | Description |
---|---|---|---|
id | Object-Id | No | The Id of the PhoneCallView as generated by the Service. The Id of the view can be used later to edit the call. |
extension | UAPI-Extension-Number | No | The phone number of the Extension. The PhoneCallView is from the perspective of this extension. |
source | Array< UAPI-Extension-Number | UAPI-Phone-Number > | No | The phone number of the source. |
destination | Array< UAPI-Extension-Number | UAPI-Phone-Number > | No | The phone number of the destination. |
flow | Number | No | The flow of the call, which is set to: 2 - a local call |
status | Number | No | The status of the call, which is set to: 0 - unknown |
ringing | Date | Yes | The date when the source terminal started ringing. Can be missing if the call is answered. |
callerId | UAPI-Caller-Id | Yes | The caller Id. |
recording | Date | Yes | The date when the phone call started to be recorded. |
answered | Date | Yes | The date the source answered the call. Can be missing if the call is ringing. |
parked | Date | Yes | The date when the phone call was parked. |
parkedPos | Number | Yes | The position of the call in the parking lot. |
parkedBy | UAPI-Extension-Number | Yes | The number that put the phone call in the parking lot. |
onHold | Date | Yes | The date the phone call was put on hold. |
holder | Number | Yes | If set to 1, this peer put the phone call on hold. |
disposition | Number | Yes | The call disposition: |
spying | Number | Yes | This flag is set to 1 if the extension is spying it's peer. |
queue | UAPI-Extension-Number | Yes | The phone number of the queue extension. Used when a call is routed using a queue. |
Example
If we have a call between two phone numbers 0003*210 and 0003*211 and 0003*210 records the call, the PhoneCallViews will look as in the example below:
{ "id": "b817d2618fe6f1804333", "extension": "0003*210", .... "phoneCallView': [ { "id":"00", "extension":"0003*210", .... "recording": "2012-06-20T09:55:13+03:00" //The call of 0003*210 is being recorded }, { "id": "01", "extension": "0003*211", ... // The call of 0003*211 is not recorded so the recording parameter is missing } ], links: { ... } }
PhoneCallAction object
During its lifetime, a phone call can be put on hold, parked, recorded or manipulated using other actions. These actions are represented as the PhoneCallAction object by UnifiedAPI.
JSON representation
The example below contains the PhoneCallAction in JSON representation. All fields are fictitious.
{ "action": "PickUp", "sendCallTo": "0003*210*, "callerId: "John Doe <42420042>", "waitForPickup": "20" , "phoneCallViewId": "zz" }
Fields that are NULL are not included in the answer!
Resource specific fields
The table below describes the fields that are specific to the PhoneCallAction object.
Name | Type | Description |
---|---|---|
action | String | The type of action to perform. Possible values:
|
sendCallTo | Some actions need a phone number to send the call to. This field should contain the number. | |
callerId | UAPI-Caller-Id | When a call is barged in or is whispered on, a caller Id can be sent to the Service. |
waitForPickUp | Number | The maximum number of seconds to wait until one of the phone numbers used picks up. As soon as the set time value runs out, the call is canceled. Default: 25 seconds. |
phoneCallViewId | String | The Id of PhoneCallView that is subject to the change. |
format | String | Used only when recording a phone call and must be set to the format of the recorded file. |
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.