Conference

Have you registered a callback URL to receive requests for your virtual number? Please click here.

This element lets you add all the users that dial into the phone number to a conference call.

This is a terminal action. ie. No action will be executed after this.

Here is a sample response:

<Response>
  <Conference/>
</Response>

Sample PHP Implementation

Assuming that you have configured the callback URL for your Africa's Talking Phone Number to point to conferenceCall.php. Below is an example of how you can implement a simple conference call.
<?php
// Save this code in conferenceCall.php. Configure the callback URL for your phone number
// to point to the location of this script on the web
// e.g http://www.myawesomesite.com/conferenceCall.php

// First read a couple of the POST variables passed in with the request

// This is a unique ID generated for this call
$sessionId = $_POST['sessionId'];

// Check to see whether this call is active
$isActive  = $_POST['isActive'];

if ($isActive == 1)  {
  
  // Add the caller to the conference room
  
  // Compose the response  
  $response  = '<?xml version="1.0" encoding="UTF-8"?>';
  $response .= '<Response>';
  $response .= '<conference>';
  $response .= '</Response>';
       
  // Print the response onto the page so that our gateway can read it
  header('Content-type: text/plain');
  echo $response;

} else {
  
  // Read in call details (duration, cost). This flag is set once the call is completed.
  // Note that the gateway does not expect a response in this case
  
  $duration     = $_POST['durationInSeconds'];
  $currencyCode = $_POST['currencyCode'];
  $amount       = $_POST['amount'];

  // You can then store this information in the database for your records

}