Find a file
2025-02-17 10:11:05 -07:00
interactionHandlers Update admin commands 2025-02-11 09:07:05 -07:00
migrations - Disable unfinished CDR commands 2025-02-11 08:28:41 -07:00
.env.example Update README.md with updated setup instructions 2025-02-11 08:49:28 -07:00
.gitignore Checkpoint; Full rewrite is underway, this shouldn't take long! 2025-01-25 07:40:09 -07:00
commands.js Guuuh 2025-02-11 08:52:22 -07:00
deletions.js Prob not the best way to do it, but itll work 2025-02-17 10:11:05 -07:00
freepbx-manager.service Add example systemd unit 2024-06-18 21:53:13 -06:00
freepbx.js Test fix for ext deletion 2025-02-17 10:09:01 -07:00
index.js Guuuh 2025-02-11 08:52:22 -07:00
LICENSE Add readme and license! 2024-04-03 14:53:36 -06:00
migrations.js Checkpoint; Full rewrite is underway, this shouldn't take long! 2025-01-25 07:40:09 -07:00
package-lock.json - Disable unfinished CDR commands 2025-02-11 08:28:41 -07:00
package.json - Disable unfinished CDR commands 2025-02-11 08:28:41 -07:00
README.md Update URL in readme 2025-02-11 08:50:07 -07:00
TODO.md A lotta stuff 2025-01-25 11:49:40 -07:00

FreePBX Manager

License

Description

FreePBX Manager is a Discord bot designed to manage FreePBX configurations. Please note that this project is currently a hot mess and may not be suitable for production use.

Pre-requisites

Features

  • User-created extensions

  • Automatic extension creation

  • Extension deletion

  • Extension status

  • Extension list

  • Probably some more stuff that I forgot to write down lol

Setup

To set up the config file, follow the steps below:

  1. Clone the repository:

    git clone https://git.chrischro.me/ChrisChrome/discord-freepbx-manager.git
    
    cd discord-freepbx-manager
    
  2. Install the required dependencies:

    npm install --save
    
  3. Copy .env.example to .env

  4. Configure the .env file with the following options:

PBX_HOSTNAME: This is the hostname or IP address of your PBX (Private Branch Exchange) server. It is used to connect to the PBX system. This value is whats sent to the end users via the bot. Can be whatever and won't affect the functionality of the bot.

FREEPBX_URL: Base URL for the API of your PBX. i.e. https://pbx.example.com

FREEPBX_CLIENT_ID: This is the client ID used for authenticating with the FreePBX API. It is part of the OAuth2 authentication process.

FREEPBX_CLIENT_SECRET: This is the client secret used along with the client ID for authenticating with the FreePBX API.

DB_HOST: This is the hostname or IP address of your database server. It is used to connect to the database. If running on your PBX, set to 127.0.0.1

DB_USER: This is the username used to authenticate with the database.

DB_PASS: This is the password used to authenticate with the database.

DISCORD_TOKEN: This is the token for your Discord bot. It is used to authenticate the bot with the Discord API.

OWNER_ID: This is the Discord user ID of the bot owner. It can be used to grant special permissions or access to the bot owner.

EXTENSION_ROLE_ID: Discord role ID of the role to give PBX users when they make their extension.

DISCORD_GUILD: This is the Discord server (guild) ID where the bot will operate. This is used to determine if extensions are orphaned, so make sure it's set correctly.

These environment variables are used to configure your application and provide necessary credentials and settings for connecting to various services. Make sure to keep this information secure and do not share it publicly.

  1. Run the bot:
    node .
    
  2. Invite the bot to your Discord server using the following link:
    https://discord.com/oauth2/authorize?client_id=YOUR_BOT_ID&scope=bot&permissions=8
    
  3. You're all set! The bot should now be up and running.