A subset of the addressbook entries, a Contact instance is a PABX user. It is useful to distinguish Address and Contact in that a Contact can be involved in the PABX dialplan - This is not always true of an Address.
Properties
Name |
Type |
Description |
cID |
Number |
Unique identifer. |
name |
String |
Friendly name/label. |
uname |
String |
Unique login name. |
company |
String |
Unique identifer of the contacts company, company ID or 'default' |
companyName |
String |
Friendly name of contacts company. |
email |
String |
Email address or empty string if not set. |
canCall |
Boolean |
True if the contact is callable. |
canChat |
Boolean |
True if the contact is online for chat. |
chatID |
String |
Unique identifier for matching with room members, xmpp ID or contact ID. |
states |
Object |
A list of
by all online resources. |
show |
String |
Contacts most online state. (determined from states)- online
- away
- dnd
- '' - Empty string indicates offline, no permissions or no data.
|
blf |
Number |
Owned/WebRTC phone state indication. - 0 - available
- 1 - on call
- 2 - ringing
- 3 - on call and ringing
|
Methods
Dial the 'best-guess' number on this
Contact using
Device of
device
.
Parameter |
Type |
Description |
device |
Device |
Device to dial on. |
Equivalent to device.dial(contact, callback)
Open a chat room with the contact. This is a shortcut to calling IPCortex.PBX.chatInvite(...)
, so implements all of the same behaviours.
Request a chat relationship with the contact.
Accept a chat relationship request.
Remove a chat relationship.
Fetch a profile picture.
Return a promise which always resolves to either an encoded PNG, suitable for insertion into an img src
tag, or a placeholder SVG.
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 |
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 contact is created
- update - The contact call or IM state has changed.