Last active
August 4, 2022 13:09
-
-
Save lgaetz/fa550bc8f402df6edafea758da353315 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** | |
* | |
* Script: inroute-del.php | |
* | |
* Latest version: https://gist.github.com/lgaetz/fa550bc8f402df6edafea758da353315 | |
* | |
* Usage: Run script on FreePBX system with no arguments to get a list of inbound routes by index. | |
* Run script with single index argument to delete an inbound route. | |
* | |
* License: GNU/GPL3+ | |
* | |
* History: | |
* 2018-06-19 First commit by lgaetz | |
***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *****/ | |
include '/etc/freepbx.conf'; | |
$FreePBX = FreePBX::Create(); | |
$routes=$FreePBX->Core->getAllDIDs(); | |
foreach($routes as $key => $route) { | |
print ($key." ".$route['cidnum']."/".$route['extension']."\n"); | |
} | |
if (isset($argv[1])){ | |
print("\nDeleting route index ".$argv[1]); | |
$delete=$FreePBX->Core->delDID($routes[$argv[1]]['extension'],$routes[$argv[1]]['cidnum']); | |
} | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment