SIP Integration with Gladly

SIP trunking is only available on the Synthflow Enterprise Plan.

This guide covers connecting Gladly to Synthflow via SIP trunk. Gladly routes inbound calls to a Synthflow AI agent through SIP forwarding; Synthflow can handle AI conversations and transfer callers to live Gladly agents when escalation is needed.

Prerequisites

RequirementDetail
GladlyActive account with Admin access; Voice channel and SIP forwarding enabled
SynthflowEnterprise Plan with a configured AI assistant (v2.0+)
Phone NumberAt least one DID provisioned in Gladly (E.164 format)
NetworkFirewall allows SIP (UDP/TCP 32681 or TLS 32682) and RTP media (G.711) between Gladly and Synthflow

Gladly Configuration

All configuration is done in the Gladly Admin panel under SettingsVoice.

Configure SIP Forwarding

Gladly Voice supports forwarding calls to external SIP destinations.

  1. In Gladly Admin, go to SettingsVoiceSIP Configuration.
  2. Under External SIP Destinations, click Add Destination.
  3. Configure the forwarding destination:
FieldValue
NameSynthflow AI
SIP DomainYour Gladly SIP domain (e.g. {company}.sip.gladly.com)
SIP Address{synthflow_did}@{company}.sip.gladly.com;transport=tls
Media CodecG.711 (PCMU/PCMA)
TransportTLS
  1. Under IP Allowlist, add Synthflow’s SIP signaling IP addresses. Contact Synthflow support for the current IP list.
  2. Save the configuration.

Gladly uses TLS for SIP signaling. Ensure transport=tls is appended to the SIP address.

Pass Caller ID via X-Header

To pass the caller’s phone number to Synthflow for context:

  1. In the SIP forwarding configuration, add the following X-header to outbound INVITE requests:
    • X-Gladly-Caller-Id: {caller_e164} (caller’s E.164 number with + prefix)
  2. For routing to specific queues, add the optional routing header:
    • X-Gladly-Routing-Selector: {topic} (e.g. billing, support)

The X-Gladly-Caller-Id header ensures Synthflow can identify the caller and pass this context to the assistant.

Configure Inbound Routing

  1. In Gladly, go to SettingsVoicePhone Numbers.
  2. Select the inbound phone number you want to route to Synthflow.
  3. Set the routing action to Forward to SIP and select the Synthflow AI destination.
  4. Configure a fallback action (e.g., route to agent queue) for when Synthflow is unavailable.

Configure Transfer Back to Gladly (AI → Live Agent)

To enable Synthflow to transfer a call to a Gladly agent:

  1. Note your Gladly SIP domain and the DID mapped to the target agent queue or topic.
  2. Configure Synthflow’s transfer action to route to:
    • {agent_queue_did}@{company}.sip.gladly.com;transport=tls
  3. Optionally include ?X-Gladly-Routing-Selector={topic} to route to a specific Gladly topic queue.

Synthflow Configuration

Add the SIP Number

  1. Go to the Synthflow Phone Numbers page.
  2. Click Add NumberCustom / SIP.
  3. Enter the phone number in E.164 format (same DID provisioned in Gladly).
  4. Fill in the SIP connection details:
FieldValue
Termination URIYour Gladly SIP domain (e.g. {company}.sip.gladly.com)
SIP UsernameYour Gladly SIP authentication username (if credential auth is enabled)
SIP PasswordYour Gladly SIP authentication password (if credential auth is enabled)
Outbound Proxy (if required)Leave blank unless Gladly specifies a proxy

Gladly primarily uses IP-based SIP authentication. Synthflow’s IPs must be in the Gladly allowlist for calls to be accepted.

Be precise when copying SIP credentials. Incorrect values will cause registration failure.

Attach to the Assistant

  1. Go to Assistants and create or select an assistant (v2.0+).
  2. In the assistant settings, attach the SIP number you just created.
  3. Wait 1–2 minutes for SIP registration to complete.

The SIP trunk is created at the moment of attaching the SIP number to the assistant.


Call Flow Summary

ScenarioFlow
Inbound to AICaller → PSTN → Gladly → SIP Forward (TLS) → Synthflow AI Agent
AI transfers to live agentSynthflow AI → SIP transfer → Gladly SIP domain → Topic Queue → Live Agent
Queue-based routingGladly (X-Routing-Selector header) → Synthflow AI → handles call by topic

Verification

TestWhat to check
Inbound callCall the Gladly DID. Verify it forwards to Synthflow AI via SIP. Check two-way audio.
Caller ID headerVerify Synthflow receives X-Gladly-Caller-Id with the caller’s E.164 number.
Transfer to live agentTrigger escalation during a Synthflow call. Confirm the call lands in the correct Gladly topic queue.

Quick Troubleshooting

IssueFix
Registration failsVerify Termination URI is the correct Gladly SIP domain. Confirm Synthflow IPs are in the Gladly allowlist.
Calls not reaching SynthflowCheck SIP forwarding destination is correctly set in Gladly Voice settings.
TLS error on connectionVerify transport=tls is appended to the SIP URI. Check TLS certificates on both sides.
One-way or no audioEnsure G.711 codec is negotiated. Verify RTP ports are open bidirectionally.
Missing caller contextConfirm the X-Gladly-Caller-Id header is configured in Gladly’s SIP forwarding settings.
Transfer goes to wrong queueVerify the X-Gladly-Routing-Selector value matches a valid Gladly topic name.

Reference

  • Gladly Voice Documentation: help.gladly.com (search “Voice SIP”)
  • Gladly SIP Routing: help.gladly.com (search “SIP Forwarding”)
  • Synthflow SIP Overview: docs.synthflow.ai/about-sip
  • Synthflow X-EI SIP Header: docs.synthflow.ai/x-ei-sip-header