Last active
December 30, 2020 16:22
-
-
Save lgaetz/25583ee2aa239228d65a62b67793acba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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