Agc Vicidial.php

Today, VICIDIAL has grown up. The web interface looks modern. Cloud hosting has replaced server rooms filled with copper wires. Yet, deep in the bowels of every VICIDIAL server, vicidial.php (or its evolved variations) still runs.

It is a testament to a different era of coding—an era where efficiency reigned supreme, where comments in the code told stories, and where a single PHP file could carry the weight of a company’s revenue on its back.

So the next time you pick up the phone and there is that tell-tale half-second of silence before the agent speaks, spare a thought for the invisible worker. Somewhere in a data center, vicidial.php is running, bridging connections, calculating talk time, and keeping the world of commerce talking.

To understand agc vicidial.php, you must understand a typical inbound or outbound call flow in Vicidial:

Ensure the agc vicidial.php process runs under the asterisk user, not root. Check with: agc vicidial.php

ps aux | grep "agc vicidial.php" | grep -v grep

<?php
// agc_vicidial.php
// Version: 1.0
// Description: AGC integration script for Vicidial

include_once('/etc/astguiclient.conf'); include_once('/usr/share/php/DB.php');

// Connect to Vicidial DB $db = DB::connect("mysql://$conf['db_user']:$conf['db_pass']@$conf['db_host']/$conf['db_name']");

// Retrieve incoming variables (from GET/POST or STDIN) $phone_number = $_GET['phone_number'] ?? ''; $lead_id = $_GET['lead_id'] ?? 0; $campaign_id = $_GET['campaign_id'] ?? '';

// Function to query AGC server function get_agc_content($lead_id, $campaign_id) $agc_api_url = "http://agc-server.local/api/v1/content"; $payload = json_encode([ 'lead_id' => $lead_id, 'campaign' => $campaign_id ]); Today, VICIDIAL has grown up

$ch = curl_init($agc_api_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);

// Main logic if ($phone_number && $lead_id) $agc_data = get_agc_content($lead_id, $campaign_id);

// Example: Override CallerID with AGC provided value
if (!empty($agc_data['dynamic_callerid'])) 
    echo "callerid_number=" . $agc_data['dynamic_callerid'] . "\n";
// Example: Inject pre-call audio file
if (!empty($agc_data['audio_file'])) 
    echo "custom_audio=" . $agc_data['audio_file'] . "\n";
// Log to AGC database
$insert = "INSERT INTO agc_call_log (lead_id, phone_number, campaign_id, response_data, call_time) 
           VALUES (?, ?, ?, ?, NOW())";
$db->query($insert, [$lead_id, $phone_number, $campaign_id, json_encode($agc_data)]);

else // Fallback to standard Vicidial dialing echo "status=continue\n"; ?>

A common point of confusion for newcomers is that there isn't just one vicidial.php. Depending on the version of Vicidial you are running (SVN trunk, version 2.14, 3.x, etc.), the functionality may be split or renamed. Common variations you might see include:

Note: Always check your specific version's file structure, as the Vicidial community frequently optimizes code organization.

Every agc vicidial.php run logs its last 200 lines of output into the MySQL table vicidial_agi_output. Query it in real-time:

SELECT * FROM vicidial_agi_output WHERE uniqueid = 'your-call-id' ORDER BY event_time DESC;

While the VICIDIAL web interface (the admin.php page that agents stared at) was the face of the system, vicidial.php was the brainstem. It lived in the shadows. // Main logic if ($phone_number && $lead_id) $agc_data

Here is what happens in the two seconds between a customer saying "Hello?" and the agent hearing a beep in their headset:

  • The Action: vicidial.php writes commands to the Asterisk server: "Bridge channel A to channel B. Start recording. Update the 'Talk Time' counter."
  • Without vicidial.php, the system is deaf, dumb, and blind. It is the translator between the raw audio signals of the telephone network and the organized data grids of the sales manager’s dashboard.