Skip to content

Instantly share code, notes, and snippets.

@lgaetz
Last active December 30, 2020 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgaetz/25583ee2aa239228d65a62b67793acba to your computer and use it in GitHub Desktop.
Save lgaetz/25583ee2aa239228d65a62b67793acba to your computer and use it in GitHub Desktop.
#!/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