Transfer functions
Hand callers off to a human — another phone line, or a SIP address on your own PBX — when the assistant can't help. How to set it up, what the destination sees, the IP allowlisting a SIP endpoint needs, and how to make sure your Twilio trunk doesn't reject the transfer.
A transfer function hands a live caller off to another phone number — or, for advanced setups, to a SIP address on your own PBX / call centre. Your assistant decides when to fire it — typically "I want to speak to a human", a complaint that needs escalation, or a request the agent can't handle. The destination rings, the caller is bridged through, your agent's role ends.
Under the hood this is a SIP REFER — the SIP standard for call transfer. It works on any provisioned dBel phone number out of the box. If you imported your own Twilio number, read the Twilio trunk section below before declaring victory.
Creating a transfer function
- Open Functions in the sidebar, then open the Call Transfer tab (it opens by default).
- Click New Function. The Create Call Transfer Function form opens.
- Fill in:
- Name — letters/numbers/underscores only. The LLM sees this name when it decides which function to call, so make it descriptive:
transfer_to_dispatch, notfunc1. - Transfer destination — choose Phone number (the default) or SIP address (advanced):
- Phone number — a United States, Canada or Australia number. Transfers go only to these three countries; US territories such as Puerto Rico count as other countries. Pick the country from the dropdown. We normalise the number to E.164 when you save, so you can type the local format (we strip the trunk prefix, such as the leading 0 on an AU mobile).
- SIP address — a
sip:/sips:URI for your own PBX or call centre (e.g.sip:support@pbx.example.com). This needs setup on your SIP endpoint — see Transferring to a SIP address.
- Prompt — when the agent should call this function. Be specific: "When the caller asks to speak to a human, escalates a complaint, or asks for something only a person can resolve." Vague prompts ("for hard questions") cause the LLM to either over-transfer or never transfer.
- Name — letters/numbers/underscores only. The LLM sees this name when it decides which function to call, so make it descriptive:
- Click Create Function.
- Attach it to an assistant. Open Assistants → <your assistant>. On the Setup tab, under Attach Function, select the new function. Functions belong to the workspace, so you can attach one function to several assistants.
A function does nothing until you attach it. After you attach it, every call that starts from then on can use it. A call already in progress keeps the functions it started with.
You can attach multiple transfer functions to one assistant — e.g. transfer_to_sales and transfer_to_support with different destinations and prompts. The LLM picks the one whose prompt best matches the caller's intent.
Availability window (business hours)
A transfer function can carry an optional availability window — the hours a human is actually reachable at that destination. Outside those hours the assistant doesn't transfer: it tells the caller no one's available, states the hours, and keeps helping with anything else.
Turn on Human availability window when you create or edit the function (it sits below the destination). A window is a single same-day range:
- Timezone — a fixed UTC offset for the destination, picked from a list such as "Pacific Standard Time (US & Canada) (-08:00)". It starts at UTC (+00:00), so pick the offset of the destination. The window is checked at this offset, independent of the assistant's operating timezone. The offset does not follow daylight saving. If the destination observes daylight saving, change the timezone to the entry with the offset in effect when the clocks change. Otherwise the window runs one hour off for part of the year.
- Days — which days of the week the window applies.
- Opens / Closes — the start and end times. They are stored as 24-hour HH:MM; your browser may show them as AM/PM. Same-day only — no overnight ranges (e.g. 22:00–06:00 isn't supported in one window). You can split an overnight range across two transfer functions (22:00–23:59 and 00:00–06:00). The assistant can't see the windows, so say in each function's Prompt which hours it covers. Otherwise it may pick the closed one and tell the caller no one is available. The closing time is exclusive and the latest is 23:59, so the minute from 23:59 to midnight is not covered.
What the caller hears:
- In hours → normal transfer; the destination rings as usual.
- Out of hours → no transfer is attempted. The assistant says something like "No one's available to take the transfer right now — they're available Monday to Friday, 9:00 AM to 5:00 PM. Is there anything else I can help with?" — the actual configured hours, so "try again then" is actionable.
Two things worth knowing:
- It fails open. The dashboard and the API refuse to save an invalid window (an unknown timezone, no days, or a start that isn't before the end). If a stored window still can't be read at call time, the assistant transfers anyway rather than stranding a caller who needs a human.
- Out-of-hours ≠ a failure. The "no one's available, hours are X" message is only used for the availability gate. A genuine technical failure (a
480/415/403from the destination) gives a separate "couldn't connect right now" message that deliberately never mentions hours — so a real fault is never misread as "we're just closed, call back later."
No window configured = transfers fire any time, 24/7 (today's default).
What the destination sees (caller ID)
When the transfer connects, the destination's phone shows the original caller's caller ID — not your dBel/Twilio number. So when Dan answers his ringing phone, he sees the customer's number, not yours. This is the natural UX: Dan can pick up with "hi, this is Dan, calling back about earlier?" without you having to brief him on who it is.
If you need the destination to see your number instead (for example, for a billing audit):
- On an imported Twilio number, change Caller ID for Transfer Target on your own Twilio trunk (step 4 in the next section). Twilio documents the setting in its call transfer guide.
- On a dBel-provisioned number you can't change it. All dBel-provisioned numbers share one platform trunk, and the setting applies to the whole trunk.
Twilio trunk: required configuration for imported numbers
This is the part that bites customers in production. Skip this section if all your phone numbers are dBel-provisioned — we handle the trunk config for you.
If you imported your own Twilio number, your own Twilio SIP trunk needs to allow SIP REFER. Twilio defaults new trunks to transfer_mode = disable-all, which silently rejects every REFER we send (see TransferMode in Twilio's Trunk resource). The caller hears a short "connecting you" line, then the assistant apologises that the transfer couldn't go through. The call's Function Calls entry shows the transfer as failed.
dBel sets the right value (enable-all) when you connect your Twilio account under Integrations, and again each time you import a number. If transfers still fail, check the setting by hand. These are Twilio's Console names today, and Twilio can change them (Twilio's call transfer guide):
- Twilio Console → Elastic SIP Trunking → Trunks → <your dBel-named trunk>.
- General Settings tab → Call Transfer (SIP REFER) → set to Enabled.
- Make sure Enable PSTN Transfer is checked — without it, transfers to regular phone numbers (
tel:+...) are still rejected even with REFER enabled. (Behind the scenes both checkboxes are the sameTransferModefield — Enabled + PSTN-checked maps toenable-all.) - Caller ID for Transfer Target → leave at the default "Set caller ID as Transferee" unless you have a specific reason to change it.
- Save.
What about Symmetric RTP?
You'll see a Symmetric RTP toggle on the same Twilio settings page. Leave it disabled.
This is contrary to the tooltip Twilio shows in the UI — but Twilio's own official guidance is to keep Symmetric RTP disabled to mitigate an RTP Inject/Bleed vulnerability. The actual security recommendation is Secure Trunking (TLS + SRTP), which we already enable on every trunk we provision (Secure: true). You don't need to do anything else.
If you're seeing one-way audio on calls after enabling everything else and you can't find another cause, then — and only then — try enabling Symmetric RTP as a NAT workaround. It's not a default-on setting.
Transferring to a SIP address
Most transfers go to a phone number. Advanced: you can instead transfer to a SIP address — a sip: (or sips:) URI pointing at your own PBX, call centre, or SIP provider. It must include a user part (sip:support@pbx.example.com, sip:1001@pbx.example.com, sip:agent@company.sip.twilio.com). The form won't save a host-only URI, because a transfer to one fails with 403: No username in AOR. Pick SIP address (advanced) in the Transfer destination dropdown and enter the URI.
Twilio SIP Domains generally require SIP Registration and a registered SIP endpoint for cold REFER transfers — a Voice URL alone may not be sufficient (see Twilio's SIP guide). If you're using a Twilio SIP Domain, test a real transfer before relying on it in production.
Reaching a registered Twilio SIP Domain endpoint is region-sensitive. This applies only when your transfer destination is a registered endpoint on a Twilio SIP Domain (e.g.
sip:alice@you.sip.twilio.com): that registration is associated with a Twilio Region, and Twilio only connects it from calls processed in that same Region. dBel doesn't control which Twilio Region processes the cold-REFER onward leg to the SIP Domain. Depending on the inbound call path and carrier routing, that Region may differ from the Region associated with the endpoint's registration. Symptom: the same online softphone is reachable via one route but returns480 "not currently registered"via another, even though it never went offline. Twilio describes the rule in Regional SIP Domains. This is a Twilio SIP Domain registration behaviour, not a general transfer limitation. An IP-addressable SIP endpoint (your own PBX/SBC at a hostname or IP) or a phone number has no such Region binding. For reliable transfers, prefer a phone number (tel:) or an IP-addressable SIP endpoint.
It's the same cold SIP REFER under the hood — but instead of dialling a phone number over the PSTN, the carrier connects the caller straight to your SIP endpoint over the internet. That changes one thing: your SIP endpoint has to be willing to accept the call.
Your SIP endpoint must accept Twilio-originated calls
For Twilio-backed calls, your SIP endpoint must accept transferred calls from Twilio's SIP signaling infrastructure. A SIP endpoint exposed to the internet won't — and shouldn't — accept calls from just anyone, so you need to tell it to trust Twilio, almost always by IP allowlisting.
These are Twilio's signaling ranges — not dBel-owned IPs — and Twilio can change them. The authoritative, current list lives in Twilio's SIP Trunking IP addresses doc; treat that as the source of truth and re-check it periodically.
Because Twilio routes through regional edge locations, a transferred call can originate from any of Twilio's regional signaling ranges — so allowlist all of them (or pin your trunk to a single edge). The SIP signaling ranges (ports 5060 UDP/TCP and 5061 TLS), current at the time of writing:
| Region | CIDR Network Address | Range |
|---|---|---|
| US East (Virginia) | 54.172.60.0 | /30 |
| US West (Oregon) | 54.244.51.0 | /30 |
| Europe (Ireland) | 54.171.127.192 | /30 |
| Europe (Frankfurt) | 35.156.191.128 | /30 |
| APAC (Tokyo) | 54.65.63.192 | /30 |
| APAC (Singapore) | 54.169.127.128 | /30 |
| APAC (Sydney) | 54.252.254.64 | /30 |
| South America (São Paulo) | 177.71.206.192 | /30 |
Each /30 is a block of 4 consecutive addresses — e.g. 54.172.60.0/30 covers 54.172.60.0 through 54.172.60.3. Twilio's Access Control List (and most firewalls / SBCs) accept the CIDR directly — enter the network address and pick the /30 range. If your firewall only takes single IPs, Twilio's SIP Trunking IP addresses doc lists every individual address.
These cover SIP signaling (the INVITE that rings your endpoint). If your PBX/SBC also filters media / RTP, Twilio sends media from its global media-gateway range 168.86.128.0/18 (UDP, ports 10,000–60,000) — allowlist that too. Check the range against Twilio's SIP Trunking IP addresses, because Twilio can change it.
Who configures what
- dBel-provisioned numbers — the transfer is carried by dBel's platform Twilio trunk. dBel manages the trunk; you configure your SIP endpoint to accept the Twilio ranges above.
- Imported / BYO Twilio numbers — the transfer is carried by the trunk dBel made in your own Twilio account. dBel turns on SIP REFER / call transfer on that trunk for you (see the section above, which also shows how to check it). You configure routing + allowlists on your SIP endpoint. The ranges are still Twilio's, but verify them against your own Twilio account.
- Connect via SIP Trunk (your own carrier / PBX) — the transfer is carried by your own carrier or PBX trunk — not Twilio's, not dBel's. On that trunk you must enable call transfer (SIP REFER) and, for transfers to a phone number (
tel:), the separate PSTN-transfer permission; international phone destinations also need outbound-dialing permission for that country. Allowlisting on the destination side uses your carrier's signaling IPs, not Twilio's. Full checklist → Connect via SIP Trunk.
Username/password SIP authentication isn't supported
A cold REFER hands the carrier only a destination URI — there's nowhere to carry SIP digest credentials. So a SIP endpoint that requires a username/password can't be authenticated on this path; use IP allowlisting instead. Authenticated SIP destinations aren't supported.
This is advanced — test it
SIP routing is provider- and PBX-specific. Not every external sip: / sips: endpoint will accept a cold REFER, and behaviour varies by SBC/PBX. Place a real test transfer to your endpoint before relying on it in production.
Limitations
- Browser calls (playground and web widget) don't actually transfer. There's no phone leg to REFER. We log the attempt as
skipped:not_sip, and the assistant tells the caller that transfer is only available on phone calls. The availability window isn't checked on these calls either. Test the LLM's tool-selection logic in the playground; test the real transfer and the hours gate on a phone call. - No "warm" transfer. Today's transfer is cold — the agent hands the caller over and disconnects. The person who answers gets no context and may need to ask the caller to repeat themselves.
- No pre-transfer deflection. The transfer fires as soon as the LLM decides the prompt matches. There's no built-in "before I transfer you, I can also help with X — want me to try?" flow. You can shape this in the main assistant prompt ("If the caller asks for a human, first offer to help with bookings or hours before transferring").
- One destination per function. Each transfer function has a fixed destination. To limit a destination to business hours, set its availability window. To send after-hours callers somewhere else, create a second transfer function with a distinct prompt (
transfer_after_hours) — the window blocks an out-of-hours transfer but doesn't reroute it. - SIP destinations are advanced and need endpoint setup. Transferring to a
sip:URI requires your SIP endpoint to accept Twilio-originated calls (IP allowlisting). Username/password-authenticated SIP destinations aren't supported. See Transferring to a SIP address.
Troubleshooting
Every failed transfer is recorded on the call with result: "failed". The call-detail Function Calls timeline shows the destination and (failed). The post-call webhook's functionExecutions[] also carries sipStatusCode / sipStatus when the carrier or destination returned one, so you can alert on the exact reason there; the codes below map to the same sipStatusCode values. See Webhooks → Reading transfer outcomes.
The agent says "the transfer could not be completed" every time. Almost always a trunk config issue. For imported numbers, check the Twilio trunk settings above. For dBel-provisioned numbers, contact support — our platform trunk should be configured but verify nothing's drifted.
The agent never tries to transfer. The LLM didn't think the caller's intent matched your function's prompt. Try strengthening the prompt with explicit trigger phrases ("when the caller says 'human', 'agent', 'person', 'representative', 'manager'"). Or pull up the call detail page and check whether the LLM's response acknowledges the transfer request — if it apologises without firing the function, the prompt is too vague.
Transfer "succeeds" but the destination phone never rings. SIP REFER reached the carrier but Twilio rejected the onward dial. Check the destination number is valid and in service. If it's a long-distance / international destination, your Twilio account may need international permissions enabled — separate from the trunk setting.
Transfers fail only on Australian destinations.
Check the stored number doesn't have an extra 0 after +61 — +610427988214 is invalid (the AU trunk prefix 0 must be stripped in E.164). Re-save the transfer function; we normalise on save.
A SIP transfer shows skipped:invalid_destination.
The stored SIP URI isn't a valid sip:user@host address — for example, a host-only URI saved before the form checked for a user part. The assistant doesn't attempt the transfer. Open the function, add a username (sip:user@host) and save.
SIP transfer fails with 480: SIP Registered User is not currently registered on a Twilio SIP Domain.
The SIP URI resolved to a registered endpoint that isn't reachable. For Twilio SIP Domains, cold REFER transfers require SIP Registration and an active registered client/PBX — and the call must be processed in the same Twilio Region the endpoint registered in. The second part bites BYO/Connect-via-SIP-Trunk callers: an endpoint that's genuinely online can still return 480 if the inbound call's region differs from the registration's region (see the region note under Transferring to a SIP address, and Twilio's Regional SIP Domains). For reliable transfers, use a phone number or an IP-addressable SIP endpoint.
SIP transfer fails with 415: Unsupported Media Type (often the call rings, then drops).
The destination rejected the offered media — a negotiation problem at the far end, not signalling or registration. Two common causes: (1) no shared audio codec — the destination must accept the standard telephony codecs (G.711 µ-law/a-law); (2) an encryption mismatch — the destination expects encrypted media (SRTP) and the offer is plain RTP, or vice versa (e.g. a softphone with SRTP/SDES disabled receiving an SRTP-only offer, or a Twilio SIP Domain with Secure Media enabled offering SRTP to an endpoint that can't do it). This is a destination-side configuration issue: enable G.711 and align the destination's media-encryption setting (SRTP on/off) with what it's offered.
SIP transfers fail with a rejection (403/407) or never connect.
Your SIP endpoint refused the Twilio-originated call. A 403 or an unanswered INVITE usually means the source isn't allowlisted — add Twilio's SIP signaling ranges to your endpoint's allowlist (see Transferring to a SIP address) and confirm the sip: URI is reachable. A 407 (auth challenge) means the endpoint wants username/password authentication, which a cold REFER can't provide — switch the endpoint to IP-based trust instead.