https://a.storyblok.com/f/270183/1368x665/151c17611e/26mar_dev-blog_cc-php-von-1.jpg

Build a Conference Call with PHP and the Vonage Voice API

Published on March 18, 2026

Time to read: 7 minutes

Introduction

In this tutorial, you’ll learn how to build a conference call application using PHP and the Vonage Voice API. By the end, you’ll have a phone number that multiple participants can call to join the same live conversation.

We’ll configure a Vonage application, handle inbound calls with a Call Control Object (NCCO), and return dynamic responses from a simple PHP endpoint. This project is a practical starting point for building team meeting lines, event hotlines, or collaborative voice experiences.

The complete source code for this tutorial is available in the Vonage Community GitHub repository, so you can follow along or adapt it for your own use case.

Prerequisites

DT API Account

To complete this tutorial, you will need a DT API account. If you don’t have one already, you can sign up today and start building with free credit. Once you have an account, you can find your API Key and API Secret at the top of the DT API Dashboard.

Answering an Incoming Call with PHP

For this example, users will call a Vonage virtual number, and your application code will respond to that incoming call. Vonage does this by using a Call Control Object, or NCCO

First, we'll have a spoken text-to-speech (TTS) greeting, then the user will join the conference call.

To achieve this, we'll add an answer.php file to the public/ directory (our webroot) and have it return the NCCO. The NCCO is JSON, so the PHP also needs to include an appropriate Content-Type header:

<?php

$ncco = [
    [
        "action" => "talk",
        "text" => "Thank you for joining the call today. You will now be added to the conference.",
        "language" => "en-GB",
        "style" => 0,
        "premium" => true
    ],
    [
        "action" => "conversation",
        "name" => "weekly-team-meeting"
    ]
];

header("Content-Type: application/json");
echo json_encode($ncco);

The $ncco variable holds the NCCO that you will return to Vonage’s server to instruct it on how to handle an incoming call. This example includes a "talk" action that greets the user, followed by a "conversation" action that adds the user to the conference call. This code uses header() to get PHP to send the Content-Type header, followed by the JSON itself.

If you're curious what else you can do with an NCCO, you can find the NCCO reference documentation on our Developer Portal.

Serve the Response

At this point, you can start testing the application's moving parts. Start the PHP webserver from the public/ directory:

cd public/
php -S localhost:8080

Check that your application returns the NCCO correctly when you make a request to http://localhost:8080/answer.php using your favourite HTTP client (cURL, Postman or even your browser would be a good tool to use here).

Make the Code Publicly Available

For Vonage to notify your application of an incoming call, it needs to be able to reach it, so this code must be publicly available. One option is to deploy it to a server, but for development purposes, I prefer to use ngrok to expose my local development environment. Once you have the web server running (mine is on port 8080), run ngrok like this:

ngrok http 8080

This will give you a dashboard showing a link to the web interface (very useful, click it), the https URL of your tunnel (copy this, we'll need it in a moment), and a section that will show the requests arriving when you make some.

Try out your new tunnel by making a call to your application over it—you can replace http://localhost:8080 with your ngrok https URL, try the request to /answer.php again.

Set Up a Number to Call

Purchase a Vonage Number

Buy a Number

To buy a virtual phone number, go to your API dashboard and follow the steps shown below.

  1. Go to your API dashboard

  2. Navigate to BUILD & MANAGE > Numbers > Buy Numbers.

  3. Choose the attributes needed and then click Search

  4. Click the Buy button next to the number you want and validate your purchase

  5. To confirm you have purchased the virtual number, go to the left-hand navigation menu, under BUILD & MANAGE, click Numbers, then Your Numbers

Create a Voice-Enabled Vonage Application

The other thing needed is a Vonage application: this holds the call configuration and can be linked to the number(s) you want to use. This separation is very useful if you want numbers from different geographies to join the same conference call.

Vonage applications use public/private keys. In this example, you are simply receiving an incoming call, so you won’t need the private key for now. However, it’s good practice to save your private.key file into your working directory, in case you decide to build more functionality on top of this example.

Creating the application requires you to give it a name and configure some important webhook endpoints:

  • The answer URL will be the answer.php endpoint you created already.

  • Set the event URL to event.php. We will create this file in the next section.

  • To create an application, go to the Create an Application page on the Vonage Dashboard, and define a Name for your Application.

  • If needed, click on "generate public and private key". A private key (.key file) will be generated. Download and store it securely. This key is needed for authentication when making API requests. Note: Private keys will not work unless the application is saved.

  • Choose the capabilities you need (e.g., Voice, Messages, RTC, etc.) and provide the required webhooks (e.g., event URLs, answer URLs, or inbound message URLs). These will be described in the tutorial.

  • To save and deploy, click "Generate new application" to finalize the setup. Your application is now ready to use with Vonage APIs.

With your Vonage Application now created, your available virtual numbers will appear at the bottom of the screen—including the one you just purchased in the previous step.

Select the number you’d like to use for this tutorial, then click the Link button next to it to link your virtual number and Vonage Application together.

As a result, when you now call your virtual number, Vonage will look for call flow instructions at the URL you specified as Answer URL, and send event webhooks to your Event URL.

Next, let’s check that everything we’ve done so far is working. Call the number and see if you hear the greeting; if so, ask someone else to call in and enjoy a chat.

If it doesn't work the first time, don't worry. The next step is to build the event handling so you can see what's going on—and if there are errors, this is how you will see them.

Handle Call Events

To keep things simple, the application expects its event URL to be/event.php—and if you've already tested this, you have seen some failing requests arriving there.

To create a simple event handler, create a file public/event.php and add the following code:

<?php

$post_params = json_decode(file_get_contents("php://input"), true);
$input_params = $_GET;

if (is_array($post_params)) {
    $input_params = array_merge($input_params, $post_params);
}

if (isset($input_params['status'])) {
    error_log("Status: " . $input_params['status']);
}
error_log("Event data: " . json_encode($input_params));

It's possible to configure the event URL to use either GET or POST requests, so this code will handle either! It's very simple and writes the data to the error_log, so if you're using the local PHP web server as I did in this example, you will see the events in the output of the web server process. In a real-world application, you can link your event URL to something more formal.

Get the Party Conference Call Started

If you haven't tried it already, go ahead and call your Vonage number. Then invite your friends, family, and colleagues to do the same. You'll see the events during the calls arrive in event.php, and the various calls being answered, with requests made to answer.php.

Your Next Move?

There are a few things you might like to do next:

  • Look at the NCCO documentation for how to record these calls, play hold music, or assign a specific moderator to the call.

Conclusion

In this tutorial, we built a PHP-powered conference call using the Vonage Voice API. You configured a Voice application, handled inbound call webhooks, and returned an NCCO to place multiple callers into the same conversation.

From here, you can extend this project by adding call recording, assigning moderators, playing hold music, or dynamically generating conference room names. You could also combine this workflow with the Messages API to send reminders, or integrate authentication to control who can join.

Have a question or something to share? Join the conversation on the Vonage Community Slack, stay up to date with the Developer Newsletter, follow us on X (formerly Twitter), and subscribe to our YouTube channel for video tutorials. Stay connected, share your progress, and keep up with the latest developer news, tips, and events!

Share:

https://a.storyblok.com/f/270183/372x373/36054b72d0/julia-biro.png
Julia BiroDeveloper Advocate

Julia is committed to empowering fellow developers by creating tutorials, guides, and practical resources. With a background in outreach and education, she aims to make technology more accessible and enhance the overall developer experience. You can often find her at local community events.