Vonage (Nexmo) integration for voice AI: WebSocket, NCCO

A voice assistant either conducts a dialogue without stumbles or loses the customer at the very first pause. We set up a turnkey voice pipeline: live speech, response without delay, handoff to an operator without interruptions. We will prepare an estimate and plan for your flow of inquiries.

AI Development Areas

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Vonage Voice API: where the voice dialogue breaks

Vonage Voice API provides a managed voice channel: NCCO describes the conversation scenario — what to do with an incoming call, when to start recording, where to transfer control — and the media stream with recognized speech goes over WebSocket to our speech model.

While all three parts are coordinated, the dialogue sounds lively. Failures begin exactly at the junctions: the line, the stream, and the model live by their own timings, and the subscriber hears the desynchronization between them.

The first typical failure is a dropped voice stream. The WebSocket closes when the network changes, when switching between carrier and Wi-Fi, during a long silence, while the NCCO has no branch for a disconnect: the call remains hanging, the subscriber hears silence and hangs up. In the logs this looks like a successful session, so the failure goes unnoticed for a long time.

The second is bot response delay. Recognition, utterance generation, and synthesis add up to a pause, and as soon as it exceeds the comfortable one, the person interrupts, repeats the question, talks over the answer. Feedback breaks down: the model hears the echo of its own voice and goes into a clarification loop.

A separate group is context loss on reconnection and unclear recognition on a narrowband channel: numbers, names, and addresses are recognized incorrectly, and the bot confidently confirms them. We analyze how this is addressed.

What a managed voice pipeline provides

A voice pipeline is when a call goes not into a queue for an operator, but into a managed scenario: greeting, request clarification, routing, answer from the knowledge base.

Call response time no longer depends on shift load — the call is accepted immediately, not after waiting on the line.

The share of auto-closed cases grows for typical requests: order status, business hours, appointment confirmation, request acceptance.

Such dialogues are closed without a person, and the rest goes to the operator already with a transcript of the conversation — the client does not repeat the question a second time.

Line load is distributed differently. Each call is handled in a separate session, so line availability does not drop when dozens of people call at the same time.

Stalls during peak hours are caught by dialogue metrics: where the bot asks again, where the scenario breaks, where hold time grows — this is fixed in configuration, without reworking the telephony.

Conversation analysis provides numbers for decisions: response time, auto-close share, dialogue duration, depth of transfer to an operator.

Integration goes through Vonage Voice API — the call session and event stream hold the dialogue state, and speech models connect to it, so the scenario changes without rewriting the telephony core.

Connection schemes: cloud Vonage, your own environment, hybrid

The connection scheme determines where the media stream lives and who controls the conversation scenario. This affects bot response, channel requirements, and how painful number porting will be. Below are three schemes that are actually chosen between when connecting a voice bot.

Option When it fits Limitations
Cloud telephony Number is set up with the carrier, the bot works as an external service: the platform sends a call notification and waits for the response scenario. Launch takes days Voice traffic and call recording go through the carrier, some PBX functions are unavailable
Own media server Recording and audio must stay in your environment, you need your own recognition models and non-standard audio processing Fault tolerance, capacity, and codec negotiation are on your side; integration with the carrier and number porting take longer
Hybrid scheme Number and routing are with the carrier, recognition and synthesis are in your own environment, with a permanent connection for the audio stream between them The two environments need to be synchronized, a connection break requires reconnection without losing the call

The choice comes down to three questions: where to store recordings, what response is acceptable, and whether you have your own models.

The hybrid scheme simultaneously gives control over data and fast launch, but requires discipline in monitoring the connection between environments — we test it on real calls before putting the assistant into operation.

Work sequence: from call analysis to pipeline handover

Before the first line of code, we listen to conversation recordings and build a taxonomy of requests — a scenario assembled from guesses falls apart on live traffic. Work proceeds in short cycles: scheme, pipeline on a test number, measurements on real calls. Below is the implementation route.

  1. Call audit. We analyze recordings and call logs: which requests repeat, where the subscriber hangs up, at which points of the conversation an operator is needed.

    The output is a taxonomy of intents with frequencies: it shows what is worth automating and what is cheaper to leave to people.

  2. Request transcription. We run a sample through speech recognition and mark places where the model makes mistakes — names, numbers, service names. This gives us a hint dictionary and a confidence threshold below which the call goes to an operator rather than the robot.

  3. Scenario setup. Branches, data collection, and transfer to an operator are described in the NCCO document, and the audio stream goes over WebSocket for real-time recognition.

    Separately, we specify connection breaks, silence, and timeouts — behavior in these cases is more important than a smooth dialogue, and a test number with webhooks for call events and step logging allows editing lines before launch.

  4. Traffic testing. We enable the scenario on part of the calls and look at the share of recognized intents, transfers to an operator, and failures — compared with the control group. Until the metrics converge, we do not expand coverage.

  5. Pipeline handover. We hand over the configuration, scheme, dictionaries, accesses, and on-call regulations, train the customer's team to change the scenario without us, and fix the boundaries of the norm by metrics.

  6. Support. For the first weeks after launch, we monitor live traffic, further train dictionaries, and add branches — after that the pipeline runs on its own.

Configuration, schemes, and regulations that remain with you

Everything that appears at the implementation stage lives in your account and your repository — we do not leave settings accessible only to us.

After the integration with Vonage is launched, you receive a set of artifacts that your team can use to change scenarios, expand checks, and deploy the environment again without our participation.

  • Integration scheme: call flows from the incoming signal to the dialogue service response, failure points, connections between telephony, queue, and bot logic — as a diagram and a text description of each transition.
  • Dialogue configurations: scenarios, lines, conditions for transition between steps, timeouts, and call variables — as files in the repository, not settings in a closed interface, so edits go through normal review.
  • Escalation rules: by which trigger the bot transfers the conversation to an operator, to which group, with what context, and what happens if the operator is unavailable; the rules are accompanied by test sets of lines.
  • Accesses and roles: list of accounts and keys, separation of rights between development, support, and business, procedure for issuing, rotating, and revoking.
  • Update regulations: how a new version of the scenario is prepared, what is checked before publication, who confirms the release, and how to roll back to the previous version in one operation.
  • Documentation: description of variables, log fields, and metrics, instructions for first-line support, analysis of typical failures and their signs.
  • Monitoring and alerts: which metrics are taken from dialogues, at which thresholds a notification arrives, and to which address.

The set is designed for an engineer who did not participate in the implementation: with it, one can raise a test environment, reproduce an incident, and release a change without restoring context through correspondence.

Case: support line moved to a voice assistant

Starting point

The support line worked only during business hours, and during peak windows the answer queue stretched to several minutes. About 40% of calls were typical questions: request status, connection terms, business hours.

Operators spent more than half a shift on them, and night requests remained unanswered until morning and returned as repeat calls.

Solution and metrics

We built a voice assistant on Vonage Voice API: the number receives the call, the audio stream goes to our server, speech recognition and synthesis work on our side, and the dialogue scenario is described declaratively — the route changes without rewriting the logic.

The assistant completes the typical scenario on its own and transfers to an operator only those requests where access to internal systems or a decision on a non-standard situation is needed.

Average response time decreased from 3 minutes to 20 seconds: the assistant picks up immediately, and the operator joins the dialogue via warm transfer with already collected context.

The share of requests closed without an operator is 60–65% during business hours and about 90% at night, when previously the call was not served at all. Shift load fell by about half with the same volume of incoming calls.

A separate class of failures that we considered the main one is gone — dialogue break at the junction of recognition and response: the subscriber heard silence and called back already irritated.

Now context is transferred between scenario steps through a single channel, and the break is visible in the log before the client notices it.

How does streaming dialogue differ from a scenario with pauses?

Streaming dialogue and a scenario with pauses solve the same task — to lead a person by voice to the desired action — but they manage speech differently.

In the first case, recognition is continuous, lines are glued into one session, and the system itself decides when to answer and when to let the person finish. In the second, the conversation is split into steps: the bot gives a prompt, waits for a response, and moves on.

Streaming dialogue keeps context: what was said in the third line is taken into account in the tenth, interruption stops synthesis but does not reset the session.

Audio goes to recognition as it arrives, not after a pause at the end of a phrase, so the response follows the pace of live speech. The price for this is sensitivity to noise and connection breaks.

A tone menu is more reliable where the channel is unstable or the answer must be recorded unambiguously: a key press cannot be recognized incorrectly, and step logic is predictable.

But dialogue context is lost — each press lives separately, the client's wording is not preserved, and a clarifying question has to be answered again.

That is why in practice a hybrid is used: a short route on tones leads to the desired branch, and then Vonage Voice API with streaming dialogue inside it turns on. Step reliability is preserved, and the substantive part does not turn into an interrogation with buttons.

Operator interception in these modes is structured differently. In the stream, the server holds the session state and gives the operator a transcript of the last lines — they enter the conversation already understanding the essence.

In the menu, it is enough to pass the current node and accumulated selections: the context is short, and the operator starts with the question again.

Engineering team doubts: we address them point by point

Engineering team doubts are usually not about whether speech recognition works, but about applicability boundaries, accesses, and system behavior during failures. We address them point by point.

What if the client says a non-standard phrase?

The scenario is built on the grammar of expected answers, and free speech goes to a fallback recognition model. When confidence is below the threshold, the system does not guess but asks again or transfers to an operator — the share of erroneous actions remains manageable.

Will we have to change the number and lose the current line?

The number and routing remain yours: we connect to the existing line on the carrier side, clients call as before. Rollback is switching the route to the previous scenario, without renumbering.

How are call recordings protected?

Recordings and transcripts are stored in your environment, encrypted, and live according to your retention period; masking of sensitive fragments is configured before recording. Listening and exports are logged, access is granted by roles.

What happens if the Vonage service is unavailable?

The call is not lost: the route switches to a backup — an operator pool or a second channel. Availability checks and automatic return are configured in advance, so degradation is limited to minutes, not line downtime.

How do we integrate this into the accounting system without stopping operations?

We start with one line and one scenario, expanding by metrics. Integration with the accounting system goes through events: the call result and status are linked to the request, and writeback is only by agreed fields.

Let's discuss the task: what to send for evaluation and a plan

Describe the task in free form — and using the list of inputs below, we will return with a project estimate, connection scheme, and stage-by-stage work plan.

You already have some materials: these are conversation recordings, script text, or a description of how the call is currently handled manually.

  • Recordings or transcripts of two or three real calls: they show client vocabulary, line length, and places where the dialogue breaks.
  • Conversation script and branching logic: what the voice assistant must say, what data to collect, and at what point to transfer the call to an operator.
  • Telephony parameters: number or number pool, access to the Vonage account, requirements for routing and call recording.
  • Data storage requirements: recording lifetime, anonymization, who within the company has access to them.
  • Result transfer points: where the call outcome goes — to your system, to an operator, or by email — and in what form it is expected on input.
  • Expected load: how many calls per hour and how many conversations run simultaneously — this determines the number of voice sessions and failure margin.
  • Test scenario: a short dialogue of 3–5 lines on which you want to accept the work and check speech recognition quality.

After that, we describe the architecture for your number, agree on a test scenario, and deploy it on one extension number. This makes the launch order predictable: first testing on live calls, then moving the main line and connecting conversation analytics. We give timelines for each stage separately, so you can stop and launch in parts.