Developer resourcesRecipes

Working code for every part of a call

Clone a folder, add your credentials, and it runs. Most are under two hundred lines. The builds show what they look like assembled.

Featured

AI Agents

44

Tools & integrations 13

Let a voice AI agent call an API without your serverserverless API integration for voice AISignalWire makes the API call, so no service of yours is in the tool path.py yamlCommit a transaction from a callvoice transaction confirmationUse an allow-list to validate the caller's confirmation before one transaction tool commits the request.pyCover AI agent tool latency with fillersAI agent tool latency fillersPlay localized filler phrases or a hosted wait file while a slow AI agent tool finishes.pyCreate a hosted voice AI agent with one REST callhosted voice AI agent (no server)Turn the agent definition you would serve yourself into a resource SignalWire hosts, with one POST, then put a phone number on it with one more.py tsExtract structured data after a callpost-call structured data extractionGet typed fields out of a finished conversation instead of parsing a transcript.pyGive a voice AI agent a tooltool calling for voice AILet the model call your function, and decide what it gets back.py tsLet a browser dial your agent with no dashboard setupprogrammatic WebRTC voice agent accessCreate a dialable voice AI endpoint and a restricted guest token over REST, without configuring either in the dashboard.pyLet a voice AI agent see the caller's cameramultimodal voice AI with visionEnable visual input, choose a vision model, and play a filler while the voice AI agent analyzes the caller's camera.pyNormalize spoken dates and phone numbers in a voice AI tool handlerspoken input normalization for voice AITake a date and a phone number in the caller's words, turn them into an ISO date and an E.164 number in the tool handler, and read both back for the caller to check.py tsPush events from a voice AI agent to the browservoice-controlled website navigationReturn a JSON event from a voice AI agent tool and deliver it to the browser connected to the call.py yamlPut an AI agent in a web chat widgetAI web chat widgetA small gateway on your server holds the API token, mints a signed handle per visitor and forwards the page's messages to the AI Chat API. The page learns a publishable key and nothing else.py tsRun the same voice AI agent over text chatomnichannel AI agent (voice and text)Point the AI Chat API at the URL your voice agent already serves. Create a conversation, send turns, read the log, summarise and end it, with one agent definition for both channels.py tsWrite a reusable AI agent skillreusable AI agent skillsPackage a capability once and load it into any agent with one line.py

Governance 11

Collect required details in any order with a voice AI agentslot filling for voice AI agentsLet a caller give the required details of a report in any order, keep the checklist in the tool handlers, and refuse to file until every required detail is in.py tsEnforce an AI agent's next step in codecode-enforced AI conversation flowReturn the next allowed conversation state from code instead of letting the AI agent choose it.pyGet recording consent before recordingcall recording consentSpeak the disclosure and capture the answer before any audio is written to disk.pyShow the AI model only the fields it needsdata minimization for LLM promptsLoad the whole record, expose a curated slice, and keep the rest out of the prompt entirely.pyKeep per-call state server-side, keyed by call idserver-side session state for voice AIStore full per-call state on your server, keyed by call ID, and expose only the fields the voice AI agent needs.pyProtect AI agent tool webhooks with per-call tokensAI agent tool webhook authenticationMint a token for each call and AI agent tool, then reject missing, expired, edited, or mismatched tokens.pyRequire verification before unlocking AI agent toolsverification-gated AI agent toolsThe account tools do not exist in the model's world until a handler says the caller passed.pyControl which tools an AI agent can call at each stepper-step tool scoping for AI agentsAt each point in the conversation the model can only see the tools you allowed there.pyRun isolated personas behind one numbermulti-persona AI on one numberRoute one phone number among isolated sales, support, and billing AI personas, each with access only to its own tools.pyWalk a caller through steps they cannot skipguided AI conversation flowExpose only the next allowed AI agent tool at each step so callers cannot move backward or skip ahead.pyWrite call dispositions from data your handlers recordedcall disposition from handler dataBuild call dispositions only from qualification fields recorded by tool handlers, not from transcripts or model summaries.py
Builds 7
8 recipesRepositoryAI drive-thru ordering: a voice agent whose flow your code controlsA fast-food drive-thru demo built to show a voice AI agent run by a state machine in your code. Steps scope the tools, handlers move the flow, upsell rules run as code, and a live order board updates from events.scope-tools-per-stepenforce-state-transitions-in-a-tool-handlerpush-events-from-an-agent-to-the-browser+58 recipesRepositoryAI phone ordering: a voice agent working with a live backend in real timeA coffee shop ordering demo built to show a voice AI agent working with a real backend in real time. Every item is a tool call into the order system, nothing exists until a handler has recorded it, and the page shows each call as it happens.give-an-agent-a-toolpush-events-from-an-agent-to-the-browserlet-a-browser-dial-your-agent-with-no-dashboard-setup+510 recipesRepositoryEmbed a state-aware voice agent in your web pageEmbed a voice and video assistant that searches your documentation, knows the current page, and navigates visitors to relevant sections.ground-an-agent-in-your-docspush-events-from-an-agent-to-the-browsergive-an-agent-a-video-avatar+77 recipesRepositoryIVR navigator: an AI agent that works through phone menus to reach a humanAn IVR navigation demo built to show an AI agent dialing into an unknown phone tree, listening, and pressing the digits that serve a goal, without speaking. When it reaches a human it hands off with the full path it took.send-dtmf-to-an-external-ivrplace-an-outbound-ai-callscope-tools-per-step+48 recipesRepositoryOrder status desk: one omnichannel AI agent for web chat and phoneAn order status demo built to show one AI agent serving web chat and phone calls, with the conversation moving between the two without starting over. It answers questions about order status and declines everything else, on purpose.put-an-agent-in-a-web-chat-widgetrun-the-same-agent-over-textroute-a-call-to-an-ai-agent+52 recipesRepositoryCompetitor alerts on live calls: real-time agent assist from an AI listenerA sales-call demo built to show real-time agent assist: an AI listener rides along on a live call, notices when the customer names a competitor, and posts the alert to your server while the sentence is still being spoken. It never speaks into the call.run-an-ai-sidecar-on-a-live-callgive-an-agent-a-tool7 recipesRepositoryVideo blackjack dealer: a voice AI agent that controls the browserA blackjack game built to show a video AI agent controlling a web page in real time over WebRTC. Stepped conversation contexts run the hand, every card and chip change reaches the page as an event, and the dealer's voice is chosen on the page.scope-tools-per-stepenforce-state-transitions-in-a-tool-handlerpush-events-from-an-agent-to-the-browser+4

Voice

57

Call control 22

Answer an inbound callinbound call handlingAccept an incoming call, greet the caller, and hang up cleanly.py yamlBuild a conference callconference callingPut several legs in one room and control each member independently.py yamlCall from a browserWebRTC browser callingPlace a call from a web page into the same flow a phone reaches.ts pyConnect a PBX with a Domain ApplicationSIP trunking for a PBXAn IP-authenticated Domain Application takes inbound SIP from your PBX and a SIP Gateway carries calls back to it.py yamlStart, steer and stop live translation on a call in progressreal-time call translation over RESTSwitch translation on partway through a call, speak a translated line into it, ask for a summary, and switch it off, each with one REST command.py tsDetect a machine, fax tone or digits on a call in progressanswering machine detection (AMD) over RESTStart answering machine, fax tone or keypad detection on a call that is already up, and read the result at your webhook.py tsDetect an answering machineanswering machine detection (AMD)Use answering machine detection to classify a pickup as human or voicemail before playing the main message.pyEmbed a call widget with no backendclick-to-call widgetA sw-click-to-call element with a Click to Call token from the Dashboard and a destination address puts a call button on a page. No server of yours is in the call path.pyEnd or transfer a live call over RESTREST call control (hangup and transfer)Hang up a live call with a reason, send it to a new destination, or unbridge it from its peer, each with one REST command addressed to the call id.py tsPause and resume a call recording over RESTcall recording pause and resumeStart recording a live call from your own backend, pause it while a card number is read out, resume it, and stop it, all by control id over REST.py tsPlace an outbound callprogrammatic outbound callingDial a number from your own code and follow the call through to completion.pyPlay a prompt and collect digits or speech over RESTprompt playback and input collection on a live callSpeak a prompt into a live call from your own backend, stop it early, and collect keypad digits or speech, with the result delivered to your webhook.py tsReceive calls in the browserWebRTC softphone in the browserRegister a browser as a WebRTC endpoint with a subscriber token, then route calls to its address.py tsRecord a callcall recordingStart a recording and pick it up from the completion webhook.py yamlReduce background noise on a callAI noise suppressionTurn call noise reduction on or off in the call flow or during a live call through REST.yaml pyRegister a SIP endpoint and receive callsSIP endpoint registrationCreate SIP credentials for a softphone, register it as an endpoint, and route calls to its address.pySend DTMF to someone else's IVRautomated DTMF navigationSend programmed keypad tones during an outbound call to navigate an external IVR.pyStream call audio to a WebSocket that checks a bearer tokenauthenticated media streaming over WebSocketSend one side of a call, or both, to your own WebSocket over TLS, with a bearer token on the connection and your own metadata attached.py tsStream call audio to your own servermedia streaming and audio forkingCopy live call audio to your WebSocket or RTP server, then stop the stream by its control ID.yaml pyTake a voicemailvoicemailIf a bridge fails, play a voicemail prompt, record the caller's message, and send its download URL to a status webhook.yaml pyTranscribe a voicemail and text it to the ownervoicemail transcription (voicemail to text)Turn transcription on in a cXML Record, then text the owner the words and the recording link when the transcription callback arrives.py tsTransfer a SIP call with REFERSIP REFER transferHand a SIP call to another endpoint with a REFER, sending the destination URI and, when the far end asks for them, credentials.py ts

Routing & queueing 13

Build an IVR menuIVR menu (DTMF)Play a menu, collect keypad input, and route the caller to the right place.py yamlBuild an IVR without a serverserverless IVRCreate and assign a serverless IVR call flow through REST, without hosting a webhook server.pyCollect speech input and branch on itspeech recognition IVRAsk an open question, recognise the answer, and take a different path for each.py yamlForward calls to a phone and keep the caller's numbercall forwarding with caller ID pass-throughForward every call on a number to a phone, and show that phone the original caller's number instead of your own.py tsHost a TwiML bin without a serverhosted cXML script (TwiML bin)Store a cXML document on SignalWire with one REST call, get back the URL it is served from, and route a number to it, with no server of yours in the call.py tsLook up the caller and branch inside the call flowdata-driven call routing (CRM lookup)Have the call itself fetch the caller's record from your API, branch on a field of the reply, and still reach a human when the lookup fails.py tsOffer a callback instead of a holdvirtual hold with callbackCollect the caller's number and context, end the held call, then call them back with that context.pyQueue a call until an agent is freecall queuingCallers wait in a named queue with hold audio and are bridged in order as agents connect to it.yaml pyReject callers on a blocklist before answeringcall blocking and screening (blocklist)Read the caller's number when SignalWire fetches your call document, and decline a listed number before the call is answered while everyone else is connected.py tsRelay calls and texts through a proxy numberphone number masking (call and text by proxy)Pair two people on one number of yours so calls and texts between them are relayed with your number showing, and neither ever sees the other's.py tsRoute calls by dialed number or timetime-of-day call routingRead the dialed number and local time from each inbound webhook, then return the matching call flow.pyRoute SIP calls to AI agents by usernameSIP routing to AI agentsMap SIP usernames on one domain to different AI agents and return the selected agent's call flow.pyDial destinations in order or all at once, with a failure pathsequential and simultaneous ringDial destinations sequentially or simultaneously, then run a failure branch if no connection succeeds.yaml py

Governance 8

Check consent before an outbound calloutbound call consent and hours checksCheck stored consent and the callee's local calling window before your code sends an outbound dial request.pyExport recordings and enforce retentioncall recording retention and exportCopy recordings older than your retention window to your storage, then delete each SignalWire original after a successful copy.pyIssue a browser calling token restricted to chosen destinationsscoped WebRTC access tokensMint a short-lived browser token and restrict what it is allowed to call.pyIsolate tenants with subprojects and scoped tokensmulti-tenant isolation with scoped API tokensCreate a subproject for each tenant and issue API tokens limited to that subproject and an explicit permission list.pyLet your users buy a phone number through your appself-service number provisioning for tenantsGive each customer their own project and API token, then search, buy, route and release phone numbers with their credentials rather than yours.py tsRegister an E911 address for a numberE911 address registrationCreate an emergency address through REST, look up the phone number, and attach that address to it.pyVerify a caller id for outbound callscaller ID verificationThree REST requests register a number you own elsewhere as a verified caller ID. You submit the code you heard, and redial the verification call if you missed it.pyVerify a webhook signaturewebhook signature verificationThe gate refuses, with 403 and before any route runs, a request whose signature header does not match hex(HMAC(signing_key, url + raw_body)). X-Signalwire-SHA256-Signature decides when present; otherwise X-Signalwire-Signature, the SHA-1 one, does.py
Builds 6
8 recipesalso in AI AgentsRepositoryAI drive-thru ordering: a voice agent whose flow your code controlsA fast-food drive-thru demo built to show a voice AI agent run by a state machine in your code. Steps scope the tools, handlers move the flow, upsell rules run as code, and a live order board updates from events.scope-tools-per-stepenforce-state-transitions-in-a-tool-handlerpush-events-from-an-agent-to-the-browser+58 recipesalso in AI AgentsRepositoryAI phone ordering: a voice agent working with a live backend in real timeA coffee shop ordering demo built to show a voice AI agent working with a real backend in real time. Every item is a tool call into the order system, nothing exists until a handler has recorded it, and the page shows each call as it happens.give-an-agent-a-toolpush-events-from-an-agent-to-the-browserlet-a-browser-dial-your-agent-with-no-dashboard-setup+510 recipesalso in AI AgentsRepositoryEmbed a state-aware voice agent in your web pageEmbed a voice and video assistant that searches your documentation, knows the current page, and navigates visitors to relevant sections.ground-an-agent-in-your-docspush-events-from-an-agent-to-the-browsergive-an-agent-a-video-avatar+77 recipesalso in AI AgentsRepositoryIVR navigator: an AI agent that works through phone menus to reach a humanAn IVR navigation demo built to show an AI agent dialing into an unknown phone tree, listening, and pressing the digits that serve a goal, without speaking. When it reaches a human it hands off with the full path it took.send-dtmf-to-an-external-ivrplace-an-outbound-ai-callscope-tools-per-step+48 recipesalso in AI AgentsRepositoryOrder status desk: one omnichannel AI agent for web chat and phoneAn order status demo built to show one AI agent serving web chat and phone calls, with the conversation moving between the two without starting over. It answers questions about order status and declines everything else, on purpose.put-an-agent-in-a-web-chat-widgetrun-the-same-agent-over-textroute-a-call-to-an-ai-agent+57 recipesalso in AI AgentsRepositoryVideo blackjack dealer: a voice AI agent that controls the browserA blackjack game built to show a video AI agent controlling a web page in real time over WebRTC. Stepped conversation contexts run the hand, every card and chip change reaches the page as an event, and the dealer's voice is chosen on the page.scope-tools-per-stepenforce-state-transitions-in-a-tool-handlerpush-events-from-an-agent-to-the-browser+4

Messaging

12

MFA

1

Video

5

Fax

2

/ to search · Esc to clear