AI voice agents for after-hours calls and crisis routing in behavioral health take overnight logistics calls, like moving a session or recording a refill request, and never counsel. Any sign of crisis stops the task: fixed words give 988 and 911, then the agent transfers the caller to the on-call clinician.
Key Takeaways
- The crisis line plays as fixed Transition Speech, so the model never rewords it.
- Add a crisis pathway on every node, because the Global Node has no edges.
- Plan the unanswered transfer: the caller has heard 988 and 911 and needs a backup.
This post is part of our guide to AI voice agents for mental and behavioral health. Below, we cover overnight logistics calls and the crisis path that can interrupt any of them. Then we set up both in Dograh, the open-source AI voice agent platform we build.
What the after-hours line handles
After the office closes, the agent takes logistics calls and never counsels. Clients call to move tomorrow's session, to say their telehealth link won't open, to ask for a refill, or with a billing question. Each one has a plain answer that lives in your systems. A session moved overnight can free a slot, and waitlist and cancellation-fill calls cover offering it to the next client.
An HTTP API tool does the work during the call. It reads open slots and books a new time, or asks your system to resend the telehealth link through your own messaging provider. A refill request is recorded for the prescriber with the medication name as the client said it. The agent never gives advice about a medication, and any question beyond "please call your prescriber" goes to the on-call line. Billing questions are recorded for the morning team.
Put the boundary in the Global Node, whose prompt Dograh adds to every step that has Add Global Prompt switched on. Tell the agent it never offers emotional support and never judges whether someone is safe. A practice's after-hours number is not a crisis line, and the agent should never act like one. Its whole crisis job is to stop, say fixed words and reach a person.
Dograh has no built-in business-hours routing. Your phone system forwards calls after closing to the number your after-hours agent answers, and that number's Inbound workflow setting points at the agent.
Fixed words for any sign of crisis
When a caller says anything that sounds like crisis, the agent drops the task and plays fixed words. Prompts leak by paraphrase: the model avoids the banned phrase and then says the banned meaning in other words. Exact wording holds only where Dograh plays fixed text or a recording, such as a pathway's Transition Speech. Put this line on the crisis pathway:
"If you're thinking about harming yourself, call or text 988 to reach the Suicide and Crisis Lifeline. If you're in immediate danger, get to safety and call 911."
Two more pathways cover the other cases. A caller describing an overdose or another medical emergency hears "If this is a medical emergency, please hang up and call 911." A caller in danger from someone else hears "If you're in danger, get to safety and call 911." Each pathway then writes a flag for the on-call clinician.
Choosing a pathway is still the model reading the condition you wrote, so keep each condition short and explicit: suicide, self-harm, wanting to die, harming someone else, overdose. The Global Node has no edges and cannot be connected, so add a crisis pathway that leaves from every node. Test each phrase and its near misses, and read the transcripts to prove the line played. Our post on prompt and flow design patterns explains this split. Text Transition Speech does not play on speech-to-speech models, so record the line as a clip there.

The number is worth giving at 2 a.m. The 988 Suicide and Crisis Lifeline is available 24/7, and conversations are free and confidential. Anyone can contact it about someone they know who is struggling.
According to the Government Accountability Office's July 2026 report, as of March 2026, 988 calls are generally routed to local crisis centers by the caller's approximate location, so a caller reaches a nearby staffed center.
Open Source Alternative to Vapi / Retell
Self-hosted voice agent platform — no per-minute fees
dograh-hq/dograh
Star on GitHub
Reaching tonight's on-call clinician
After the fixed line, the agent transfers the caller to whoever is on call tonight, with the details written first. Transfer Call works on Twilio, Telnyx, Plivo, Cloudonix and Asterisk ARI. Dograh calls the destination first and connects the caller only when someone answers. On Twilio, it can play a short spoken introduction to both people before connecting them.
On-call rotas change every night, so a fixed number is the wrong destination. Set the tool's destination source to Dynamic HTTP Resolver. During the call, Dograh sends a request to your endpoint, and your endpoint returns tonight's on-call clinician. The resolver waits 3 seconds by default and 5 at most, so it should read the rota from your own system, not from a slow outside service.
No summary travels with the call by default. Before the transfer, an HTTP API tool writes a crisis flag and the callback number to your system, so the clinician sees why the call is coming. A Pre-Transfer Message, set as Custom Message, can tell the caller "I'm connecting you now to our on-call clinician" in fixed words.
Browser test calls cannot run Transfer Call. Test every transfer on a real phone line, including a call to a clinician's mobile at night.
When the on-call phone isn't answered
The transfer can go unanswered, and the practice designs what happens next. Each transfer attempt rings for up to 30 seconds by default. If nobody answers, the caller comes back to the agent, and the agent is told the transfer failed. The caller has already heard 988 and 911 once.
Add a pathway for the failed transfer whose Transition Speech plays the same crisis line again, word for word. Then try a backup clinician with a second Transfer Call tool, which also rings for up to 30 seconds, and page the on-call team through your paging service with an HTTP API tool. Your prompt should never close a crisis call with "we'll call you back tomorrow". If nobody can be reached, the caller ends the call with 988 and 911 and a flag that the morning team reads first.
The general pattern for unanswered on-call phones, from the timeout to the callback window, is in AI voice agents for after-hours coverage. A behavioral health line adds one rule to it: a crisis caller never leaves without the fixed line.
Join the Dograh Community
Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.
Family callers and Part 2 records
A family member calling about a client gets the same line and a person, and nothing about the client's care. The agent plays the 988 and 911 line and transfers the call to the on-call clinician. It confirms nothing, not even that the person is a client. The clinician decides what to share.
Substance use programs have extra rules for that flag. Under the Confidentiality of Substance Use Disorder Patient Records rules (42 CFR Part 2), the restrictions do not apply to communications among a program's own staff who need the information for their duties. Writing a crisis flag to the program's own on-call clinician generally falls inside that.
Anything that goes outside the program is different. The Part 2 medical emergency rule lets a program disclose patient identifying information to medical personnel to meet a real medical emergency when the patient's written consent cannot be obtained, and the program must document the disclosure afterwards. That call belongs to the clinician, never to the agent. How these rules apply to your program's after-hours line is worth confirming with counsel.
Test the night line on a real phone
Crisis calls carry the most sensitive words a practice records, so decide where they live before launch. Dograh is self-hostable, and self-hosted, no business associate agreement with Dograh is needed. Self-hosted Dograh has no per-minute platform fee (servers, model keys and phone minutes still cost). Dograh Cloud has a 1¢-a-minute platform fee.
Then test on a real phone line. Most phone calls still reach the agent as 8 kHz audio, while a browser test runs at 16 kHz, so crisis phrases can come out differently. Run each crisis phrase from every node, the resolver at shift change, the unanswered transfer and the backup page. Once live, set up QA to flag every call where crisis language came up and have a clinician read those calls the next morning.
Glossary
- Transition Speech
- Fixed text or a recorded clip that Dograh plays word for word when the agent takes a pathway. It carries the 988 and 911 line, so the model never rewords it.
- Dynamic HTTP Resolver
- A Transfer Call setting that asks your endpoint for the destination during the call. It is how the agent reaches tonight's on-call clinician from a rota that changes every night.
- Pre-Transfer Message
- A fixed message Transfer Call can play to the caller before the transfer starts, such as a line saying they are being connected to the on-call clinician.
- Medical emergency rule (Part 2)
- The 42 CFR Part 2 rule that lets a substance use program disclose patient information to medical personnel in a real emergency when consent cannot be obtained, documented afterwards. The clinician decides, never the agent.

