Skip to content

Commit

Permalink
feature(FreePBX): Allow to install custom modules (#359)
Browse files Browse the repository at this point in the history
* feature(FreePBX): Allow to install custom modules

* Create freepbx_custom_modules directory

* Change freepbx custom module path

* Update freepbx/README.md

Co-authored-by: Matteo Valentini <[email protected]>

---------

Co-authored-by: Matteo Valentini <[email protected]>
  • Loading branch information
Stell0 and Amygos authored Jan 27, 2025
1 parent 256b721 commit e52fc9d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions freepbx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ NethVoice send voicemail emails using s-nail. Smarthost is configured with follo

By default, at container startup, trunks are configured to use the outbound proxy. But sometimes it's necessary to configure a different proxy or none. In this case, make sure that trunk name contains the string "custom". For instance, a trunk named "Foo", will have proxy overwritten at container startup, a trunk named "Foo_custom" will be left unchanged.

## FreePBX custom modules

To install a FreePBX custom module, place it's .tar.gz in the folder `/home/nethvoiceX/.config/state/freepbx_custom_modules/` and restart FreePBX
Its filename must be the name of the module .tar.gz. For instance, for installing the apicall module:

```
runagent -m nethvoiceX
curl -L https://github.com/Stell0/apicall-freepbx/archive/refs/heads/main.tar.gz -o ./freepbx_custom_modules/apicall.tar.gz
systemctl --user restart freepbx
```
The module will be reinstalled into container again at every restart of container

# Asterisk

Asterisk container merged with FreePBX
8 changes: 8 additions & 0 deletions freepbx/freepbx_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ do
fi
done

# install custom freepbx modules
for module_file in $(ls /freepbx_custom_modules); do
module=$(echo ${module_file} | sed 's/.tar.gz//')
mkdir -p /var/www/html/freepbx/admin/modules/${module}
tar xzpf /freepbx_custom_modules/${module_file} --strip-component=1 -C /var/www/html/freepbx/admin/modules/${module}
fwconsole moduleadmin install $module
done

# Fix permissions
fwconsole chown

Expand Down
Empty file.
1 change: 1 addition & 0 deletions imageroot/systemd/user/freepbx.service
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ExecStart=runagent /usr/bin/podman run \
--volume=astdb:/var/lib/asterisk/db:z \
--volume=phonebookcsv:/var/lib/nethvoice/phonebook/uploads/:z \
--volume=/dev/log:/dev/log \
--volume=./freepbx_custom_modules:/freepbx_custom_modules:z \
--env-file=%S/state/passwords.env \
--env=NETHVOICE* \
--env=ASTERISK_* \
Expand Down

0 comments on commit e52fc9d

Please sign in to comment.