API Version: Development

IPCortex.Types.Contact

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.
canTag Boolean True if the contact allows its tags to be edited by the current user.
chatID String Unique identifier for matching with room members, xmpp ID or contact ID.
tags Array A (possibly empty) list of tags for this contact, or null if the contact cannot be tagged
states Object A list of states by all online resources. IMPORTANT NOTE: These states represent the 'presence' aspect of the 'Chat' subsystem, and should not be confused with handset states (eg. Handset DnD) which are not accessible.
show String Contacts most online state (determined from states). As above, these states represent the 'presence' aspect of the 'Chat' subsystem.
  • online
  • away
  • dnd
  • '' - Empty string indicates offline, no permissions or no data.
blf Number Owned/WebRTC/Hotdesk phone state indication.
  • 0 - available
  • 1 - on call
  • 2 - ringing
  • 3 - on call and ringing

Methods

contact.dial(device, [callback]) ⇒ Promise

Kind: class method of IPCortex.Types.Contact
Dial the 'best-guess' number on this Contact using Device of device. See the Device.dial() documentation for further detail or more advanced dial options.
Parameter Type Description
device Device Device to dial on.
Equivalent to device.dial(contact, callback)

contact.chat(callback) ⇒ Promise

Kind: class method of IPCortex.Types.Contact Returns: Promise
Open a chat room with the contact. This is a shortcut to calling IPCortex.PBX.chatInvite(...), so implements all of the same behaviours.

contact.xmppReq()

Kind: class method of IPCortex.Types.Contact
Request a chat relationship with the contact.

contact.xmppAuth()

Kind: class method of IPCortex.Types.Contact
Accept a chat relationship request.

contact.xmppDel()

Kind: class method of IPCortex.Types.Contact
Remove a chat relationship.

contact.photo(size) ⇒ Promise

contact.photo(options) ⇒ Promise 6.4.21+

Kind: class method of IPCortex.Types.Contact Returns: Promise
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.
Requests to this method put a heavy load on the database, so are serialised and may be fulfilled slowly as a result. It is recommended that the return value should be cached for a while, and loaded/refreshed only at the point where it is needed.
Parameter Type Description
size Number (Optional) Size of image to retrieve - null for 128 pixel.
options Object May contain a size attribute. May contain and allownull bool to didable the placeholder image

contact.addListener(event, callback)

Kind: class method of IPCortex.Types.Contact
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

contact.removeListener(event, callback)

Kind: class method of IPCortex.Types.Contact
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.