Contact Center and Telephony Voice Agents

On a phone line the agent shares the work with people. The design succeeds when callers get their task done, not when they fail to reach a human.

BeginnerIntermediateExpert · 13 min read · Last updated:

In short

A contact-center voice agent answers calls, identifies the need, verifies the caller when required, completes a small set of tasks and hands everything else to a person with the context attached. Start narrow, keep money and identity rules in code, always offer a human, and judge success by verified resolution rather than by calls that never reached an agent.

What you will learn: how calls reach software, call flow design, verification, handoff, a runnable state machine, rollout stages and metrics.
Prerequisites: Voice Agent Architecture and Real-Time Audio and Voice Latency, Turn-Taking, Quality and Privacy.

Versions used

The example runs in November 2026 on Python 3.13 with invented calls and rules. It places no real calls. Provider features and telephone rules vary and change; verify them for your provider and countries.

Beginner How a call reaches your agent

Telephony in plain words

Callerphone network
Carrier or SIP trunkdelivers the call
Contact center platformrouting, queues, recording
Voice agentmedia, turns, tools
Human queuetransfer with context
TermMeaning
PSTNThe public telephone network
SIPSession Initiation Protocol, which sets up and controls internet calls
RTPThe protocol that usually carries the audio
IVRAn automated menu, often driven by key presses
DTMFThe tones sent by keypad presses
ACDAutomatic call distribution: queues calls to suitable agents
CRMThe system holding customer records and cases

There are several ways to connect. Some voice model services accept SIP directly: OpenAI publishes a SIP guide for voice agents, and xAI documents SIP for its speech-to-speech service, including keypad presses passed to the model as input. Other setups use a telephony provider that streams audio to your server, or features built into a contact center platform. Whichever you choose, confirm how transfer, hold, recording, keypad input and failure routing work.

Choose the first tasks

Look at real call reasons and pick tasks that are frequent, well defined, low in harm and supported by reliable systems.

TaskFit for a first releaseWhy
Opening hours, locationsGoodNo account access, easy to verify
Order or case statusGood with verificationRead-only
Appointment bookingGood with read-backReversible and structured
Small refund within policyLaterMoney moves; needs limits and audit
Complaints, hardship, bereavementRoute to peopleJudgment and care matter
EmergenciesNever automate the decisionGive the emergency instruction and connect people
Intermediate The call flow

A flow with exits at every step

OpenAI notice, consent
Understandreason for call
Verifyonly if needed
Do the taskread back, then act
Closeconfirm, follow-up
From any box the caller can reach a person, and so can the system when a rule requires it.

Let the model handle language and let a state machine decide what is allowed next. A model can phrase a question in many ways; it should not be able to skip verification. This script runs seven calls through such rules.

"""A support call as a state machine: verify, act within limits, or hand over."""
from dataclasses import dataclass, field

NEEDS_CODE = {"order status", "refund", "change address"}
SELF_SERVICE = {"opening hours", "order status", "refund"}
REFUND_LIMIT = 50.0


@dataclass
class Call:
    id: str
    intent: str
    code_keyed: str = ""
    amount: float = 0.0
    wants_person: bool = False
    system_updated: bool = True
    log: list = field(default_factory=list)

    def run(self, expected_code="4821"):
        if self.wants_person:
            return self.hand_over("caller asked for a person")
        if self.intent in NEEDS_CODE:
            if self.code_keyed != expected_code:      # one-time code, typed on keypad
                return self.hand_over("verification failed")
            self.log.append("verified by one-time code")
        if self.intent not in SELF_SERVICE:
            return self.hand_over("not a self-service task")
        if self.intent == "refund" and self.amount > REFUND_LIMIT:
            return self.hand_over(f"refund {self.amount:.2f} above limit")
        if not self.system_updated:
            return self.hand_over("system did not confirm the change")
        self.log.append(f"completed: {self.intent}")
        return {"call": self.id, "end": "contained", "resolved": True}

    def hand_over(self, reason):
        packet = {"intent": self.intent, "reason": reason,
                  "verified": "verified by one-time code" in self.log}
        return {"call": self.id, "end": "transfer", "resolved": False, "packet": packet}


CALLS = [
    Call("A", "opening hours"),
    Call("B", "order status", code_keyed="4821"),
    Call("C", "refund", code_keyed="4821", amount=20),
    Call("D", "refund", code_keyed="4821", amount=400),
    Call("E", "change address", code_keyed="0000"),
    Call("F", "complaint", wants_person=True),
    Call("G", "refund", code_keyed="4821", amount=15, system_updated=False),
]
results = [call.run() for call in CALLS]
for r in results:
    note = r.get("packet", {})
    print(f"{r['call']}  {r['end']:<9} {note.get('reason', '')}"
          + ("  (caller already verified)" if note.get("verified") else ""))
contained = sum(r["end"] == "contained" for r in results)
HUNG_UP = 2   # assumed: callers who gave up before any outcome
print(f"resolved by the agent: {contained} of {len(results)} finished calls")
print(f"'not transferred' if hang-ups count as success: "
      f"{contained + HUNG_UP} of {len(results) + HUNG_UP}")

Output:

A  contained 
B  contained 
C  contained 
D  transfer  refund 400.00 above limit  (caller already verified)
E  transfer  verification failed
F  transfer  caller asked for a person
G  transfer  system did not confirm the change  (caller already verified)
resolved by the agent: 3 of 7 finished calls
'not transferred' if hang-ups count as success: 5 of 9

Reading the result

Calls D and G show why completion and honesty differ. D is a valid request that exceeds a limit. G is a refund the system never confirmed, so the agent must not tell the caller it succeeded. The final two lines show how a number can flatter you: counting abandoned calls as "contained" lifts the figure from 3 of 7 to 5 of 9 while helping nobody. The hang-up count is assumed.

Simplified on purpose

The example compares a fixed code. A real system generates a random one-time code per call, expires it, limits attempts, compares it securely and never shows it to the model or logs.

Write the conversation

Script the moments that must be exact and let the model handle the rest. The opening, consent question, amounts, legal notices and safety messages are fixed text. Questions, clarifications and small talk can vary.

MomentWeak wordingStronger wording
Opening"How may I assist you today with your various needs?""I'm an automated AI assistant. What are you calling about? You can ask for a person."
Not understood"Invalid input.""Sorry, I missed that. Is it about an order, a payment, or something else?"
Confirmation"Okay?""I'll refund 20 dollars to the card ending 2210. Yes or no?"
Slow lookupSilence"I'm checking your order. This can take a few seconds."
Cannot help"I can't do that.""A colleague handles that. I'll pass on what you've told me."

Limit retries. A common pattern is one rephrased attempt, one simpler choice or keypad option, then a person. Count silence, noise and "no" to a confirmation as separate events, because they need different fixes.

Answers from approved knowledge

Questions about policy should be answered from a reviewed knowledge source with an owner and an effective date, not from the model's general knowledge. Retrieve a short passage, say the answer in one or two sentences and offer to send the full text. If nothing relevant is found, say so and transfer. Prices, terms and eligibility need special care, since a spoken promise may be treated as one your organization made. See RAG Evaluation, Grounding and Debugging.

Verification and fraud

  • Match the method to the risk: public information needs none; account changes need more than facts a thief could find.
  • Caller ID can be spoofed, and voices can be synthesized. Use neither alone.
  • Keep secrets out of speech where possible: keypad entry or a link to an authenticated app.
  • Lock out after a few failures and tell a person, without revealing which detail was wrong.
  • Re-verify for higher-risk actions, such as changing the contact number that receives codes.
  • Watch for patterns across calls: many accounts from one number, or repeated small refunds.

Getting values right

ValueCapture technique
Account or order numberKeypad, or speech with a check digit and read-back in groups
Name and addressLook up and confirm; spell when uncertain
Date and timeRepeat with weekday and time zone
Email addressPrefer an address already on file or a text link
Payment cardDedicated secure payment capture, outside the agent
Yes or no for actionsState the action and amount, then ask once, clearly

Handoff that respects the caller

The person receiving the call should not start over. Send a short, structured packet and say what will happen.

{
  "call_id": "D",
  "reason_for_call": "refund",
  "verified": "one-time code, 2 minutes ago",
  "collected": {"order": "A-4279", "amount": "400.00"},
  "done": [],
  "not_done": ["refund: above agent limit"],
  "transfer_reason": "limit",
  "language": "en"
}

This packet is an illustration. Mark facts the caller only claimed, keep it brief and exclude secrets. If nobody is available, give an honest wait estimate, offer a callback with a real time and create the case.

Escalate on signals

A request for a person, repeated misunderstanding, distress, mentions of harm, legal threats, vulnerability or a topic outside scope should each have a defined route.

Expert Running it at scale

Fit into the platform

Routingwhich calls reach the agent, by number, hour, language and share
Agent servicescales with concurrent calls; keeps state per call
Tool gatewaynarrow, audited actions on CRM and order systems
Human desktophandoff packet, case history, correction feedback
Quality and compliancerecordings under policy, review, reporting

Capacity and peaks

Telephony load is measured in simultaneous calls, not requests per second. A rough estimate is calls arriving per hour multiplied by average call length in hours. For example, 600 calls an hour at 4 minutes each is 40 calls in progress on average; peaks within the hour will be higher. Check limits on trunks, model sessions, recognizers and downstream systems, and decide what happens when one is full: queue, menu fallback or direct routing to people. See Latency, Load Testing and Capacity Planning.

Resilience

  • A switch that returns all calls to normal routing, tested regularly
  • Health checks that call the number and complete a harmless task
  • Fallback routing at the carrier or platform if your service is unreachable
  • Idempotent actions so a dropped and repeated call does no double work
  • Follow-up messages when a call drops after an action

Outbound calls

Calling people carries heavier duties than answering them. In the United States, the FCC has ruled that AI-generated voices are artificial voices under the Telephone Consumer Protection Act, which brings its rules, including consent requirements, into play. Other countries have their own regimes. Confirm consent, calling hours, identification, opt-out and do-not-call lists with counsel before the first outbound call. In the EU, AI disclosure duties under Article 50 of the AI Act also apply to systems that interact with people.

Test with calls, not only transcripts

Build a call suite that runs before every release. Drive the state machine in text for speed, then place a smaller set of real audio calls through the same number and routing that customers use.

GroupExamplesMust hold
NormalEach supported task, each languageTask confirmed by the system
BoundariesRefund just over the limit, closed accountTransfer with correct reason
VerificationWrong code, expired code, "just trust me"No protected data or action
Audio troubleNoise, silence, interruptions, keypad mixed with speechRecovery or transfer, no loop
Backend troubleTimeout, partial failure, duplicate requestHonest message, no double action
SensitiveDistress, threats, emergency wordsDefined escalation every time

Treat a failed safety row as a release blocker rather than something averaged into a score. Keep each production failure, with personal details removed, as a new case.

After the call

The call is not finished when the line closes. Write one case record containing the reason, what was verified, actions attempted, the confirmation returned by each system and any promise made to the caller. Generate the summary from these records first and from the transcript second, so it cannot report an action that never happened. Let staff correct it, and feed corrections into your tests.

Send the caller a short confirmation for anything that changed, using contact details already on file. It gives them a way to spot a wrong or fraudulent change early. Reconcile daily: every action the agent claims should match an entry in the system of record, and every unmatched item needs an owner. Apply the retention periods you decided in Voice Latency, Turn-Taking, Quality and Privacy to recordings, transcripts, summaries and exports alike.

Metrics that keep you honest

MeasureDefinition to agreePair it with
Verified resolutionSystem confirms the task and no related contact within a set periodRepeat contact rate
ContainmentCall ends without a personAbandonment and complaints
Transfer qualityRight queue, no repeated questionsHuman agent ratings
Handle timeWhole journey including transfersResolution
Wrong actionsChanges that should not have happenedTime to detect and reverse
Caller feedbackShort optional surveyResponse rate and bias
Cost per resolved taskTelephony, models, platform and human timeBaseline before launch

Take a baseline before launch and compare like with like: the same call reasons, hours and customer groups. See Agent FinOps, Budgets and Chargeback.

Roll out in stages

  1. Offline: scripted calls, including every refusal and transfer path.
  2. Staff pilot: employees call with realistic tasks on real phones.
  3. Listen and suggest: the agent assists human agents with consented summaries and lookups.
  4. Small live share: one task, business hours, easy transfer, daily review.
  5. Expand: add tasks one at a time, each with its own entry criteria and rollback.
Illustrative case

This invented example shows the reasoning. A clinic group wants calls answered after hours. Release one gives opening times and takes callback requests only. Release two books routine appointments with read-back and a text confirmation. Symptoms, urgent wording or confusion go straight to the on-call process with a fixed safety message. Nothing clinical is decided by the agent.

The people side

Tell human agents what the system does and does not do, give them a quick way to flag mistakes, and plan for the calls they now receive to be harder on average. Include their feedback in release decisions. Accessibility routes, such as text channels and relay services, must keep working.

Common mistakes

MistakeBetter practice
Hiding the route to a personOffer it early and honor it
Optimizing containment aloneTrack verified resolution and repeat contact
Letting the model decide verificationEnforce it in code before tools unlock
Reading card numbers into the transcriptUse separate secure capture
Transferring with no contextSend a structured packet
Launching all call types togetherOne task at a time with rollback

Checklist

  • First tasks chosen from real call data
  • AI notice, consent and human route in the opening
  • Verification and limits enforced outside the model
  • Success announced only after system confirmation
  • Handoff packet tested with real agents
  • Peak concurrency, fallback routing and kill switch tested
  • Resolution, repeat contact and wrong actions reviewed weekly

Frequently asked questions

Should the agent replace the keypad menu?

It can sit behind or beside it. Keep keypad options for noisy lines, private values and callers who prefer them.

What containment rate should we target?

Do not start from a target. Measure verified resolution by task, then improve it without raising repeat contacts or complaints.

Can the agent handle angry callers?

It can acknowledge the problem and transfer quickly. Define signals for immediate escalation and test them.

Who is responsible for a wrong action?

Your organization. Name an owner for each task, log approvals and make correction easy for staff.

References and further reading

Next steps