Deploy Configuration Changes¶
This guide covers deploying Asterisk and platform configuration changes to both the NUC gateway and the cloud PBX server.
Always back up first
Before modifying any configuration file, create a backup:
Git Workflow¶
All configuration is tracked in the astradial/sip-gateway GitHub repository.
# Make changes locally or on the server
git add -A
git commit -m "description of change"
git push origin main
Tip
Commit and push before deploying so there is always a rollback point.
NUC Configuration Changes¶
The NUC gateway handles Tata SIP trunk termination and routes calls to the cloud.
Option A: Edit locally and SCP¶
# Edit the file on your local machine
nano ext_tata_gateway.conf
# Copy to NUC (via local network)
scp ext_tata_gateway.conf user@192.168.0.13:/tmp/
# SSH to NUC and move into place
ssh user@192.168.0.13
sudo cp /tmp/ext_tata_gateway.conf /etc/asterisk/
sudo chown asterisk:asterisk /etc/asterisk/ext_tata_gateway.conf
Option B: Git pull on NUC¶
ssh user@192.168.0.13
cd /path/to/sip-gateway
git pull origin main
sudo cp configs/nuc/* /etc/asterisk/
sudo chown -R asterisk:asterisk /etc/asterisk/
Apply the changes¶
After copying files, reload or restart Asterisk on the NUC (see reload commands below).
Cloud Configuration Changes¶
SSH to the cloud server and edit directly, or pull from git:
ssh root@89.116.31.109
# Direct edit
sudo nano /etc/asterisk/pjsip_wizard.conf
# Or git pull
cd /path/to/sip-gateway
git pull origin main
sudo cp configs/cloud/* /etc/asterisk/
sudo chown -R asterisk:asterisk /etc/asterisk/
Reload Commands¶
Use the least disruptive reload method for the type of change.
Dialplan changes only¶
Dialplan changes (extensions.conf, ext_*.conf) require only a dialplan reload. This does not affect active calls.
PJSIP changes¶
Changes to PJSIP configuration (pjsip.conf, pjsip_wizard.conf, endpoint/transport definitions) require a module reload:
Warning
Reloading res_pjsip.so may briefly interrupt registrations. Endpoints will re-register automatically within their registration interval (typically 60-300 seconds).
Other module-specific reloads¶
| Change type | Reload command |
|---|---|
| Dialplan | asterisk -rx 'dialplan reload' |
| PJSIP | asterisk -rx 'module reload res_pjsip.so' |
| Voicemail | asterisk -rx 'voicemail reload' |
| Music on Hold | asterisk -rx 'module reload res_musiconhold.so' |
| CDR | asterisk -rx 'module reload cdr_manager.so' |
Full Asterisk restart¶
Only use this when a module reload is insufficient, or after major changes:
Call disruption
core restart now drops all active calls immediately. Use core restart gracefully to wait for active calls to end before restarting:
Deployment Checklist¶
- [ ] Changes committed and pushed to
astradial/sip-gateway - [ ] Backup of existing config created (
.bakfile) - [ ] Config files copied to
/etc/asterisk/with correct ownership (asterisk:asterisk) - [ ] Appropriate reload command issued (not a full restart unless necessary)
- [ ] Verified changes loaded:
asterisk -rx 'dialplan show <context>'orasterisk -rx 'pjsip show endpoints' - [ ] Test call placed to confirm routing works
- [ ] Checked
/var/log/asterisk/fullfor errors
Rollback¶
If something goes wrong, restore from backup:
sudo cp /etc/asterisk/somefile.conf.bak /etc/asterisk/somefile.conf
sudo chown asterisk:asterisk /etc/asterisk/somefile.conf
asterisk -rx 'dialplan reload' # or appropriate reload
Or revert the git commit and redeploy: