Generic CRM Protocol

Flow of postMessages and Element API for each CRM feature.

Part of CRM Integration for Avaya Infinity.

For host CRM implementation — what you receive, what you send, and JSON examples — see Host CRM Implementation. This page documents the Generic CRM interface side (Element API mapping).

The Generic CRM interface talks to the Host CRM integration on channel infinity-crm-bridge (Generic CRM protocol) and to Avaya Infinity Agent through Element API.

{
  "channel": "infinity-crm-bridge",
  "type": "<message-type>"
}

Session lifecycle

  1. The Generic CRM interface reads the assigned CRM Configuration via Element API after the session is ready.
  2. The Generic CRM interface binds enabled features and posts the corresponding messages to the Host CRM integration.
  3. On teardown, the Host CRM integration or the Generic CRM interface posts detach.

Feature flags stay on the Generic CRM interface side; the Host CRM integration reacts to the messages it receives.


Click-to-dial

Requires click-to-dial enabled in CRM Configuration.

  1. The Generic CRM interface posts voice:bind so the Host CRM integration starts listening for dial events.
  2. The Host CRM integration posts voice:dialout when the user selects a phone number or contact in the Host CRM.
{
  "channel": "infinity-crm-bridge",
  "type": "voice:dialout",
  "payload": { "phoneNumber": "+1234567890" }
}
  1. The Generic CRM interface receives voice:dialout, calls getUserInfo() to resolve the default outbound queue, calls getUserInteractions(), then calls createVoiceInteraction() with that queue.
await api.createVoiceInteraction({
  phoneNumber: '+1234567890',
  queueId: '003' // default outbound queue from getUserInfo()
});

Queue resolution from getUserInfo(): defaultOutboundQueue (matched by name against queues[]) → personalQueueId → first accessible queue. The Host CRM integration does not supply a queue.

  1. On teardown, the Generic CRM interface posts voice:unbind.

Accepted phone keys in voice:dialout: phoneNumber, number, phone, tel, destination.


Click-to-consult

Requires clickToConsult: true. Uses the same voice:bind / voice:dialout / voice:unbind postMessages as click-to-dial.

  1. The Host CRM integration posts voice:dialout.
{
  "channel": "infinity-crm-bridge",
  "type": "voice:dialout",
  "payload": { "phoneNumber": "+1234567890" }
}
  1. The Generic CRM interface receives voice:dialout, calls getUserInteractions() to find the owned interaction, then calls consultCall().
await api.consultCall({
  interactionId: 'int-123',
  phoneNumber: '+1234567890'
});

No queue is used. The consult is attached to the existing owned interaction.


Screen pop

  1. The Generic CRM interface receives onInteractionUpdated() from Avaya Infinity Agent.
  2. The Generic CRM interface posts screenPop:interaction to the Host CRM integration with the interaction payload.
{
  "channel": "infinity-crm-bridge",
  "type": "screenPop:interaction",
  "payload": {
    "id": "int-123",
    "custom": {
      "crm": {
        "myCrm": { "ID": 45678 }
      }
    }
  }
}
  1. The Host CRM integration interprets the payload and opens the matching record(s) in the Host CRM.

CRM directory

Serve host CRM contacts to Infinity Elements. From the directory, the agent can also select a queue and contact for outbound, or a contact for consult on an active interaction.

  1. The Infinity Element sends requestDirectory via sendInterElementMessage().
  2. The Generic CRM interface receives it through onInterElementMessage() and posts request to the Host CRM integration.
{
  "channel": "infinity-crm-bridge",
  "type": "request",
  "requestId": "1",
  "method": "fetchDirectory"
}
  1. The Host CRM integration posts response with the contact list.
{
  "channel": "infinity-crm-bridge",
  "type": "response",
  "requestId": "1",
  "payload": [
    { "name": "Jane Smith", "phone": "+1234567890" }
  ]
}
  1. The Generic CRM interface sends crmDirectoryResponse to the Infinity Element via sendInterElementMessage().
{
  "type": "crmDirectoryResponse",
  "directory": [
    { "name": "Jane Smith", "phone": "+1234567890" }
  ]
}
  1. In the Infinity Element, after the agent selects a queue and contact, the element calls createVoiceInteraction(). If there is an active owned interaction, selecting a contact calls consultCall().

Omnichannel — Synchronized

Requires omnichannel Synchronized in CRM Configuration.

Infinity → Host CRM integration

The Generic CRM interface posts request with method applyUnifiedStatusByName so the Host CRM integration updates agent status in the Host CRM. This is triggered by:

  • onAgentStateChange() — agent status changes in Avaya Infinity Agent (for example Available, Busy, Offline on logout).
  • onInteractionAccepted() — sets the host CRM to Busy when an interaction becomes active.
  • onInteractionEnded() — when the last active interaction completes, restores the host CRM status to match the current Infinity agent state.
  1. One of the Element API events above occurs.
  2. The Generic CRM interface posts request to the Host CRM integration to apply the status.
{
  "channel": "infinity-crm-bridge",
  "type": "request",
  "requestId": "3",
  "method": "applyUnifiedStatusByName",
  "args": { "name": "Busy" }
}
  1. The Host CRM integration posts response.
{
  "channel": "infinity-crm-bridge",
  "type": "response",
  "requestId": "3",
  "payload": {
    "applied": true,
    "echoStatusId": 2,
    "resolvedName": "Busy"
  }
}

Host CRM integration → Infinity

  1. The Generic CRM interface posts availability:bind so the Host CRM integration starts reporting availability changes.
  2. The Host CRM integration posts availability:changed when availability changes.
{
  "channel": "infinity-crm-bridge",
  "type": "availability:changed",
  "payload": {
    "id": 1,
    "name": "Available",
    "reason": "Ready"
  }
}
  1. The Generic CRM interface receives availability:changed, may call getReasonCodes(), then calls setAgentStatus().
  2. On teardown, the Generic CRM interface posts availability:unbind.

The Generic CRM interface may also call getAgentState() when binding to reconcile the initial state.


Omnichannel — Complementary

Requires omnichannel Complementary in CRM Configuration and a complementary default status.

  1. The Generic CRM interface receives onAgentStateChange(). When Infinity is available, it posts request to apply complementaryDefaultStatus on the Host CRM integration; the Host CRM integration posts response.
  2. The Generic CRM interface posts availability:bind. When the Host CRM integration posts availability:changed, the Generic CRM interface calls setAgentStatus() (optionally after getReasonCodes()).
  3. On teardown, the Generic CRM interface posts availability:unbind.

Related Documentation


Did this page help you?