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
- The Generic CRM interface reads the assigned CRM Configuration via Element API after the session is ready.
- The Generic CRM interface binds enabled features and posts the corresponding messages to the Host CRM integration.
- 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.
- The Generic CRM interface posts
voice:bindso the Host CRM integration starts listening for dial events. - The Host CRM integration posts
voice:dialoutwhen the user selects a phone number or contact in the Host CRM.
{
"channel": "infinity-crm-bridge",
"type": "voice:dialout",
"payload": { "phoneNumber": "+1234567890" }
}- The Generic CRM interface receives
voice:dialout, callsgetUserInfo()to resolve the default outbound queue, callsgetUserInteractions(), then callscreateVoiceInteraction()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.
- 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.
- The Host CRM integration posts
voice:dialout.
{
"channel": "infinity-crm-bridge",
"type": "voice:dialout",
"payload": { "phoneNumber": "+1234567890" }
}- The Generic CRM interface receives
voice:dialout, callsgetUserInteractions()to find the owned interaction, then callsconsultCall().
await api.consultCall({
interactionId: 'int-123',
phoneNumber: '+1234567890'
});No queue is used. The consult is attached to the existing owned interaction.
Screen pop
- The Generic CRM interface receives
onInteractionUpdated()from Avaya Infinity Agent. - The Generic CRM interface posts
screenPop:interactionto the Host CRM integration with the interaction payload.
{
"channel": "infinity-crm-bridge",
"type": "screenPop:interaction",
"payload": {
"id": "int-123",
"custom": {
"crm": {
"myCrm": { "ID": 45678 }
}
}
}
}- 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.
- The Infinity Element sends
requestDirectoryviasendInterElementMessage(). - The Generic CRM interface receives it through
onInterElementMessage()and postsrequestto the Host CRM integration.
{
"channel": "infinity-crm-bridge",
"type": "request",
"requestId": "1",
"method": "fetchDirectory"
}- The Host CRM integration posts
responsewith the contact list.
{
"channel": "infinity-crm-bridge",
"type": "response",
"requestId": "1",
"payload": [
{ "name": "Jane Smith", "phone": "+1234567890" }
]
}- The Generic CRM interface sends
crmDirectoryResponseto the Infinity Element viasendInterElementMessage().
{
"type": "crmDirectoryResponse",
"directory": [
{ "name": "Jane Smith", "phone": "+1234567890" }
]
}- 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 callsconsultCall().
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.
- One of the Element API events above occurs.
- The Generic CRM interface posts
requestto the Host CRM integration to apply the status.
{
"channel": "infinity-crm-bridge",
"type": "request",
"requestId": "3",
"method": "applyUnifiedStatusByName",
"args": { "name": "Busy" }
}- 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
- The Generic CRM interface posts
availability:bindso the Host CRM integration starts reporting availability changes. - The Host CRM integration posts
availability:changedwhen availability changes.
{
"channel": "infinity-crm-bridge",
"type": "availability:changed",
"payload": {
"id": 1,
"name": "Available",
"reason": "Ready"
}
}- The Generic CRM interface receives
availability:changed, may callgetReasonCodes(), then callssetAgentStatus(). - 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.
- The Generic CRM interface receives
onAgentStateChange(). When Infinity is available, it postsrequestto applycomplementaryDefaultStatuson the Host CRM integration; the Host CRM integration postsresponse. - The Generic CRM interface posts
availability:bind. When the Host CRM integration postsavailability:changed, the Generic CRM interface callssetAgentStatus()(optionally aftergetReasonCodes()). - On teardown, the Generic CRM interface posts
availability:unbind.
Related Documentation
Updated 8 days ago
