Skip to main content
connic
Connectors

Telnyx Voice

Answer and place calls with an existing Telnyx number and a connic voice agent.

Last updated
ModesSync (incoming calls) and outbound (outgoing calls)
YAML typetelnyx
CredentialsA Connection of type Telnyx
BridgeNot supported
Custom domainNot supported
Linked agentsExactly one agent, deployed with voice_config
While pausedconnic doesn't answer incoming calls and doesn't forward them. Telnyx ends them after 30 seconds.

Set up

  1. Add voice_config and a supported realtime model to an LLM agent, save the model provider's credentials in the project if the model requires them, and deploy the agent to the environment. See connic voice.

  2. In Telnyx, pick an existing active number and turn off its call forwarding.

  3. Open the agent. In Connector Flow, click Add inbound connector, then Create New Connector, and select Telnyx Voice. Under Connection, pick a Telnyx Connection or create one with the API key and the account's public key.

  4. Choose the Phone number. Numbers the connector can't use, such as a number with call forwarding turned on or one another connic voice connector holds, are listed but disabled, with the reason. Optionally add Transfer numbers and a Fallback number, and click Create. connic links the agent, creates a Call Control application, and assigns the number to it; see Provider setup for what it replaces.

  5. Call the number and open the run to check the transcript, tool calls, timings, and errors.

In code

Declare the connector in connectors/*.yaml. The deploy looks phone_number up among the active numbers of the Connection's account, and activation links the agent, which needs voice_config in that deployment. Quote every phone number; unquoted, YAML reads it as an integer and the deploy fails.

connectors/support-line.yaml
type: telnyx
connection: support-telnyx
config:
  phone_number: "+4930123456"
  transfer_numbers:
    - "+4930123456789"
  allowed_callers:
    - "+4915112345678"
  fallback_number: "+4930987654321"
  max_wait_seconds: 60
  hold_audio_path: assets/hold.mp3
agents:
  - support-voice

Configuration

The fields of a Telnyx Voice connector, the same in connectors/*.yaml, the REST API, and connic MCP. The descriptions name the matching setting in the dashboard. Connectors in code describes the fields every connector shares, such as agents and environments. A Telnyx Voice connector needs its voice agent from the start: the dashboard links the agent you create it from, or asks for one under Voice agent, and a create request through the REST API or connic MCP must name an agent deployed with voice_config in agent_name.

FieldTypeStatusDescription
typestringRequiredtelnyx.
connectionstringRequiredName or ID of a Telnyx Connection, which holds the API key and public key. Dashboard: Connection.
modestringOptionalsync answers calls to the number; outbound places a call for every run of the agent. It can't change after the connector is created. Dashboard: Mode.Default: sync
configobjectRequiredTelnyx Voice settings.
phone_numberstringRequiredThe number that receives the calls or places them, quoted in E.164 format such as "+4930123456", or the number's Telnyx ID. It must be an active number of the Connection's account. Dashboard: Phone number.
transfer_numbersstring[]OptionalNumbers that agent tools may transfer callers to with TransferCall, in E.164 format. A list, or one string with the numbers separated by line breaks or commas. At most 20; duplicates are dropped. Dashboard: Transfer numbers.
allowed_callersstring[]OptionalSync mode. Only these numbers can call the agent, in E.164 format, as a list or one string with line breaks or commas. At most 100. Calls from other and hidden numbers are rejected before they are answered; see Allowed callers. Dashboard: Allowed callers.
outbound_voice_profile_idstringOptionalOutbound mode, required there. The ID of the Telnyx outbound voice profile that places the calls; it decides which destinations they may reach. Dashboard: Outbound voice profile.
tostringOptionalOutbound mode. The number to call, in E.164 format, when a run's input has no to. Dashboard: Default number to call.
ring_secondsintegerOptionalOutbound mode. How long the phone rings, from 5 to 120 seconds, before the run fails because nobody answered. Dashboard: Ring time (seconds).Default: 30
fallback_numberstringOptionalSync mode. Number in E.164 format that receives accepted calls the agent can't finish and calls that waited the maximum wait. Dashboard: Fallback number.
max_wait_secondsintegerOptionalSync mode. How long callers wait for the agent when it is already in as many calls as its concurrency limit allows, from 0 to 900. 0 sends such calls to the fallback number right away. Dashboard: Maximum wait (seconds).Default: 30
hold_audio_pathstringOptionalSync mode. Path of an MP3 or WAV file in your project folder, such as assets/hold.mp3, up to 10 minutes long, that waiting callers hear on repeat. It deploys with the project. Without one, they hear the ringing tone. Dashboard: Hold audio.

Connection

A Telnyx Connection holds the account credentials and can serve any number of Telnyx Voice and Telnyx Messaging connectors. connic uses the API key to check the account, list numbers, and set up the Call Control application, and the public key to verify the signature of every event Telnyx sends. If the voice model requires provider credentials, save them separately in the project.

SettingDescription
API keyA Telnyx API key with access to the account's phone numbers and Call Control applications. Create it in the Telnyx Mission Control Portal.
Public keyThe same account's base64-encoded Ed25519 public key, from the API Keys settings in the Telnyx Mission Control Portal. It is separate from the API key. Telnyx has no API to look it up, so when you save the Connection, connic only checks that it is a valid key. A key from another account shows up when calls arrive: connic rejects their events and writes the signature failure to the connector logs.

Generated values

connic creates these when the connector is created and keeps them across updates and deploys; switching to another number creates a new application. Leave them out of YAML files; connic lint rejects them.

ValueModesDescription
Incoming-call webhookSyncThe URL Telnyx sends call events to. connic sets it on the Call Control application.
application_idSyncThe ID of the Call Control application connic created for the number.
application_nameSyncIts name: Connic Voice followed by the connector ID and the number's Telnyx ID.

Agent input

Each call starts a run with the call details:

input.json
{
  "call_id": "<call-control-id>",
  "from": "+4915112345678",
  "to": "+4930123456",
  "provider": "telnyx",
  "caller_name": "Alex Example",
  "raw": {
    "call_control_id": "<call-control-id>",
    "connection_id": "<application-id>",
    "direction": "incoming",
    "from": "+4915112345678",
    "to": "+4930123456",
    "caller_id_name": "Alex Example"
  }
}
  • call_id is the Telnyx call control ID.
  • caller_name comes from caller_id_name.
  • raw holds the payload of the call.initiated event, including custom_headers and sip_headers.
  • forwarded_from is never set. Telnyx passes forwarding information as a Diversion entry in sip_headers.

Calls

In sync mode, Telnyx Voice answers calls to the number. connic answers each call through Telnyx and streams the audio between Telnyx and the agent in both directions. The caller hears a ringing tone until the agent is ready to speak. When the conversation ends, connic hangs up through Telnyx. Keypad input, interruptions, and hang-up follow the agent's voice settings.

Outgoing calls

In outbound mode, every run of the linked agent is a call. In the agent's Connector Flow, click Add outbound connector, select Telnyx Voice, choose Outgoing calls as the mode, and pick the outbound voice profile. Start the runs any way you like, for example from a webhook connector, or from another agent with trigger_agent.

When a run starts, connic calls the number in the input's to field from the connector's number, or the connector's default number when the input has none. With a greeting, the agent speaks first once someone answers; without one, it waits for them to speak. It knows about the call what the run input tells it. The agent gets through phone menus with press_keys and can wait on hold until a person answers. Runs beyond the agent's max_concurrent_runs wait before connic dials, so nobody who answers has to wait for the agent. The agent can transfer the call to a transfer number, like an incoming call.

The run fails when nobody answers within the ring time or the call ends before the agent joins, and its error says why. If a mailbox answers, the agent hears its greeting like a person, so tell the agent in its system prompt what to do then, for example leave a short message after the tone and hang up.

connectors/reminder-calls.yaml
type: telnyx
mode: outbound
connection: support-telnyx
config:
  phone_number: "+4930123456"
  outbound_voice_profile_id: "1293384261075731499"
  ring_seconds: 40
agents:
  - reminder-calls
input.json
{
  "to": "+4915112345678",
  "customer": "Alex Example",
  "reason": "Confirm tomorrow's appointment at 10:00"
}

Allowed callers

With allowed callers, connic rejects calls from all other numbers and from hidden numbers before they are answered, so they start no run. The connector logs show each rejected call and its number. Caller numbers can be faked, so don't rely on this list alone to protect sensitive data.

Waiting callers

Every call is a run, so the agent takes as many calls at once as its max_concurrent_runs allows. Further callers wait in line and reach the agent in the order they called. While they wait, they hear the ringing tone or the connector's hold audio. A caller still waiting after the maximum wait goes to the fallback number; without one, the call ends and its run fails.

If the hold audio file is missing or can't be played, waiting callers hear the ringing tone and the connector logs show why. A changed file plays once it's deployed.

Transfers and fallback

When an agent tool raises TransferCall with one of the connector's transfer numbers, Telnyx transfers the caller to that number. If nobody answers there, the call ends. The fallback number applies only to incoming calls in sync mode and not to transfers. If an accepted call can't continue, for example because the run fails, the media stream can't start or the caller waited the maximum wait, Telnyx transfers it to the fallback number instead. Without a fallback number, or if Telnyx rejects the transfer, the call is hung up.

Calls connic doesn't answer, for example while the connector is paused or the environment has no active deployment, are not forwarded. Telnyx ends them after 30 seconds.

Provider setup

When you create the connector, connic creates a Call Control application for the number with the connector's webhook URL, clears the number's technical prefix and destination rewrite, and assigns the number to the application. It doesn't change the number's messaging settings. connic refuses a number with call forwarding turned on and a number that another connic voice connector holds.

In outbound mode, connic creates its own Call Control application with the connector's webhook URL and the chosen outbound voice profile, and changes nothing on the number. Deleting the connector deletes that application.

Telnyx routes call audio through the AnchorSite set on the application. To keep it in Europe, choose a European site on the connector's application in the Telnyx portal. connic leaves this setting unchanged; an application connic creates for a new number starts with Telnyx's default.

Assigning the number replaces its previous voice connection or application. connic writes the previous assignment and the cleared prefix and rewrite to the connector's logs and to the project's audit log, which keeps them after the connector is deleted. Deleting the connector doesn't restore them.
  • Edit the Connection to rotate the credentials. Edit the connector to choose another Connection or number.
  • When you switch numbers, connic creates a new application for the new number and detaches the previous number. After the change is saved, it deletes the old application if it still belongs to this connector and has no numbers assigned.
  • Deleting the connector detaches the number only if it is still assigned to the unchanged connic application, then deletes that application once it has no numbers. Changes you made in Telnyx after setup are kept.

Limits and errors

LimitValue
Linked agentsExactly one, with voice_config in the environment's active deployment
Transfer numbers20 per connector
Allowed callers100 per connector
Maximum wait0 to 900 seconds; 30 by default
Ring time5 to 120 seconds; 30 by default
Hold audioMP3 or WAV, up to 10 minutes
Incoming calls1,000 per minute per connector. Telnyx gets 429 for more.
Unanswered callsTelnyx ends a call after 30 seconds without an answer from connic.
Event signaturesconnic rejects events whose timestamp is more than 5 minutes off.
Call lengthThe agent's timeout, capped by the plan's run timeout; 60 minutes on Pro
Active connectorsAt the plan's active connector limit, creating the connector fails with 403 instead of creating it paused, because it would change the number in Telnyx. A deploy that would create the connector or bring it back at the limit fails.
Error or symptomWhat to do
Disable the selected number's call forwarding in Telnyx before connecting itTurn off call forwarding on the number in Telnyx, then create the connector again.
This number already belongs to a connic voice connectorDelete that connector first, or choose another number.
Select an active Telnyx phone numberChoose a number whose status in Telnyx is active.
Enter the Telnyx account's base64-encoded Ed25519 public keyCopy the public key from the API Keys settings of the same Telnyx account.
Request rejected: invalid Telnyx signatureThis connector log entry means the Connection's public key doesn't belong to the account that sends the events. Copy the public key of the same Telnyx account into the Connection.
Telnyx request failedCheck that the API key can access the account's phone numbers and Call Control applications.
Multiple matching connic Call Control applications existRemove the unused duplicates in Telnyx, then retry.
Could not detach the connic Call Control applicationDetach the application from the number in Telnyx, then delete the connector again.
Deploy this agent with voice_config before linking a voice connectorAdd voice_config to the agent and deploy it to the connector's environment.
Calls aren't answeredCheck that the connector is active and linked to exactly one agent with voice_config in the active deployment. Compare the run error with the call logs in Telnyx; Telnyx documents its media streaming protocol.