IPCortex.Types.Call
A Call instance represents a call on a device or in a Queue.
Permissions
IMPORTANT: There is a difference between visibility of calls and control of calls. A logged in user may only apply call control to their own calls, but may be sent details of additional calls, particularly if listening using the 'new' event.
Visibility rules are as follows:
- The 'admin' login can see all calls on all devices.
- A 'sys-admin' login can see all calls on all devices.
- A 'company-admin' can see calls on all administered companies.
- A 'user' in the 'default' company can see calls in all companies.
- A 'user' NOT in the 'default' company can see calls in their own company.
Therefore it may be necessary to filter which calls you are interested in by checking whether call.device
is a device accessible by the logged-in user. Alternatively, add call/update listeners only to specific devices.
Properties
Name |
Type |
Description |
label |
String |
Friendly name or number of the other party as available. Name is prioritised. |
name |
String |
Name of the other party or empty string if unavailable. |
number |
String |
Number of the other party or empty string if unavailable. |
qname |
String |
Name of the calling party while in a queue. 6.3.20+ |
qnumber |
String |
Number of the calling party while in a queue. 6.3.20+ |
id |
Number |
Unique identifier generated by Asterisk for every call. Can be reused under rare call flows. keevio phone devices may fill a dummy value when the call is first created. |
uid |
Number |
Unique identifier generated by API for every call object. Will never re-occur unless API reloads. |
stamp |
Number |
Start time in epoch milli-seconds. |
start |
Number |
Answered time in epoch milli-seconds. |
remoteMedia |
Array |
A list of attached mediaStream. (WebRTC only) |
inq |
Number |
Time entered Queue in epoch seconds. (queue only) |
outq |
Number |
Time exited Queue in epoch seconds. (queue only) |
qcall |
Call |
Bridged call if answered by a Queue agent. Will be null if user has no access to the target call, or call not delivered by Queue. (queue only) 6.2.11+ |
device |
Device |
The parent Device instance. |
owner |
Contact |
Owners contact instance or null if unowned. Taken from Device above. 6.4.27+ |
ownerID |
Number |
Owners contact ID or null if unowned. Taken from Device above. 6.4.27+ |
company |
String |
The target company for an inbound call. null if undetermined. 6.2.14+ |
dtmfString |
String |
The last collected DTMF string, or null . 6.2.14+ |
extension |
Extension |
Extension this call was most recently received via. null if undetermined. This can be used to determine which identity was call was sent to. 6.2.14+ |
cause |
Number |
A hangup cause code. Only filled when the call is state 'dead' 6.4.7+ |
causeTxt |
String |
A hangup cause string. Only filled when the call is state 'dead' 6.4.7+ |
party |
String |
Call party. - unknown (Seen on some early stage calls)
- caller
- callee
|
features |
String |
Comma separated list of features. |
state |
String |
Call state. - down
- dial
- ring
- up
- hold
- park
- dead
|
nrState |
String |
Near-end state. This will correctly indicate 'up' if an 'up' call is transferred and starts to hear 'ring' on the line, but state will indicate 'ring'. - down
- dial
- ring
- ringing
- up
- hold
- park
- dead
|
jsState |
String |
WebRTC session state. 6.4.26+ - Unknown
- Trying
- Progress
- Confirmed
- Cancelled
- Busy
- Rejected
- Unavailable
- (possibly others passed by SIP)
|
jsInfo |
Object |
WebRTC session information. An object which may contain the following parameters: 6.4.26+ - state: jsState (as above)
- established: Bool
- ended: Bool
- onhold: {local: Bool, remote: Bool}
- muted: {audio: Bool, video: Bool}
|
Methods
call.hold(callback)
Put the call on hold.
NOTE: for keevio-phone, any remote media streams that have previously been provided become invalid, and an update with an empty list of media streams will be received.
call.talk(callback)
Answer or take the call off hold.
NOTE: for keevio-phone, any remote media streams that have previously been provided will be invalid, and an update with a new list of media stream(s) will be received after the unhold or answer is complete.
call.hangup(callback)
call.send(number, callback) 6.2.14+
Send the call to a number/extension. Requires administrative ownership of the call, and can be used on inbound calls to send them elsewhere.
Parameter |
Type |
Description |
number |
String |
Transfer destination. |
call.xfer(number, callback)
Transfer the call to a number/extension.
Parameter |
Type |
Description |
number |
String |
Transfer destination. |
call.atxfer(call, callback)
Bridge two calls together.
Parameter |
Type |
Description |
call |
Call |
Bridge destination. |
call.mute(mute, callback)
Mute or un-mute the call. (WebRTC only)
Parameter |
Type |
Description |
mute |
Boolean |
Mute or unmute. |
call.dtmf(tone, callback)
Send a DTMF digit/tone. (WebRTC only)
Parameter |
Type |
Description |
tone |
String |
DTMF digit/tone. (0-9, *, #) |
call.addListener(event, callback)
Add listener method, inherited from Api base class and common to all classes.
Parameter |
Type |
Description |
event |
String |
Name of event, e.g. 'update' |
callback |
Function |
Callback which is passed a reference to the updated Class object |
call.removeListener(event, callback)
Remove listener method, inherited from Api base class and common to all classes. event
and callback
must be identical to those used in addListener()
in order for the remove to succeed.
Parameter |
Type |
Description |
event |
String |
Name of event, e.g. 'update' |
callback |
Function |
Callback which is passed a reference to the updated Class object |
Events
- new - A new call is created
- update - The call state has changed.