CTRLK

Shared components

Manage calls and messages

|

View as Markdown

This section describes how to configure call center-specific features and how to manage messages within Conversations. All standard Conversations setup steps apply here as well.


Calls

To learn how to make and receive calls, refer to the WebRTC calls documentation.

Below is a high-level overview of the required setup and call center integration steps.

Prerequisites [#prerequisites-calls]

Before working with calls, complete the following:

  1. Create an application using the Use Conversations configuration option.
  2. Register agents using their Agent ID.
  3. Add the Infobip RTC JS SDK to your application.

Make calls [#make-calls-calls]

To make an outbound call:

  1. Create an outbound call conversation.

  2. Generate CallOptions, including the following parameters inside customData:

    • conversationsID - obtained from the conversation created in the previous step.
    • calleeClientType - WebRTC for in-app calls or PSTN for calls to phone numbers.
    javascript
    1 
    2 const callOptions = CallOptions.builder()
    3    .setCustomData({
    4        isOutbound: true,
    5        outboundTo: outgoingCallRequest.destination,
    6        outboundFrom: outgoingCallRequest.sender,
    7        outboundAgentId: this.context.user.agentId,
    8        conversationId: outgoingCallRequest.conversationId,
    9        calleeClientType: calleeClientType,
    10    }).build();
  3. Use the callConversations method with the CallOptions.

  4. Manage the conversation as you would for any other channel.

Receive calls [#receive-calls-calls]

To receive calls:

  1. Configure your Voice number to forward calls to Conversations, or use the Dial to Conversations script in IVR.
  2. You can also initiate a call from your application to Conversations using the callConversations method (Web, Android, iOS).
  3. Set agent heartbeat.
  4. Register the incoming call event handler on the InfobipRTC client and implement answering and rejecting logic.

Wrap-up time [#wrap-up-time-calls]

After a call ends, agents may need time to write notes or summaries before closing the conversation.

During wrap-up:

Waiting strategy [#waiting-strategy-calls]

A waiting strategy shapes the caller experience while they wait to connect with an agent.

You can configure:

  • Strategy name
  • Applicable numbers or applications
  • Maximum waiting time

Optional components:

  • Greeting message - played at the beginning of the call
  • Hold music - audio played while waiting
  • Announcement message - periodic updates for callers
  • Maximum wait time message - played before the call

Learn more about the waiting strategy for calls.

With the available API methods, you can:

Transfer calls [#transfer-calls-calls]

Currently, there are three methods available for transferring calls:

Additionally, you can retrieve a list of all queues and return them along with their current activity status.

Recording [#recording-calls]

You can create account recording configuration to record agent-customer conversations to comply with regulatory requirements, ensure quality, or support other business needs.

System-level recording settings

You can choose to record:

  • Inbound calls (answered by agents)
  • Outbound calls (initiated by agents)
  • Both inbound and outbound

Recording video calls

Calls in Conversations can include video. You can decide how these calls should be recorded:

  • Media type: audio only, video only, or both.
  • Default behavior:

Video calls are recorded and stored in Infobip cloud storage as high-quality streamable files that cannot be downloaded.

To generate files you can download, copy, or move to your own storage, enable Video Download Preparation.

NotePreparing video files for download may take time depending on file duration, service load, and internet connection.

Configuration management

  • All recording settings can be viewed or changed at any time.
  • You can override system-level settings with agent-level configuration.
  • Agent-level setup can be created, viewed, and updated when needed.

Recording file management

You can get, download, and delete recording files.


Messages

You can use Messages API for engagement campaigns where a new conversation is created when sending the initial mobile-terminated (MT) message.

Create messages [#create-messages-messages]

Inbound messages are automatically threaded if channels and senders are configured for conversation threading.

To add outbound messages to a conversation, use the Create message method to send a message through any supported channel.

Get messages [#get-messages-messages]

Use the Get messages method to retrieve all messages exchanged within a conversation.

x-agent-id attribute [#x-agent-id-attribute-messages]

The x-agent-id HTTP header attribute identifies the agent sending the message.

It is used when integrations authenticate with an API key and need to associate outgoing messages with a specific agent.

  • The value is the agentId, which is the primary key of the agent entity.
  • You can find agentId in responses from the Agents API.
  • Adding x-agent-id to every request is not mandatory since its use depends on whether your account uses agents.

Behavior matrix

Conversation assignment statusNo x-agent-id providedx-agent-id = AGENTx-agent-id = SUPERVISOR
UnassignedOK (no-agents-used scenario)ErrorError
Assigned to AgentErrorOKOK
Assigned to SupervisorErrorErrorOK

Usage rules

If you do not use agents:

  • Keep conversations unassigned.
  • Omit the x-agent-id parameter entirely from the Create Message request header.

If you use agents:

  • Your account must have at least one agent (license not required) created via the Create agent API.
  • The x-agent-id header must contain the correct agentId, depending on who is sending the message.

Role behavior

  • Agent role can reply only to conversations assigned to them.
  • Supervisor role can reply to any conversation.
  • The x-agent-id header must always reflect the correct agentId based on who is performing the action.