Set up phone calls

An agent can answer a phone number and call people, using your Infobip account. An admin sets it up in Codi and in the Infobip portal. The agent keeps its instructions, personality, knowledge and guardrails on the phone. Its MCP tools, connectors and image tools aren't used on calls.

What you need

  • The ElevenLabs Voice Gateway add-on and the Infobip Voice Gateway add-on. See Add-ons.
  • An Infobip account with Calls and at least one voice number, and an ElevenLabs account.
  • An admin in Codi. Only admins can open Integrations and create API keys.

Connect a number

  1. In the Infobip portal, go to Developer Tools, API Keys and create a key with the calls:manage scope. Both calls:traffic:send and calls:configuration:manage together also work.
  2. In Codi, open Integrations, tab Messaging & voice. On the Infobip card, paste the key into INFOBIP_API_KEY. Put your account address, like https://xxxxx.api.infobip.com, in INFOBIP_BASE_URL. Leave INFOBIP_CALLS_CONFIG_ID blank for now.
  3. On the ElevenLabs card, fill in ELEVENLABS_API_KEY. Switch both cards to Enabled and save.
  4. Open the agent. On the Voice tab, pick a voice and write its Opening line. Click the copy icon next to Agent ID in the agent's summary.
  5. Create an API key under Developers, API keys, with this agent in its scope. See API keys. An older key can answer Company ID is required: see Troubleshooting.
  6. In the Infobip portal, go to Channels, Voice & WebRTC, Calls API, Calls Configuration. Create a Calls Configuration, name it after the agent, and note its ID. You need the ID only to call people.
  7. On that Calls Configuration, add a subscription for VOICE_VIDEO events, with the header Authorization: Bearer and your API key, pointing at:
    https://<your Codi address>/api/v1/agents/<agent id>/voice/inbound-call
  8. Go to Channels, Voice & WebRTC, Numbers and open the voice number the agent should answer. Edit its default configuration: set Forwarding Action to Forward to Subscription, pick your Calls Configuration, leave Application as it is and save.
  9. Phone the number. You should hear the opening line within a couple of seconds. If not, see Troubleshooting.

Your Codi address is the one you sign in at. Codi creates the rest of the call set-up itself on the first call.

On a call

  • Callers can cut in while the agent speaks, except during its opening line, and press keypad keys: the agent hears which key.
  • The transcript appears in Chat with the source Infobip Voice, and the minutes appear on Billing.
  • A call ends after 30 minutes, or after 5 minutes with no audio connection.
  • Calls are billed by the minute, rounded up, plus the AI usage of what the agent says. At the workspace's spend limit, new calls are refused.

Hand a call to a person

Under Human handoff on the Voice tab, set Infobip transfer destination to CONVERSATIONS to send calls to your Infobip Inbox queues, or to another Calls Configuration ID. With no destination, Fallback phone number connects the caller to that number, in international format, digits only.

Call people

First set INFOBIP_CALLS_CONFIG_ID on the Infobip card to the Calls Configuration you created above. Its subscription must point at this agent's inbound-call address. Then send POST /api/v1/agents/<agent id>/voice/calls with your API key and to, the number to call. You can add from, your Infobip number, and greeting, instructions, context, outcomes and a callbackUrl for the result. For example:
{"to": "+27831112222", "from": "<your Infobip number>"}

Codi answers 202 with a callId and a sessionId, and the agent starts talking when the person picks up.

Need some help? Email support

Something not working? See troubleshooting