Skip to content

Instantly share code, notes, and snippets.

@lgaetz

lgaetz/confkick.php

Last active Dec 30, 2020
Embed
What would you like to do?
#!/usr/bin/env php
<?php
/*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
* confkick.php
* FreePBX AGI file kicks all conference participants from the conference number received as argument
*
* Usage: Call from FreePBX dialplan using single argument with conf number to be kicked
* exten => s,n,AGI(confkick.php,1000)
*
* License: GNU GPL/3
*
* Version History
* 2017-08-30 First revision
* 2020-12-30 Added license details
*
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***/
// Load FreePBX bootstrap environment
include '/etc/freepbx.conf';
// Connect to AGI - probably unnecessary as it's only used for logging to Asterisk full log
require_once "phpagi.php";
$AGI = new AGI();
if($astman->connected()) {
$AGI->verbose("Purging all participants from conference: ".$argv[1], 0);
$astman->ConfbridgeKick($argv[1], 'all');
} else {
$AGI->verbose("Asterisk manager not connected, can't purge conference participants", 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment