install.md - custompbx/custompbx GitHub Wiki
- Download the Compiled CustomPbx binary or build it.
- Install FreeSWITCH on your server.
- Install Postgres on your server.
Run the following commands to create a Postgres user and database:
sudo -u postgres createuser <username>
sudo -u postgres createdb <dbname>
sudo -u postgres psql -c "ALTER USER <username> WITH ENCRYPTED PASSWORD '<password>'"
sudo -u postgres psql -c "ALTER ROLE <username> WITH LOGIN"
sudo -u postgres psql -c "GRANT ALL ON SCHEMA public TO <username>"
sudo -u postgres psql -c "GRANT all PRIVILEGES ON DATABASE <database> TO <username>"
- Copy the cpbx binary to your server.
- Create a
config.json
file or run and stop cpbx to auto-generate it. - Adjust the parameters in
config.json
according to your setup. - Ensure that the configurations in
config.json
accurately reflect your FreeSWITCH and database setup.
Sample config.json
:
```json
{
"freeswitch": {
"switchname": "freeswitch1",
"esl": {
"host": "127.0.0.1",
"port": 8021,
"pass": "ClueCon",
"timeout": 10,
"collect_logs": 7
}
},
"webserver": {
"route": "/ws",
"host": "127.0.0.1",
"port": 8080,
"stun_port": 3478,
"cert_path": "/etc/freeswitch/tls/wss.pem",
"key_path": "/etc/freeswitch/tls/wss.pem"
},
"xml_curl_server": {
"route": "/conf/config",
"host": "127.0.0.1",
"port": 8081,
"cert_path": "/etc/freeswitch/tls/wss.pem",
"key_path": "/etc/freeswitch/tls/wss.pem"
},
"database": {
"name": "custompbx",
"host": "127.0.0.1",
"port": 5432,
"user": "custompbx",
"pass": "custompbx"
}
}
```
- Uncomment
mod_xml_curl
inmodules.conf
in the FreeSWITCH configs directory for enabling the module. - Add the following line to the configuration:
<param name="gateway-url" value="https://<xml_curl_server.host>:<xml_curl_server.port>/<xml_curl_server.route>" bindings="configuration|directory|dialplan"/>
. - Load or reload
mod_xml_curl
.
Run CustomPBX, and observe the common startup output.
CustomPBX development version: 0.0.1
Starting...
DB
Events Handler
Cache
ESL Connection and handlers
FS logs collecting
HEP collecting
Connection to ESL
Web Handlers
Secure Web Server
Secure XMLCurl Server
STUN Server
- Open
https://<webserver HOST>:<webserver PORT>/cweb
. - Default credentials: Login: admin, Password: admin.
You will see dashboard as first page more data will appear on it after you import or create direcoty and sofia configs.
- Navigate to settings as shown in the screenshot.
- Change the default password.
Not imported configs will return will be served with existing static XML config files.
⚠WARNING: on importing configs right from FreeSWITCH all global variables will be resolved into their values.
- Go to Directory > Domains and press import.
- Or add new domains from scratch.
- Import or create configs.
- Manage modules and dialplan similarly using the provided screenshots.