Implement a virtual AI agent in PBX. Example of a use case

November 5, 2025

A well-structured configuration of a PBX can make the difference between a phone service that merely works and an effective experience that builds customer trust and encourages them to call again, turning every call into an opportunity.

In this article, we present a practical case of how to design a virtual PBX with a clear welcome menu, calls between different departments, and the integration of virtual agents in various extensions. We will look at examples of what an artificial intelligence bot can do.

Thanks to Megacall's PBX, all of this is possible through integration with virtual agents developed by Vapi, Retell AI, and ElevenLabs, allowing us to create bots capable of handling and making calls more naturally.

Below, we will explore a practical case applied to a hotel, with the creation of a hotel welcome menu and the connection of bots to each extension of the PBX.

Hotel reception

The configuration of the PBX for a hotel allows all business calls to be managed in an organized manner. By having an automated system, the company can offer faster, more professional service without overloading its employees.

Welcome menu configuration

The welcome menu is the first contact the customer will have with the hotel. With it, we can direct the call to the appropriate department or employee and reduce waiting times.

Although many customers choose online channels to get information or make reservations, there are still many people who prefer to request information over the phone, as they seek more direct contact, value immediacy, and appreciate personalized attention.

From Megacall's PBX, we can define a welcome menu in the section "My PBX - Incoming calls and IVR." For example, in the case of a hotel, it could be:

  • - "Welcome to Hotel Land. Please choose the option that best fits your inquiry:
    If you wish to make, modify, or cancel a reservation, press 1.
    For information about our services and activities, press 2.
    For information about events or groups, press 3.
    For any other inquiry, press 0." -

In this way, when the customer selects one of the options, the call is handled by a specialized bot that responds to the inquiry or, if necessary, redirects it to the corresponding employee.

For its configuration within Megacall's PBX, in the IVR block we can upload an audio file for the greeting or insert text that will be played. Megacall offers more than 15 available languages for the text, and the audio can also be used as hold music.

audio files

From the same IVR block, we can set up the buttons for the different departments, indicated as "menu items", which will be the options available to the customer when making their inquiry.

menu items

Configuration of departments and virtual agents

In addition to the welcome menu, Megacall's PBX allows the assignment of specific virtual agents for each department, so that each one provides information tailored to the type of inquiry selected by the customer. This not only saves staff time but also improves the customer experience by providing immediate responses.

From the same platform where the virtual agent is created, it is possible to define a list of frequently asked questions and add knowledge for each context and situation, as well as give instructions about each bot's communication style.
Once all the instructions have been specified, all that remains is to connect the virtual agent to an extension, and the system will start working automatically.

We can look at some examples to get a clearer idea of what a virtual agent can do for each extension. Following the hotel case with the welcome menu and four different departments, we can connect a bot to each extension:

  1. Reservations department

    When the customer selects option 1 (reservations) in the menu, the call is handled by a virtual agent specialized in reservation management. This agent can request information such as names, desired dates, room type, length of stay, etc. With access to the calendar, the bot can set a reservation date for the customer.

  2. General information and services department

    The virtual agent can be configured to provide detailed information about hotel services, check-in and check-out times, and answer frequently asked questions such as location or cancellation policies. This type of setup is useful when the front desk is busy.

    All of this should be previously specified on the bot configuration platform, which will then be connected to the PBX extension.

  3. Events and Activities Department

    The virtual agent can contain information to answer inquiries about halls, conferences, celebrations, or group bookings, for example. It gathers details such as the type of event, number of attendees, and dates, and can forward the request to the event manager. If the customer wishes to speak with the person in charge of events, the call can be transferred to them along with a summary of the conversation. It can also generate automatic reminders.

  4. Other Inquiries

    If the customer presses option 0 (other inquiries), the call is managed by a virtual agent that collects data (name, inquiry, reason for the call) and classifies calls that do not fit into the other options. This way, no call goes unanswered.

Smart routing and callback

If human assistance is required during the conversation, the call is automatically transferred to the appropriate staff member through smart routing, along with a summary of the dialogue. This allows the employee to receive the full context before taking the call and helps speed up the resolution of the inquiry.

In addition, virtual agents can be configured with the callback function. This means that if the inquiry is not resolved or cannot be handled by staff at that moment, the system automatically records the customer's details so that, in this case, the hotel staff can return the call as soon as possible.

Finally, incoming calls can be logged in Megacall's CRM, either as an audio recording or a text transcription, making it easier to track each conversation with customers.

To connect a bot to a Megacall PBX extension.

  • From your personal area, go to My PBX- Extensions.
  • In the extension settings, under the parameter "Call forwarding and Voicemail", click Enable.
  • Next, select the forwarding condition, for example, "Always active."
  • In the "Call forward to" parameter, choose "External Server (SIP URI)."
  • In the pop-up window, enter the address - for example: 14441111111@server.com, where 14441111111 is the virtual number and "server.com" is the SIP URI of the bot service.
  • Finally, click Save.

Call forwarding to the virtual agent during peak hours

To automatically transfer a call to a bot, the bot must be added as the last element in the incoming call queue. In this way, if none of the previous extensions answer, the call is redirected to the virtual agent, ensuring that the customer always receives assistance.

calling settings

Managing calls outside business hours

Thanks to artificial intelligence, it is possible to handle incoming calls outside of business hours. To achieve this, simply create an additional scenario and add the bot's extension. Then, go to the "working hours" section, and under "Enabled during off-hours" select the virtual agent option.

working hours

The integration of AI bots with Megacall's PBX allows businesses of all kinds to offer fully automated, professional, and 24/7 customer service. Start managing your calls in the most convenient way with Megacall's PBX!

Go to Top
Abrir chat
1
Hola 👋🏻
¿En qué podemos ayudarte?

--

Hi 👋🏻

How can we help you?