> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a voice agent with Sinch Elastic SIP Trunking

> Connect a static SIP endpoint and separate call credentials.

## Overview

Connect an existing **Sinch Elastic SIP Trunking** number to a Voiceflow Voice agent through a static, non-registering SIP endpoint. Sinch routes the call to Voiceflow's hosted SIP hostname; Voiceflow runs the spoken conversation. This walkthrough uses digest authentication in both directions, with separate credentials for incoming calls and callbacks.

**Note:** 

**Choose the right Sinch product:** these instructions use Elastic SIP Trunking (EST). Sinch Voice API applications and [Sinch SMS](/docs/guides/channels/sms/sinch) have different configuration. A registered SIP device is not the endpoint taught here.

<a id="prepare-sinch"></a>

## Before you begin

Prepare the EST resources and the Voiceflow agent that will answer.

| Owner | Required input |
| --- | --- |
| Agent builder | An editable [Voice agent](/docs/guides/studio/voice/first-phone-call), speech configuration, approved support answers and a test Environment with a recognizable greeting. |
| Voiceflow administrator | Phone-management/project edit access, available SIP allowance and access to resolve the project's runtime key for assignment. |
| Sinch administrator | An EST-enabled project, existing voice number and permission to edit trunks, endpoints, credentials and number assignment. Retain the current trunk and endpoint configuration. |
| Tester | A separate controlled phone, a known question/follow-up and a teammate at a distinct support destination if transfers are needed. |

Create two dedicated credential pairs: one that Sinch supplies to Voiceflow, and one that Voiceflow supplies to Sinch. The Sinch administrator hands over their purpose, username and password securely; the Voiceflow administrator confirms which pair each direction consumes. Sinch access keys manage EST resources through its API and do not replace SIP credentials.

Use a separate test number/trunk first. Confirm the account's calling destinations and the actual number authorized as Caller ID. Number eligibility and emergency-address setup remain with the Sinch administrator; do not use emergency numbers for testing.

<a id="connect-sinch"></a>

## Connect inbound calls

Pair the static Sinch endpoint with a credential-protected Voiceflow hostname.

### 1. Create the Voiceflow SIP connection

Open the Voice project's **Phone numbers → Create number → SIP → Voiceflow SIP** in [Agent studio](https://creator.voiceflow.com). Enter a name, choose **Credentials**, and enter the inbound pair Sinch will send when challenged. Choose **Create**, copy the full **SIP address**, and inspect its agent assignment. From **Environment**, select the test Environment and **Draft**, then **Save**. Assign the agent separately after workspace-level creation.

### 2. Create a dedicated Sinch trunk

In the [Sinch Build Dashboard](https://dashboard.sinch.com), open **Elastic SIP Trunking → Trunks → Create New SIP Trunk**. Enter a distinctive trunk name and unique domain, then create it. Retain the generated termination domain for later outbound configuration. See [Sinch's trunk setup](https://support.sinch.com/hc/en-us/articles/55179672219923-How-do-I-create-a-SIP-trunk).

### 3. Add the static endpoint and its inbound credential

Choose **Add an Endpoint → Static**. Enter a descriptive name, the full Voiceflow hostname in the endpoint address, port `5060`, UDP transport and priority `1` for the initial test. Save it, reopen that endpoint and select its **Credential**: create/select the inbound username/password matching Voiceflow's **Credentials** configuration. This credential lets Sinch answer Voiceflow's digest challenge; do not select a registered endpoint.

Sinch's [digest-authentication guide](https://community.sinch.com/t5/Elastic-SIP-Trunking/How-do-I-configure-Digest-Authentication/ta-p/15299) distinguishes endpoint credentials from a trunk's outbound credential list. Its [EST test plan](https://developers.sinch.com/docs/est/test-plan) supports an FQDN on a static endpoint. Preserve that hostname rather than pinning a resolved address.

### 4. Assign the controlled number

Open the existing number in Sinch **Numbers → Active numbers** and assign its voice service to the new EST trunk. Save and reopen the number to confirm its trunk association. Inspect endpoint priority before cutover: lower numbers are tried first, while equal-priority endpoints distribute calls. Keep only the intended primary at that priority during the test. See [Sinch number assignment](https://developers.sinch.com/docs/est/api-reference/est/phone-numbers).

The Voiceflow hostname selects the connection; its assignment selects the agent/release for every number routed there. The SIP caller identity supplies the conversation's caller information, independently of the digest username. Do not use telephone Caller ID alone to authorize account actions. Voiceflow owns the ongoing audio and turns; the [SIP network reference](/docs/api-reference/agent-runtime/voice/sip/settings#network-and-media) owns media and transport details.

<a id="outbound-and-transfers"></a>

## Configure callbacks and transfers

Give Voiceflow a separate termination credential and a reachable support route.

### 1. Authorize calls into Sinch

In Sinch **Elastic SIP Trunking → Credential Lists**, create a list with the dedicated outbound username/password. Open the trunk's **Outbound Call Settings**, attach this list and save. If an ACL is also attached, Sinch enforces both checks: obtain the [Voiceflow signalling egress allowlist](/docs/api-reference/agent-runtime/voice/sip/settings#network-and-media) and have the carrier administrator approve those sources. Do not use media addresses as SIP sources.

### 2. Save the Voiceflow outbound peer

Enable **Outbound calls and transfers** on the Voiceflow connection and configure:

| Voiceflow field | Sinch value |
| --- | --- |
| Address | The trunk's generated termination domain, such as the actual domain replacing `northstar.pstn.sinch.com`. No scheme or embedded port. |
| Protocol / Port | UDP / `5060` for this initial setup. |
| Username / Password | The credential in the list attached under **Outbound Call Settings**. |
| Caller ID | The actual authorized Sinch number in E.164. |

Save and reopen to inspect the values. If encryption is required, configure matching TLS/SRTP on both systems and follow [Voiceflow encrypted audio](/docs/api-reference/agent-runtime/voice/sip/settings#encrypted-audio). Changing signalling to TLS alone does not prove encrypted media.

### 3. Prepare the backend callback

Retain `SIP_CONNECTION_ID` from this connection's **Outbound call API → View**. The Voiceflow administrator supplies `VF_API_KEY`, a runtime key authorized for this project's read/version-read permissions. Set `TEST_RECIPIENT` to a separate E.164 phone you can answer. When ready to place a real call, run:

```sh
jq -n --arg to "$TEST_RECIPIENT" '{to:$to}' |
curl --fail-with-body --silent --show-error \
  "https://runtime-api.voiceflow.com/v1/sip-connection/$SIP_CONNECTION_ID/outbound" \
  -H "Authorization: $VF_API_KEY" -H 'Content-Type: application/json' --data-binary @-
```

The request uses the saved connection assignment. HTTP `200` returns an empty body, not a call ID or pickup result. Inspect Sinch's call record before retrying an ambiguous request. The [outbound reference](/docs/api-reference/agent-runtime/voice/sip/outbound) owns exact validation and failure responses.

### 4. Set a transfer destination

Configure **Agent → Call forward** or a Workflow **Call forward** step with a separate support destination and a clear transfer condition. For a phone target, verify the actual Caller ID and carrier destination policy. For a transfer back through Sinch, choose **SIP address** with `sip:<support-number>@<your-domain>.pstn.sinch.com`, using the actual E.164 support number and trunk domain. Sinch treats a same-domain REFER with a new number as a new PSTN leg subject to outbound rules. A different-domain target has different routing behavior. Sinch's [REFER instructions](https://support.sinch.com/hc/en-us/articles/55508462818963-How-do-I-use-call-transfers-with-SIP-REFER) describe its carrier behavior; confirm your trunk's transfer configuration before relying on it. See [Transfer a phone caller](/docs/guides/studio/voice/transfer-calls) and the [SIP transfer contract](/docs/api-reference/agent-runtime/voice/sip/transfers).

<a id="test-calls"></a>

## Test the caller journey

Check the complete EST route with speech, context and call completion.

### 1. Call the assigned Sinch number

Use a separate controlled phone. Expect the test release's greeting. Ask a known support question and listen for the complete answer; confirm both directions of speech work.

### 2. Continue and terminate the call

Ask a follow-up referring to the previous answer. Expect an appropriate response in the same conversation. Hang up, confirm the carrier call ended and inspect the matching Voiceflow [Transcript](/docs/documentation/measure/transcripts). Make a fresh call to check repeat routing and the intended release.

### 3. Test callbacks and transfers independently

If configured, use the request above for one callback and verify Caller ID, speech and completion. In a separate inbound call, ask for the configured transfer; the teammate must receive the caller and speak both ways. Inspect Sinch's call records for both legs after hangup. A saved endpoint or accepted transfer is an intermediate result.

### No call arrives or only some calls arrive

Check number assignment, endpoint priority and inbound digest credentials.

Verify the number targets the intended EST trunk. Inspect its static endpoint's hostname, transport, enabled state, priority and selected Credential. Equal-priority endpoints can send some calls elsewhere. Repeated digest challenges indicate the inbound pair does not match Voiceflow. Check the Voiceflow agent/release assignment separately.

### Audio, outbound authentication or transfer fails

Check the failing leg rather than swapping credential pairs.

For one-way audio, compare negotiated codecs, SDP and the [media/network contract](/docs/api-reference/agent-runtime/voice/sip/settings#network-and-media). Outbound failures need the trunk's credential list, termination domain, Caller ID and any ACL checked together. A SIP transfer needs REFER enabled/accepted and a reachable destination. A rejected transfer may end the agent call; retain a tested support fallback. Use [SIP troubleshooting](/docs/api-reference/agent-runtime/voice/sip/troubleshooting) to classify the failure.

<a id="release-and-maintain"></a>

## Release and maintain the route

Keep agent publication and EST routing coordinated over time.

### 1. Publish and verify the released route

[Publish the reviewed Environment](/docs/documentation/deploy/environments/publishing), select **Published** in this SIP connection's **Environment** setting and save. **All environments** follows Published traffic-split routing. Repeat the caller test on a fresh call before assigning customer numbers.

### 2. Retain the deployment inventory

Record Sinch project/trunk/endpoint IDs, number association, endpoint priorities, credential purpose and the Voiceflow hostname/connection ID, agent and release. Store passwords securely. Monitor Sinch call records and Voiceflow Transcripts together. Rotate one direction's credentials on both consumers, then test fresh calls before changing the other direction.

### 3. Restore or retire

Restore the number's recorded Sinch voice-service/trunk association to roll back and test the previous service. Route all affected numbers away before deleting a shared endpoint or the Voiceflow connection. Unassigning an agent does not restore the carrier's old route.
