Pioneer in Offering CRM Solutions since 2010...

Variance Logo
Contact Us

How PBX AI Agents Help Call Centers Handle Live Calls by Conversation

How an AI voice agent was added to the PBX so callers can be greeted, answered from a knowledge base, and handed to CRM actions or a human extension in one live phone conversation, in English or Hebrew

Call centers and sales teams often need to answer inbound calls when agents are busy, after hours, or when the request is a short qualification or FAQ. Putting callers on hold, missing the call, or forcing them through a rigid IVR menu loses context and time.

The conversation stays on one call session, so a follow-up such as a preferred time or a transfer request continues the same history. The reply language follows the agent instructions and the caller's language. Appointments, tickets, contacts and transfers follow the actions the administrator enabled.

PBX AI voice agent handling multilingual calls and CRM actions
Executive Summary

The Project at a Glance

PBX AI Agents brings a configurable AI voice agent into the PBX and CRM. An administrator defines what the agent is allowed to say and do. When a call enters Stasis on the assigned DID or extension, the connector answers, listens over live RTP, and speaks through OpenAI audio or an STT-LLM-TTS pipeline.

The Business Challenge

The Challenge of Live Inbound Phone Calls

Inbound callers need an answer while they are on the phone, not while they wait for a free human agent or navigate a long IVR tree.

Typical Inbound Caller Requests

Typical requests include: Ask about product, pricing or support hours, Qualify a lead and capture name, company or need, Create a ticket or appointment from the call, Transfer to a human when the caller asks for one, End the call politely when the request is complete

Limitations of Queues & Disconnected Chatbots

Doing this only with human agents means missed calls, long queues and inconsistent scripts. A separate chatbot does not hear the caller’s voice, does not sit on the PBX channel, and does not know which CRM actions or transfer extension the business approved.

Connected Live Voice & CRM Telephony

The business requirement was to let the caller speak naturally, and to let the PBX agent answer from knowledge, run allowed CRM actions, and report what happened — all on the same live call.

The Solution We Built

An Integrated Voice AI Agent for PBX & CRM

PBX AI Agents was built as an administrator-configured voice agent for Asterisk and the CRM.

Caller → PBX Stasis → AI connector → Listen (RTP) → AI reply → Speak (RTP) → CRM action / transfer
PBX voice AI integration with Asterisk and CRM actions
1

Administrator Configuration

Administrators open PBX AI Agents settings and create an agent. They choose the provider and model, write the main instructions, attach knowledge and guardrails, assign PBX extensions, and turn on only the actions the business wants.

2

Live Stasis & Voice Pipeline

When a call hits Stasis, the connector answers the channel, opens ExternalMedia for live µ-law RTP, builds the system prompt, and runs turns through the configured voice pipeline. Each turn updates conversation history until the agent ends the call, transfers, or reaches the turn limit.

3

Single Session Conversation Continuity

A follow-up utterance uses the same call history, so the CRM and the voice agent keep that conversation. This is separate from the CRM web login session.

AI Introduction

Why We Introduced AI into the PBX

The objective was not to let the model change the CRM without a result the caller and the business can trust.

The objective was to turn spoken speech into a short, natural reply, and — when configured — into a CRM search or create, a team assignment, or a live transfer.

01

Knowledge-Grounded Answers

Answer from the agent prompt, knowledge files and websites, and guardrails.

02

Phone-Optimized Dialogue

Greet the caller, keep replies short for phone latency, and continue multi-turn history.

03

Telephony Actions & Routing

End the call or transfer to a PBX extension when the guidelines say so.

04

Direct CRM Actions

Create or update a contact, create or search a ticket, add an event or a task when those actions are enabled.

05

Flexible Voice Pipelines

Use OpenAI audio for voice-in / voice-out, or AssemblyAI STT plus LLM plus TTS.

06

Contextual Clarification

Ask only when a value cannot be decided from the conversation.

System Capabilities

PBX AI Agent Capabilities

Capability What it does
Live Answer Answers the inbound channel in Stasis and speaks over RTP.
Knowledge Reply Uses admin prompt, knowledge sources and guardrails as the source of facts.
End Call Closes the conversation when guidelines are met ([END_CALL]).
Transfer Call Transfers the live call to a configured PBX extension ([TRANSFER]).
Assign Team Assigns the conversation to a team or user when enabled.
Create / Update Record Creates or updates a contact (or selected module) from the call.
Ticket Actions Creates or searches support tickets.
Appointment / Task Adds an event or task with working hours and slot rules.
One Conversation Call history and turn count stay on the active channel session.
Result on the Call The caller hears the answer; the CRM receives the action outcome.
How It Works

How PBX AI Agents Works

PBX AI agent workflow from inbound call to CRM action

An administrator creates the agent, selects OpenAI, Grok or Gemini, sets speech keys if needed, writes instructions, attaches knowledge and guardrails, assigns extensions, and enables actions.

Asterisk sends the channel into Stasis(ai-compliance). The connector receives StasisStart with DID and caller ID.

It loads the agent (from CRM tenant lookup or static config), builds the system prompt, answers the channel, and creates ExternalMedia so voice flows as live RTP to the CRM host.

VAD detects the end of speech. The voice pipeline (openai_audio or stt_llm_tts) produces a short spoken reply. Optional barge-in stops playback when the caller speaks again.

If the model signals end or transfer, the connector hangs up or redirects. Otherwise it resumes listening until max turns.

AI in Real PBX Work

PBX AI Agents in Real-World Scenarios

Example 1 — Answer from knowledge

The caller asks about pricing or product fit. The agent replies only from the knowledge base and prompt, keeps the answer to one or two short sentences, and asks one clarifying question when needed.

1

Caller Inquiry

The caller dials in asking about license pricing, product suitability, or operating hours.

2

Knowledge & Prompt Grounding

The agent references the knowledge files and system prompt, formulating a concise response designed for phone latency.

3

Short Spoken Reply

“The license range is about 63 to 289 shekels per user per month, depending on the package. How many users do you expect?”

Voice AI agent answering caller pricing questions

Example 2 — Transfer to a human

The caller asks for a person. The agent speaks a brief handoff line, then writes [TRANSFER]. The connector transfers to the configured extension. The CRM can also assign a team task when that action is enabled.

1

Human Assistance Requested

The caller requests to talk with an agent or support representative.

2

Handoff Utterance & Signal

The agent speaks a polite handoff message and writes [TRANSFER] to the telephony connector.

3

Extension Transfer & Team Task

The connector redirects the live call to the assigned PBX extension and logs a team task in the CRM.

PBX AI agent transferring callers to human support

Example 3 — Create a ticket from the call

The caller reports an issue. With Create Ticket enabled, the agent gathers the missing title or details across turns, creates the ticket as the configured CRM flow allows, and tells the caller the ticket was opened — or that it was not created.

1

Issue Stated

The caller calls regarding a technical difficulty or customer support problem.

2

Multi-Turn Information Gathering

With Create Ticket enabled, the agent captures the title, problem description, and caller details across spoken turns.

3

CRM Ticket Confirmation

The ticket is created in the CRM according to business rules, and the caller is verbally informed of the ticket outcome.

PBX AI agent creating CRM support tickets from calls
Conversation Lifecycle

PBX AI Agents: Call Session States

01

Greeting

Meaning: Call just answered; first spoken turn.

Connector Action: Speak greeting, then listen.

02

Listening

Meaning: Waiting for caller speech (VAD / RTP).

Connector Action: Buffer utterance; start next AI turn.

03

Playing

Meaning: AI audio is being injected as RTP.

Connector Action: Pace playback; allow barge-in if enabled.

04

Ended

Meaning: Hangup, transfer or max turns.

Connector Action: Drop ExternalMedia and clear the call.

The connector always tracks: system_prompt — built once per call from agent, knowledge and guardrails (or static prompt.txt), history — recent user and assistant turns for the LLM, action — hangup or transfer when the model signals it, transfer_extension — the PBX destination when transfer is enabled.

AI + PBX + CRM

AI + PBX + CRM: Working Together

AI Handles

→
Understanding the caller’s sentence
→
Short spoken replies
→
Choosing an enabled action
→
Knowledge-grounded answers
→
Keeping a single-call conversation
→
Deciding when to end or transfer
Connected Workflow

PBX / CRM Provide

→
Live channel, DID, caller ID, RTP media
→
Asterisk ARI answer, bridge, ExternalMedia
→
Agent settings, extensions, transfer target
→
Prompt, knowledge files/websites, guardrails
→
Call session history and turn limits
→
Hangup / Redirect via ARI or AMI

In simple terms, the caller talks to the phone line, and the CRM remains the system that stores records and action rules while the PBX remains the system that carries the live call.

Solution Architecture

PBX AI Agent Solution Architecture

PBX AI Agent Solution Architecture
Tech Stack

Multi-Provider AI Architecture

API keys stay on the server (CRM agent record or socket config). The PBX does not receive the provider key. The same call behavior is used whichever provider is selected for the text LLM path.

OpenAI Icon

OpenAI

Grok Icon

Grok

Google Gemini Icon

Google Gemini

AssemblyAI Icon

AssemblyAI

Before & After AI

How PBX AI Agents Reduces Manual Effort

✕ Traditional Process
✓ With PBX AI Agents
01 Missed / Queued Calls

Callers wait in queues, suffer long hold times, or abandon calls when human agents are occupied.

Answers immediately on the Stasis app instead of waiting for a free agent.

02 FAQs and Qualification

Human staff repeatedly answer routine questions and manually open CRM forms.

Speaks from knowledge without opening a desktop form.

03 Transfer

Manual call transfers often drop, misroute, or force callers to repeat information.

Hands off to an extension when the caller asks for a human.

04 CRM Capture

Agents manually record notes, create tickets, or log appointments after the call ends.

Creates contacts, tickets, events or tasks from the call when enabled.

05 After Hours

Calls go to voicemail or ring unanswered when staff is offline.

Keeps a consistent script and language without staffing every minute.

06 Follow-Up on the Same Call

Context is lost when callers clarify requests, requiring restarting explanations.

History stays on the channel so the next sentence continues the request.

07 Result

Inconsistent service, missed business opportunities, and high human overhead.

The caller hears the answer; the business sees the CRM outcome.

Benefits

Business Benefits

01

Faster Call Handling

Callers get an answer on the first ring path instead of waiting in a long queue for every FAQ.

02

Fewer Dropped Opportunities

Qualification and booking can continue when human agents are busy or offline.

03

A Conversation, Not a One-Shot IVR

The agent can ask for a missing detail and finish the same request on the next utterance.

04

Language and Script Control

Administrators write the instructions, knowledge and guardrails that shape every reply.

05

Administrator Control

Only enabled actions run, and transfer goes only to the configured extension.

06

A Clear Outcome for the PBX

End call, transfer or continue listening — the connector always knows the next telephony step.

AI Security

Security and Administration

The agent runs only for calls that enter the configured Stasis application. CRM actions follow the agent configuration and signed-in CRM rules where applicable.

Administrators control:

Active Agent & Owned PBX Extensions
Provider, Model & Secure API Keys
Instructions, Knowledge Files & Guardrails
Enabled Actions (End, Assign, Transfer, CRM Records)
Transfer Extension & Appointment Working Hours

API keys are stored with the agent or in socket config and are not exposed to the caller or the PBX dialplan. Prompt and knowledge can also be loaded statically to remove master/tenant DB latency on the call path.

Future Enhancements

Future Enhancements

The same pattern can grow without changing how Asterisk holds the live call.

Richer CRM Updates

Richer CRM updates from a follow-up utterance on the same call.

Expanded Module Support

More modules, using the same action framework.

Real-time Streaming Audio

Deeper real-time streaming models for lower time-to-first-audio.

Outcome History & Analytics

Usage and call outcome history for administrators.

Richer Post-Call Summaries

Richer post-call summaries saved to the CRM.

From Manual to AI-Assisted

From IVR Menus to a Conversation

Traditional Inbound Workflow

Dial
IVR Menu
Hold / Voicemail
Human Agent Opens CRM Forms

With PBX AI Agents

Dial
Stasis AI Agent Answers
Speak Naturally
Hear the Answer or Transfer

If something necessary is still missing, the agent asks, the caller speaks again on the same channel, and the original request continues.

Human Oversight

The Caller Remains in the Conversation

The agent does not silently invent a person, company or ticket that was never mentioned. It asks.

It does decide the values a phone agent would expect it to decide:

Short Greeting Without Long Self-Introduction
One Clarifying Question at a Time
When to End the Call or Transfer Based on Actions
Facts Only From Knowledge and Instructions
The Business Impact

The Outcome of PBX AI Agents

Live Inbound Conversations: PBX AI Agents makes answering and acting on inbound calls part of a live phone conversation.
Inquiries & Qualification: Callers can ask about the product, qualify themselves, open a ticket, book an appointment, or reach a human extension.
Language & Knowledge Adherence: The answer follows the agent language and knowledge.
CRM-Governed Business Rules: The time and records follow CRM rules.
Clear Telephony Outcomes: The PBX can tell listen apart from hangup or transfer because every turn ends with a clear telephony action.
Bilingual Voice Agility: Seamless voice conversations in English or Hebrew shaped by prompt guidelines and caller speech.
Key Takeaway

The useful voice AI agent is the one that finishes the call step and says what happened.

By keeping the agent inside the PBX and the CRM, the organization gets live answers in the caller's conversation, on the approved actions, and on one call the connector can continue.

We use cookies to provide better experience on our website. By continuing to use our site, you accept our Cookies and Privacy Policy.

Accept