API Version: 6.2

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.
chatID String Unique identifier for matching with room members, xmpp ID or contact ID.
states Object A list of states 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

contact.dial(device, [callback])

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

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

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.

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.