SMS functions
Let your assistant text a caller during a call — a link, an address, the details they asked for. How to create a Send SMS function, attach it, what happens on the call, and how to see whether a text went out.
A Send SMS function lets your assistant text the caller during a call: a link, your address, or the details the caller asked for. The assistant always asks first, and it sends the text only after the caller says yes.
SMS functions are available on Seed and above.
Before you start
The assistant needs a phone number that can text the caller. Check it first: on Phones, the SMS column shows each number's texting state. Which numbers can text whom is in Texting callers. A SIP trunk has no number to text from (Connect via SIP Trunk).
Create the function
- Open Functions in the sidebar, then open the Send SMS tab.
- Click New Function. The Create Send SMS Function form opens.
- Fill in:
- Name — letters, numbers and underscores only. The assistant sees this name when it decides which function to use, so make it say what the text is for:
text_directions, notfunc1. - Booking page (optional) — shows only when Cal.com is connected. Pick an event to text its booking page. See The Send-SMS text and your booking page.
- SMS Content — the text to send. Use the Insert variable button under the box to add a variable. The box also shows the price of a text.
- When should the assistant text the caller? — when the assistant should use this function. Be specific: "When the caller asks for our address or for directions."
- Name — letters, numbers and underscores only. The assistant sees this name when it decides which function to use, so make it say what the text is for:
- Click Create Function.
Attach it to an assistant
- Open Assistants and click the assistant.
- On the Setup tab, under Attach Function, pick the new function.
If the assistant's number can't send texts, you can't pick the function. Hover over it to read: "Attach an SMS-capable phone number to this assistant first." A function does nothing until you attach it. A call that is already in progress does not pick it up.
What happens on the call
- The caller asks for something your function covers, for example the address.
- The assistant asks whether it may text the caller. To a US mobile it reads a fixed consent script first.
- The assistant sends the text only after a yes. If the answer isn't clear, it asks once more. On a no, it sends nothing and carries on.
The consent script, how often the assistant asks, and what a text looks like are in Texting callers. A call sends two texts at most.
Prices. A text from a number bought through dBel is billed per message: see the pricing page. Twilio bills texts from a number you imported, on your own Twilio account.
Check a text
- Open Call Logs and click the call.
- Find the text under Function Calls.
What the row shows:
- A text that went out shows To and the number, the text as sent, and the message ID that Twilio gave it.
- A text that Twilio refused shows Text not sent, then Twilio error and a code. Look up the code in Twilio's error list.
- A text the assistant did not send shows skipped: and a reason, for example
no_consentwhen the caller did not say yes. The webhooks guide lists every reason underfunctionExecutions[].
For a booking's confirmation text, the booking row says Text sent or Text not sent.
Three Twilio errors you may meet on an imported number, and what the row shows for each:
- 21408 — your Twilio account can't text that country. The row shows Text not sent and Twilio error 21408. Turn the country on in Twilio's Messaging geographic permissions: see Twilio's page, error 21408.
- 60250 — Twilio needs an approved business profile on the sending account to text Australian numbers. The row shows skipped:
au_registration_missing. See Twilio's page, error 60250. - 21610 — the person replied STOP to an earlier text from that number. The row shows skipped:
sms_opted_out. See Twilio's page, error 21610.
Twilio's pages say what each code means today, and its codes can change.